Search in sources :

Example 6 with AppBundleSerializer

use of com.android.tools.build.bundletool.io.AppBundleSerializer in project bundletool by google.

the class CheckTransparencyCommandTest method bundleMode_transparencyVerified_transparencyKeyCertificateProvidedByUser.

@Test
public void bundleMode_transparencyVerified_transparencyKeyCertificateProvidedByUser() throws Exception {
    String serializedJws = createJwsToken(CodeTransparency.newBuilder().setVersion(CodeTransparencyVersion.getCurrentVersion()).build(), transparencyKeyCertificate, transparencyPrivateKey);
    AppBundleBuilder appBundle = new AppBundleBuilder().addModule("base", module -> module.setManifest(androidManifest("com.test.app"))).addMetadataFile(BundleMetadata.BUNDLETOOL_NAMESPACE, BundleMetadata.TRANSPARENCY_SIGNED_FILE_NAME, CharSource.wrap(serializedJws).asByteSource(Charset.defaultCharset()));
    new AppBundleSerializer().writeToDisk(appBundle.build(), bundlePath);
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    CheckTransparencyCommand.builder().setMode(Mode.BUNDLE).setBundlePath(bundlePath).setTransparencyKeyCertificate(transparencyKeyCertificate).build().checkTransparency(new PrintStream(outputStream));
    String output = new String(outputStream.toByteArray(), UTF_8);
    assertThat(output).contains("No APK present. APK signature was not checked.");
    assertThat(output).contains("Code transparency signature verified for the provided code transparency key" + " certificate.");
    assertThat(output).contains("Code transparency verified: code related file contents match the code transparency" + " file.");
}
Also used : X509Certificate(java.security.cert.X509Certificate) KeyPair(java.security.KeyPair) ApkTargeting(com.android.bundle.Targeting.ApkTargeting) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) ZipBuilder(com.android.tools.build.bundletool.io.ZipBuilder) Mode(com.android.tools.build.bundletool.commands.CheckTransparencyCommand.Mode) Path(java.nio.file.Path) FakeSystemEnvironmentProvider(com.android.tools.build.bundletool.testing.FakeSystemEnvironmentProvider) KeyPairGenerator(java.security.KeyPairGenerator) JsonWebSignature(org.jose4j.jws.JsonWebSignature) ImmutableMap(com.google.common.collect.ImmutableMap) CommandExecutionException(com.android.tools.build.bundletool.model.exceptions.CommandExecutionException) RequiredFlagNotSetException(com.android.tools.build.bundletool.flags.Flag.RequiredFlagNotSetException) ApkSerializer(com.android.tools.build.bundletool.io.ApkSerializer) FlagParser(com.android.tools.build.bundletool.flags.FlagParser) ByteString(com.google.protobuf.ByteString) SystemEnvironmentProvider(com.android.tools.build.bundletool.model.utils.SystemEnvironmentProvider) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ModuleSplit(com.android.tools.build.bundletool.model.ModuleSplit) PrivateKey(java.security.PrivateKey) ModuleEntry(com.android.tools.build.bundletool.model.ModuleEntry) SignerConfig(com.android.tools.build.bundletool.model.SignerConfig) CodeTransparencyCryptoUtils(com.android.tools.build.bundletool.transparency.CodeTransparencyCryptoUtils) CodeTransparencyVersion(com.android.tools.build.bundletool.transparency.CodeTransparencyVersion) CodeTransparency(com.android.bundle.CodeTransparencyOuterClass.CodeTransparency) Mockito.mock(org.mockito.Mockito.mock) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) TestModule(com.android.tools.build.bundletool.testing.TestModule) ByteArrayOutputStream(java.io.ByteArrayOutputStream) BundleModuleName(com.android.tools.build.bundletool.model.BundleModuleName) ZipPath(com.android.tools.build.bundletool.model.ZipPath) RunWith(org.junit.runner.RunWith) Hashing(com.google.common.hash.Hashing) Component(dagger.Component) RSA_USING_SHA384(org.jose4j.jws.AlgorithmIdentifiers.RSA_USING_SHA384) SigningConfiguration(com.android.tools.build.bundletool.model.SigningConfiguration) Inject(javax.inject.Inject) UnknownFlagsException(com.android.tools.build.bundletool.flags.ParsedFlags.UnknownFlagsException) ImmutableList(com.google.common.collect.ImmutableList) Charset(java.nio.charset.Charset) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ANDROID_SERIAL(com.android.tools.build.bundletool.testing.FakeSystemEnvironmentProvider.ANDROID_SERIAL) CharSource(com.google.common.io.CharSource) ByteSource(com.google.common.io.ByteSource) CodeTransparencyTestUtils.createJwsToken(com.android.tools.build.bundletool.testing.CodeTransparencyTestUtils.createJwsToken) ANDROID_HOME(com.android.tools.build.bundletool.testing.FakeSystemEnvironmentProvider.ANDROID_HOME) VariantTargeting(com.android.bundle.Targeting.VariantTargeting) AdbServer(com.android.tools.build.bundletool.device.AdbServer) Before(org.junit.Before) PrintStream(java.io.PrintStream) CertificateFactory(com.android.tools.build.bundletool.testing.CertificateFactory) Files(java.nio.file.Files) UTF_8(java.nio.charset.StandardCharsets.UTF_8) Test(org.junit.Test) BundleMetadata(com.android.tools.build.bundletool.model.BundleMetadata) JUnit4(org.junit.runners.JUnit4) Truth.assertThat(com.google.common.truth.Truth.assertThat) Rule(org.junit.Rule) Paths(java.nio.file.Paths) InvalidCommandException(com.android.tools.build.bundletool.model.exceptions.InvalidCommandException) CodeRelatedFile(com.android.bundle.CodeTransparencyOuterClass.CodeRelatedFile) TemporaryFolder(org.junit.rules.TemporaryFolder) PrintStream(java.io.PrintStream) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ByteString(com.google.protobuf.ByteString) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Test(org.junit.Test)

