Skip to content

Commit

Permalink
Prepare for release 1.11.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
dovix91 committed Jun 24, 2022
1 parent 37701bf commit 1082065
Show file tree
Hide file tree
Showing 78 changed files with 3,929 additions and 701 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ https://developer.android.com/studio/command-line/bundletool

## Releases

Latest release: [1.10.1](https://github.com/google/bundletool/releases)
Latest release: [1.11.0](https://github.com/google/bundletool/releases)
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release_version = 1.10.1
release_version = 1.11.0
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.android.tools.build.bundletool.commands.BuildApksCommand;
import com.android.tools.build.bundletool.commands.BuildBundleCommand;
import com.android.tools.build.bundletool.commands.BuildSdkApksCommand;
import com.android.tools.build.bundletool.commands.BuildSdkAsarCommand;
import com.android.tools.build.bundletool.commands.BuildSdkBundleCommand;
import com.android.tools.build.bundletool.commands.CheckTransparencyCommand;
import com.android.tools.build.bundletool.commands.CommandHelp;
Expand All @@ -29,6 +30,7 @@
import com.android.tools.build.bundletool.commands.GetSizeCommand;
import com.android.tools.build.bundletool.commands.InstallApksCommand;
import com.android.tools.build.bundletool.commands.InstallMultiApksCommand;
import com.android.tools.build.bundletool.commands.PrintDeviceTargetingConfigCommand;
import com.android.tools.build.bundletool.commands.ValidateBundleCommand;
import com.android.tools.build.bundletool.commands.VersionCommand;
import com.android.tools.build.bundletool.device.AdbServer;
Expand Down Expand Up @@ -86,6 +88,9 @@ static void main(String[] args, Runtime runtime) {
case BuildSdkApksCommand.COMMAND_NAME:
BuildSdkApksCommand.fromFlags(flags).execute();
break;
case BuildSdkAsarCommand.COMMAND_NAME:
BuildSdkAsarCommand.fromFlags(flags).execute();
break;
case ExtractApksCommand.COMMAND_NAME:
ExtractApksCommand.fromFlags(flags).execute();
break;
Expand Down Expand Up @@ -182,6 +187,15 @@ public static void help(String commandName, Runtime runtime) {
case BuildApksCommand.COMMAND_NAME:
commandHelp = BuildApksCommand.help();
break;
case BuildSdkBundleCommand.COMMAND_NAME:
commandHelp = BuildSdkBundleCommand.help();
break;
case BuildSdkApksCommand.COMMAND_NAME:
commandHelp = BuildSdkApksCommand.help();
break;
case BuildSdkAsarCommand.COMMAND_NAME:
commandHelp = BuildSdkAsarCommand.help();
break;
case ExtractApksCommand.COMMAND_NAME:
commandHelp = ExtractApksCommand.help();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

package com.android.tools.build.bundletool.archive;

import static com.android.tools.build.bundletool.model.AndroidManifest.ALLOW_BACKUP_RESOURCE_ID;
import static com.android.tools.build.bundletool.model.AndroidManifest.ANDROID_NAMESPACE_URI;
import static com.android.tools.build.bundletool.model.AndroidManifest.BACKUP_AGENT_RESOURCE_ID;
import static com.android.tools.build.bundletool.model.AndroidManifest.LAUNCHER_CATEGORY_NAME;
import static com.android.tools.build.bundletool.model.AndroidManifest.LEANBACK_FEATURE_NAME;
import static com.android.tools.build.bundletool.model.AndroidManifest.LEANBACK_LAUNCHER_CATEGORY_NAME;
Expand All @@ -34,7 +36,6 @@
import com.android.tools.build.bundletool.model.utils.xmlproto.XmlProtoNode;
import com.android.tools.build.bundletool.model.version.BundleToolVersion;
import com.google.common.collect.ImmutableList;
import java.util.Optional;

/** Utility methods for creation of archived manifest. */
public final class ArchivedAndroidManifestUtils {
Expand Down Expand Up @@ -98,7 +99,17 @@ public static AndroidManifest createArchivedManifest(AndroidManifest manifest) {
APPLICATION_ATTRIBUTES_TO_KEEP.forEach(
attrResourceId ->
editor.copyApplicationElementAndroidAttribute(manifest, attrResourceId));
getArchivedAllowBackup(manifest).ifPresent(editor::setAllowBackup);

// Backup needs to be disabled if Backup Agent is provided. Custom backup agent cannot be
// kept because it relies on app code that is not present in its archived variant.
// FullBackupOnly attribute value cannot be checked due to complicated and ambigous process
// of resolving attribute value (because boolean type is not being enforced and any other type
// such as resource refrenece can be acceptable).
if (!manifest.hasApplicationAttribute(BACKUP_AGENT_RESOURCE_ID)) {
editor.copyApplicationElementAndroidAttribute(manifest, ALLOW_BACKUP_RESOURCE_ID);
} else {
editor.setAllowBackup(false);
}
}

manifest
Expand All @@ -115,16 +126,6 @@ public static AndroidManifest createArchivedManifest(AndroidManifest manifest) {
return editor.save();
}

private static Optional<Boolean> getArchivedAllowBackup(AndroidManifest manifest) {
// Backup needs to be disabled if Backup Agent is provided and Full Backup Only is disabled.
// Custom backup agent cannot be kept because it relies on app code that is not present in its
// archived variant.
return manifest.getAllowBackup().orElse(true)
&& (!manifest.hasBackupAgent() || manifest.getFullBackupOnly().orElse(false))
? manifest.getAllowBackup()
: Optional.of(Boolean.FALSE);
}

private static XmlProtoNode createMinimalManifestTag() {
return XmlProtoNode.createElementNode(
XmlProtoElementBuilder.create("manifest")
Expand Down
Loading

0 comments on commit 1082065

Please sign in to comment.