Skip to content

Commit

Permalink
Prepare for release 1.11.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
Iurii Makhno committed Oct 18, 2022
1 parent 2925ca4 commit 56f14f0
Show file tree
Hide file tree
Showing 90 changed files with 2,210 additions and 857 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ https://developer.android.com/studio/command-line/bundletool

## Releases

Latest release: [1.11.2](https://github.com/google/bundletool/releases)
Latest release: [1.11.3](https://github.com/google/bundletool/releases)
2 changes: 0 additions & 2 deletions archive/com/google/android/archive/README.md

This file was deleted.

138 changes: 0 additions & 138 deletions archive/com/google/android/archive/ReactivateActivity.java

This file was deleted.

43 changes: 0 additions & 43 deletions archive/com/google/android/archive/UpdateBroadcastReceiver.java

This file was deleted.

20 changes: 11 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ dependencies {
shadow "com.google.auto.value:auto-value-annotations:1.6.2"
annotationProcessor "com.google.auto.value:auto-value:1.6.2"
shadow "com.google.errorprone:error_prone_annotations:2.3.1"
shadow "com.google.guava:guava:30.1-jre"
shadow "com.google.protobuf:protobuf-java:3.10.0"
shadow "com.google.protobuf:protobuf-java-util:3.10.0"
shadow "com.google.guava:guava:31.0.1-jre"
shadow "com.google.protobuf:protobuf-java:3.19.2"
shadow "com.google.protobuf:protobuf-java-util:3.19.2"
shadow "com.google.dagger:dagger:2.28.3"
annotationProcessor "com.google.dagger:dagger-compiler:2.28.3"
shadow "javax.inject:javax.inject:1"
Expand All @@ -64,12 +64,12 @@ dependencies {
testImplementation "com.google.auto.value:auto-value-annotations:1.6.2"
testAnnotationProcessor "com.google.auto.value:auto-value:1.6.2"
testImplementation "com.google.errorprone:error_prone_annotations:2.3.1"
testImplementation "com.google.guava:guava:30.1-jre"
testImplementation "com.google.guava:guava:31.0.1-jre"
testImplementation "com.google.truth.extensions:truth-java8-extension:0.45"
testImplementation "com.google.truth.extensions:truth-proto-extension:0.45"
testImplementation "com.google.jimfs:jimfs:1.1"
testImplementation "com.google.protobuf:protobuf-java:3.10.0"
testImplementation "com.google.protobuf:protobuf-java-util:3.10.0"
testImplementation "com.google.protobuf:protobuf-java:3.19.2"
testImplementation "com.google.protobuf:protobuf-java-util:3.19.2"
testImplementation "org.mockito:mockito-core:2.18.3"
testImplementation "junit:junit:4.12"
testImplementation "org.bouncycastle:bcprov-jdk15on:1.56"
Expand Down Expand Up @@ -121,7 +121,7 @@ test {

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.4.0"
artifact = "com.google.protobuf:protoc:3.19.2"
}
}

Expand Down Expand Up @@ -185,12 +185,14 @@ shadowJar {
relocate('com.android', 'shadow.bundletool.com.android') {
// BundleTool classes.
exclude 'com.android.tools.build.bundletool.**'
exclude '/com/android/tools/build/bundletool/**'
// Bundle protos.
exclude 'com.android.bundle.**'
// Aapt protos.
exclude 'com.android.aapt.**'
// String constants in classes.
// For some reason, the Shadow plug-in seems to rename strings in classes too!
exclude 'com.android.vending'
exclude 'com.android.vending.splits'
exclude 'com.android.vending.splits.required'
exclude 'com.android.dynamic.apk.fused.modules'
Expand All @@ -210,8 +212,8 @@ task executableJar(type: ShadowJar) {
from({ zipTree(project.configurations.implementationMacOs.singleFile) }) { into 'macos/' }
from({ zipTree(project.configurations.implementationLinux.singleFile) }) { into 'linux/' }
configurations = [
project.configurations.runtimeClasspath,
project.configurations.shadow
project.configurations.shadow,
project.configurations.runtimeClasspath
]
manifest {
attributes 'Main-Class': 'com.android.tools.build.bundletool.BundleToolMain'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release_version = 1.11.2
release_version = 1.11.3
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
package com.android.tools.build.bundletool.androidtools;

import com.android.tools.build.bundletool.androidtools.CommandExecutor.CommandOptions;
import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
import java.nio.file.Path;
import java.time.Duration;

/** Exposes aapt2 commands used by Bundle Tool. */
public interface Aapt2Command {

void convertApkProtoToBinary(Path protoApk, Path binaryApk);
void convertApkProtoToBinary(Path protoApk, Path binaryApk, ConvertOptions convertOptions);

void optimizeToSparseResourceTables(Path originalApk, Path outputApk);

Expand All @@ -38,19 +39,20 @@ static Aapt2Command createFromExecutablePath(Path aapt2Path) {
private final Duration timeoutMillis = Duration.ofMinutes(5);

@Override
public void convertApkProtoToBinary(Path protoApk, Path binaryApk) {
ImmutableList<String> convertCommand =
ImmutableList.of(
aapt2Path.toString(),
"convert",
"--output-format",
"binary",
"-o",
binaryApk.toString(),
protoApk.toString());
public void convertApkProtoToBinary(
Path protoApk, Path binaryApk, ConvertOptions convertOptions) {
ImmutableList.Builder<String> convertCommand =
ImmutableList.<String>builder().add(aapt2Path.toString()).add("convert");
convertCommand
.add("--output-format")
.add("binary")
.add("-o")
.add(binaryApk.toString())
.add(protoApk.toString());

new DefaultCommandExecutor()
.execute(convertCommand, CommandOptions.builder().setTimeout(timeoutMillis).build());
.execute(
convertCommand.build(), CommandOptions.builder().setTimeout(timeoutMillis).build());
}

@Override
Expand All @@ -77,4 +79,22 @@ public ImmutableList<String> dumpBadging(Path apkPath) {
}
};
}

/** Options for 'aapt2 convert' command. */
@AutoValue
abstract class ConvertOptions {
public abstract boolean getForceSparseEncoding();

public static Builder builder() {
return new AutoValue_Aapt2Command_ConvertOptions.Builder().setForceSparseEncoding(false);
}

/** Builder for {@link ConvertOptions}. */
@AutoValue.Builder
public abstract static class Builder {
public abstract Builder setForceSparseEncoding(boolean value);

public abstract ConvertOptions build();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

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

import static com.android.tools.build.bundletool.archive.ArchivedResourcesUtils.ARCHIVED_ICON_DRAWABLE_NAME;
import static com.android.tools.build.bundletool.archive.ArchivedResourcesUtils.ARCHIVED_ROUND_ICON_DRAWABLE_NAME;
import static com.android.tools.build.bundletool.archive.ArchivedResourcesHelper.ARCHIVED_ICON_DRAWABLE_NAME;
import static com.android.tools.build.bundletool.archive.ArchivedResourcesHelper.ARCHIVED_ROUND_ICON_DRAWABLE_NAME;
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;
Expand Down Expand Up @@ -46,8 +46,7 @@ public final class ArchivedAndroidManifestUtils {

public static final String REACTIVATE_ACTIVITY_NAME =
"com.google.android.archive.ReactivateActivity";
public static final String HOLO_LIGHT_NO_ACTION_BAR_THEME =
"@android:style/Theme.Holo.Light.NoActionBar";
public static final int HOLO_LIGHT_NO_ACTION_BAR_FULSCREEN_THEME_RES_ID = 0x010300f1;

public static final String UPDATE_BROADCAST_RECEIVER_NAME =
"com.google.android.archive.UpdateBroadcastReceiver";
Expand Down Expand Up @@ -169,7 +168,7 @@ private static Activity createReactivateActivity(AndroidManifest manifest) {

return Activity.builder()
.setName(REACTIVATE_ACTIVITY_NAME)
.setTheme(HOLO_LIGHT_NO_ACTION_BAR_THEME)
.setTheme(HOLO_LIGHT_NO_ACTION_BAR_FULSCREEN_THEME_RES_ID)
.setExported(true)
.setExcludeFromRecents(true)
.setStateNotNeeded(true)
Expand Down
Loading

0 comments on commit 56f14f0

Please sign in to comment.