Example 7 with AppBundleSerializer

use of com.android.tools.build.bundletool.io.AppBundleSerializer in project bundletool by google.

the class CheckTransparencyCommandTest method bundleMode_verificationFailed_badCertificateProvidedByUser.

@Test
public void bundleMode_verificationFailed_badCertificateProvidedByUser() throws Exception {
    String serializedJws = createJwsToken(CodeTransparency.newBuilder().setVersion(CodeTransparencyVersion.getCurrentVersion()).build(), transparencyKeyCertificate, transparencyPrivateKey);
    AppBundleBuilder appBundle = new AppBundleBuilder().addModule("base", module -> module.setManifest(androidManifest("com.test.app"))).addMetadataFile(BundleMetadata.BUNDLETOOL_NAMESPACE, BundleMetadata.TRANSPARENCY_SIGNED_FILE_NAME, CharSource.wrap(serializedJws).asByteSource(Charset.defaultCharset()));
    new AppBundleSerializer().writeToDisk(appBundle.build(), bundlePath);
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    X509Certificate badCertificate = CertificateFactory.buildSelfSignedCertificate(kpg.generateKeyPair(), "CN=CheckTransparencyCommandTest_BadCertificate");
    CheckTransparencyCommand.builder().setMode(Mode.BUNDLE).setBundlePath(bundlePath).setTransparencyKeyCertificate(badCertificate).build().checkTransparency(new PrintStream(outputStream));
    String output = new String(outputStream.toByteArray(), UTF_8);
    assertThat(output).contains("No APK present. APK signature was not checked.");
    assertThat(output).contains("Code transparency verification failed because the provided public key certificate does" + " not match the code transparency file.");
    assertThat(output).contains("SHA-256 fingerprint of the certificate that was used to sign code" + " transparency file: " + CodeTransparencyCryptoUtils.getCertificateFingerprint(transparencyKeyCertificate));
    assertThat(output).contains("SHA-256 fingerprint of the certificate that was provided: " + CodeTransparencyCryptoUtils.getCertificateFingerprint(badCertificate));
}
Also used : X509Certificate(java.security.cert.X509Certificate) KeyPair(java.security.KeyPair) ApkTargeting(com.android.bundle.Targeting.ApkTargeting) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) ZipBuilder(com.android.tools.build.bundletool.io.ZipBuilder) Mode(com.android.tools.build.bundletool.commands.CheckTransparencyCommand.Mode) Path(java.nio.file.Path) FakeSystemEnvironmentProvider(com.android.tools.build.bundletool.testing.FakeSystemEnvironmentProvider) KeyPairGenerator(java.security.KeyPairGenerator) JsonWebSignature(org.jose4j.jws.JsonWebSignature) ImmutableMap(com.google.common.collect.ImmutableMap) CommandExecutionException(com.android.tools.build.bundletool.model.exceptions.CommandExecutionException) RequiredFlagNotSetException(com.android.tools.build.bundletool.flags.Flag.RequiredFlagNotSetException) ApkSerializer(com.android.tools.build.bundletool.io.ApkSerializer) FlagParser(com.android.tools.build.bundletool.flags.FlagParser) ByteString(com.google.protobuf.ByteString) SystemEnvironmentProvider(com.android.tools.build.bundletool.model.utils.SystemEnvironmentProvider) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ModuleSplit(com.android.tools.build.bundletool.model.ModuleSplit) PrivateKey(java.security.PrivateKey) ModuleEntry(com.android.tools.build.bundletool.model.ModuleEntry) SignerConfig(com.android.tools.build.bundletool.model.SignerConfig) CodeTransparencyCryptoUtils(com.android.tools.build.bundletool.transparency.CodeTransparencyCryptoUtils) CodeTransparencyVersion(com.android.tools.build.bundletool.transparency.CodeTransparencyVersion) CodeTransparency(com.android.bundle.CodeTransparencyOuterClass.CodeTransparency) Mockito.mock(org.mockito.Mockito.mock) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) TestModule(com.android.tools.build.bundletool.testing.TestModule) ByteArrayOutputStream(java.io.ByteArrayOutputStream) BundleModuleName(com.android.tools.build.bundletool.model.BundleModuleName) ZipPath(com.android.tools.build.bundletool.model.ZipPath) RunWith(org.junit.runner.RunWith) Hashing(com.google.common.hash.Hashing) Component(dagger.Component) RSA_USING_SHA384(org.jose4j.jws.AlgorithmIdentifiers.RSA_USING_SHA384) SigningConfiguration(com.android.tools.build.bundletool.model.SigningConfiguration) Inject(javax.inject.Inject) UnknownFlagsException(com.android.tools.build.bundletool.flags.ParsedFlags.UnknownFlagsException) ImmutableList(com.google.common.collect.ImmutableList) Charset(java.nio.charset.Charset) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ANDROID_SERIAL(com.android.tools.build.bundletool.testing.FakeSystemEnvironmentProvider.ANDROID_SERIAL) CharSource(com.google.common.io.CharSource) ByteSource(com.google.common.io.ByteSource) CodeTransparencyTestUtils.createJwsToken(com.android.tools.build.bundletool.testing.CodeTransparencyTestUtils.createJwsToken) ANDROID_HOME(com.android.tools.build.bundletool.testing.FakeSystemEnvironmentProvider.ANDROID_HOME) VariantTargeting(com.android.bundle.Targeting.VariantTargeting) AdbServer(com.android.tools.build.bundletool.device.AdbServer) Before(org.junit.Before) PrintStream(java.io.PrintStream) CertificateFactory(com.android.tools.build.bundletool.testing.CertificateFactory) Files(java.nio.file.Files) UTF_8(java.nio.charset.StandardCharsets.UTF_8) Test(org.junit.Test) BundleMetadata(com.android.tools.build.bundletool.model.BundleMetadata) JUnit4(org.junit.runners.JUnit4) Truth.assertThat(com.google.common.truth.Truth.assertThat) Rule(org.junit.Rule) Paths(java.nio.file.Paths) InvalidCommandException(com.android.tools.build.bundletool.model.exceptions.InvalidCommandException) CodeRelatedFile(com.android.bundle.CodeTransparencyOuterClass.CodeRelatedFile) TemporaryFolder(org.junit.rules.TemporaryFolder) PrintStream(java.io.PrintStream) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ByteString(com.google.protobuf.ByteString) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ByteArrayOutputStream(java.io.ByteArrayOutputStream) X509Certificate(java.security.cert.X509Certificate) Test(org.junit.Test)

Example 8 with AppBundleSerializer

use of com.android.tools.build.bundletool.io.AppBundleSerializer in project bundletool by google.

the class BuildApksPreprocessingTest method localTestingMode_enabled_addsMetadata.

@Test
public void localTestingMode_enabled_addsMetadata() throws Exception {
    AppBundle appBundle = createAppBundleWithBaseAndFeatureModules("feature");
    new AppBundleSerializer().writeToDisk(appBundle, bundlePath);
    BuildApksCommand command = BuildApksCommand.builder().setBundlePath(bundlePath).setOutputFile(outputFilePath).setLocalTestingMode(true).build();
    command.execute();
    try (ZipFile apkSet = new ZipFile(outputFilePath.toFile())) {
        BuildApksResult result = extractTocFromApkSetFile(apkSet, outputDir);
        assertThat(result.hasLocalTestingInfo()).isTrue();
        assertThat(result.getLocalTestingInfo().getEnabled()).isTrue();
        assertThat(result.getLocalTestingInfo().getLocalTestingPath()).isNotEmpty();
        ImmutableList<ApkDescription> apkDescriptions = apkDescriptions(result.getVariantList());
        assertThat(apkDescriptions).isNotEmpty();
        assertThat(apkDescriptions.stream().map(ApkDescription::getPath)).contains("splits/base-master.apk");
        for (ApkDescription apkDescription : apkDescriptions) {
            File apk = extractFromApkSetFile(apkSet, apkDescription.getPath(), outputDir);
            // The local testing metadata is set if and only if the apk is the base master.
            assertThat((apkDescription.hasSplitApkMetadata() && apkDescription.getSplitApkMetadata().getSplitId().isEmpty() && apkDescription.getSplitApkMetadata().getIsMasterSplit()) || apkDescription.hasStandaloneApkMetadata()).isEqualTo(extractAndroidManifest(apk).getMetadataValue(LocalTestingPreprocessor.METADATA_NAME).isPresent());
        }
    }
}
Also used : AppBundle(com.android.tools.build.bundletool.model.AppBundle) ApkDescription(com.android.bundle.Commands.ApkDescription) ZipFile(java.util.zip.ZipFile) BuildApksResult(com.android.bundle.Commands.BuildApksResult) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ZipFile(java.util.zip.ZipFile) ApkSetUtils.extractTocFromApkSetFile(com.android.tools.build.bundletool.testing.ApkSetUtils.extractTocFromApkSetFile) File(java.io.File) ApkSetUtils.extractFromApkSetFile(com.android.tools.build.bundletool.testing.ApkSetUtils.extractFromApkSetFile) Test(org.junit.Test)

Example 9 with AppBundleSerializer

use of com.android.tools.build.bundletool.io.AppBundleSerializer in project bundletool by google.

the class BuildApksPreprocessingTest method localTestingMode_disabled_doesNotAddMetadata.

@Test
public void localTestingMode_disabled_doesNotAddMetadata() throws Exception {
    AppBundle appBundle = createAppBundleWithBaseAndFeatureModules("feature");
    new AppBundleSerializer().writeToDisk(appBundle, bundlePath);
    BuildApksCommand command = BuildApksCommand.builder().setBundlePath(bundlePath).setOutputFile(outputFilePath).setLocalTestingMode(false).build();
    command.execute();
    try (ZipFile apkSet = new ZipFile(outputFilePath.toFile())) {
        BuildApksResult result = extractTocFromApkSetFile(apkSet, outputDir);
        assertThat(result.getLocalTestingInfo().getEnabled()).isFalse();
        ImmutableList<ApkDescription> apkDescriptions = apkDescriptions(result.getVariantList());
        assertThat(apkDescriptions).isNotEmpty();
        for (ApkDescription apkDescription : apkDescriptions) {
            File apk = extractFromApkSetFile(apkSet, apkDescription.getPath(), outputDir);
            assertThat(extractAndroidManifest(apk).getMetadataValue(LocalTestingPreprocessor.METADATA_NAME)).isEmpty();
        }
    }
}
Also used : AppBundle(com.android.tools.build.bundletool.model.AppBundle) ApkDescription(com.android.bundle.Commands.ApkDescription) ZipFile(java.util.zip.ZipFile) BuildApksResult(com.android.bundle.Commands.BuildApksResult) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ZipFile(java.util.zip.ZipFile) ApkSetUtils.extractTocFromApkSetFile(com.android.tools.build.bundletool.testing.ApkSetUtils.extractTocFromApkSetFile) File(java.io.File) ApkSetUtils.extractFromApkSetFile(com.android.tools.build.bundletool.testing.ApkSetUtils.extractFromApkSetFile) Test(org.junit.Test)

Example 10 with AppBundleSerializer

use of com.android.tools.build.bundletool.io.AppBundleSerializer in project bundletool by google.

the class BuildApksPreprocessingTest method renderscript32Bit_warningMessageDisplayed.

@Test
public void renderscript32Bit_warningMessageDisplayed() throws Exception {
    AppBundle appBundle = new AppBundleBuilder().addModule("base", builder -> builder.addFile("dex/classes.dex").addFile("assets/script.bc").setManifest(androidManifest("com.test.app"))).build();
    new AppBundleSerializer().writeToDisk(appBundle, bundlePath);
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    BuildApksCommand command = BuildApksCommand.builder().setBundlePath(bundlePath).setOutputFile(outputFilePath).setOutputPrintStream(new PrintStream(output)).build();
    command.execute();
    assertThat(new String(output.toByteArray(), UTF_8)).contains("WARNING: App Bundle contains 32-bit RenderScript bitcode file (.bc)");
}
Also used : TEST_LABEL_RESOURCE_ID(com.android.tools.build.bundletool.testing.ResourcesTableFactory.TEST_LABEL_RESOURCE_ID) ApkTargeting(com.android.bundle.Targeting.ApkTargeting) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) Variant(com.android.bundle.Commands.Variant) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) ManifestProtoUtils.androidManifestForAssetModule(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifestForAssetModule) TargetingUtils.abiTargeting(com.android.tools.build.bundletool.testing.TargetingUtils.abiTargeting) LocalTestingPreprocessor(com.android.tools.build.bundletool.preprocessors.LocalTestingPreprocessor) ARM64_V8A(com.android.bundle.Targeting.Abi.AbiAlias.ARM64_V8A) ResourcesTableFactory.resourceTableWithTestLabel(com.android.tools.build.bundletool.testing.ResourcesTableFactory.resourceTableWithTestLabel) ZipFile(java.util.zip.ZipFile) Path(java.nio.file.Path) ManifestProtoUtils.withTitle(com.android.tools.build.bundletool.testing.ManifestProtoUtils.withTitle) ImmutableSet(com.google.common.collect.ImmutableSet) TargetingUtils.nativeDirectoryTargeting(com.android.tools.build.bundletool.testing.TargetingUtils.nativeDirectoryTargeting) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) ARMEABI_V7A(com.android.bundle.Targeting.Abi.AbiAlias.ARMEABI_V7A) ManifestProtoUtils.withMinSdkVersion(com.android.tools.build.bundletool.testing.ManifestProtoUtils.withMinSdkVersion) UncheckedIOException(java.io.UncheckedIOException) ApkSet(com.android.bundle.Commands.ApkSet) List(java.util.List) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ManifestProtoUtils.withInstallTimeDelivery(com.android.tools.build.bundletool.testing.ManifestProtoUtils.withInstallTimeDelivery) ManifestProtoUtils.androidManifestForFeature(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifestForFeature) ManifestProtoUtils.withMaxSdkVersion(com.android.tools.build.bundletool.testing.ManifestProtoUtils.withMaxSdkVersion) TruthZip.assertThat(com.android.tools.build.bundletool.testing.truth.zip.TruthZip.assertThat) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) AbiTargeting(com.android.bundle.Targeting.AbiTargeting) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ResultUtils.standaloneApkVariants(com.android.tools.build.bundletool.model.utils.ResultUtils.standaloneApkVariants) BundleConfigBuilder(com.android.tools.build.bundletool.testing.BundleConfigBuilder) RunWith(org.junit.runner.RunWith) BuildApksResult(com.android.bundle.Commands.BuildApksResult) ApkSetUtils.extractTocFromApkSetFile(com.android.tools.build.bundletool.testing.ApkSetUtils.extractTocFromApkSetFile) ProtoTruth.assertThat(com.google.common.truth.extensions.proto.ProtoTruth.assertThat) ImmutableList(com.google.common.collect.ImmutableList) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ImmutableSet.toImmutableSet(com.google.common.collect.ImmutableSet.toImmutableSet) ApkDescription(com.android.bundle.Commands.ApkDescription) ResultUtils.splitApkVariants(com.android.tools.build.bundletool.model.utils.ResultUtils.splitApkVariants) Truth8.assertThat(com.google.common.truth.Truth8.assertThat) Before(org.junit.Before) PrintStream(java.io.PrintStream) Files(java.nio.file.Files) UTF_8(java.nio.charset.StandardCharsets.UTF_8) InvalidBundleException(com.android.tools.build.bundletool.model.exceptions.InvalidBundleException) ManifestProtoUtils.withFusingAttribute(com.android.tools.build.bundletool.testing.ManifestProtoUtils.withFusingAttribute) TargetingUtils.targetedNativeDirectory(com.android.tools.build.bundletool.testing.TargetingUtils.targetedNativeDirectory) AssetSliceSet(com.android.bundle.Commands.AssetSliceSet) IOException(java.io.IOException) Test(org.junit.Test) JUnit4(org.junit.runners.JUnit4) Truth.assertThat(com.google.common.truth.Truth.assertThat) File(java.io.File) Aapt2Helper(com.android.tools.build.bundletool.testing.Aapt2Helper) ApkSetUtils.extractFromApkSetFile(com.android.tools.build.bundletool.testing.ApkSetUtils.extractFromApkSetFile) TargetingUtils.nativeLibraries(com.android.tools.build.bundletool.testing.TargetingUtils.nativeLibraries) Rule(org.junit.Rule) XmlNode(com.android.aapt.Resources.XmlNode) ExtensionRegistry(com.google.protobuf.ExtensionRegistry) AppBundle(com.android.tools.build.bundletool.model.AppBundle) TemporaryFolder(org.junit.rules.TemporaryFolder) PrintStream(java.io.PrintStream) AppBundle(com.android.tools.build.bundletool.model.AppBundle) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Test(org.junit.Test)

Aggregations

AppBundleSerializer (com.android.tools.build.bundletool.io.AppBundleSerializer)32 AppBundleBuilder (com.android.tools.build.bundletool.testing.AppBundleBuilder)27 Test (org.junit.Test)27 AppBundle (com.android.tools.build.bundletool.model.AppBundle)25 Path (java.nio.file.Path)25 ManifestProtoUtils.androidManifest (com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest)24 Truth.assertThat (com.google.common.truth.Truth.assertThat)24 Before (org.junit.Before)24 Rule (org.junit.Rule)24 Assertions.assertThrows (org.junit.jupiter.api.Assertions.assertThrows)24 TemporaryFolder (org.junit.rules.TemporaryFolder)24 RunWith (org.junit.runner.RunWith)24 JUnit4 (org.junit.runners.JUnit4)23 IOException (java.io.IOException)18 ByteArrayOutputStream (java.io.ByteArrayOutputStream)17 PrintStream (java.io.PrintStream)17 UTF_8 (java.nio.charset.StandardCharsets.UTF_8)17 ImmutableList (com.google.common.collect.ImmutableList)15 XmlNode (com.android.aapt.Resources.XmlNode)7 CodeRelatedFile (com.android.bundle.CodeTransparencyOuterClass.CodeRelatedFile)7