Search in sources :

Example 46 with AppBundle

use of com.android.tools.build.bundletool.model.AppBundle in project bundletool by google.

the class BuildApksDeviceSpecTest method deviceSpec_universalApk_throws.

@Test
public void deviceSpec_universalApk_throws() throws Exception {
    DeviceSpec deviceSpec = deviceWithSdk(21);
    AppBundle appBundle = new AppBundleBuilder().addModule("base", module -> module.setManifest(androidManifest("com.app"))).build();
    bundleSerializer.writeToDisk(appBundle, bundlePath);
    BuildApksCommand.Builder command = BuildApksCommand.builder().setBundlePath(bundlePath).setOutputFile(outputFilePath).setDeviceSpec(deviceSpec).setApkBuildMode(UNIVERSAL);
    Throwable exception = assertThrows(InvalidCommandException.class, command::build);
    assertThat(exception).hasMessageThat().contains("Optimizing for device spec is not possible when running with 'universal' mode flag.");
}
Also used : DeviceSpec(com.android.bundle.Devices.DeviceSpec) AppBundleFactory.createLdpiHdpiAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createLdpiHdpiAppBundle) SYSTEM(com.android.tools.build.bundletool.commands.BuildApksCommand.ApkBuildMode.SYSTEM) UNIVERSAL(com.android.tools.build.bundletool.commands.BuildApksCommand.ApkBuildMode.UNIVERSAL) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) Variant(com.android.bundle.Commands.Variant) DeviceFactory.createDeviceSpecFile(com.android.tools.build.bundletool.testing.DeviceFactory.createDeviceSpecFile) DeviceSpec(com.android.bundle.Devices.DeviceSpec) DeviceFactory.abis(com.android.tools.build.bundletool.testing.DeviceFactory.abis) DensityAlias(com.android.bundle.Targeting.ScreenDensity.DensityAlias) ZipFile(java.util.zip.ZipFile) Path(java.nio.file.Path) FakeSystemEnvironmentProvider(com.android.tools.build.bundletool.testing.FakeSystemEnvironmentProvider) Theory(org.junit.experimental.theories.Theory) ImmutableMap(com.google.common.collect.ImmutableMap) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) AppBundleFactory.createInstantBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createInstantBundle) FlagParser(com.android.tools.build.bundletool.flags.FlagParser) DeviceFactory.sdkVersion(com.android.tools.build.bundletool.testing.DeviceFactory.sdkVersion) ApkSet(com.android.bundle.Commands.ApkSet) SystemEnvironmentProvider(com.android.tools.build.bundletool.model.utils.SystemEnvironmentProvider) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) DeviceFactory.density(com.android.tools.build.bundletool.testing.DeviceFactory.density) TruthZip.assertThat(com.android.tools.build.bundletool.testing.truth.zip.TruthZip.assertThat) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) DeviceFactory.locales(com.android.tools.build.bundletool.testing.DeviceFactory.locales) DeviceFactory.deviceWithSdk(com.android.tools.build.bundletool.testing.DeviceFactory.deviceWithSdk) ByteArrayOutputStream(java.io.ByteArrayOutputStream) RunWith(org.junit.runner.RunWith) BuildApksResult(com.android.bundle.Commands.BuildApksResult) DeviceFactory.mergeSpecs(com.android.tools.build.bundletool.testing.DeviceFactory.mergeSpecs) HDPI(com.android.bundle.Targeting.ScreenDensity.DensityAlias.HDPI) ApkSetUtils.extractTocFromApkSetFile(com.android.tools.build.bundletool.testing.ApkSetUtils.extractTocFromApkSetFile) ImmutableList(com.google.common.collect.ImmutableList) Theories(org.junit.experimental.theories.Theories) ResultUtils.instantApkVariants(com.android.tools.build.bundletool.model.utils.ResultUtils.instantApkVariants) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ApkDescription(com.android.bundle.Commands.ApkDescription) ResultUtils.splitApkVariants(com.android.tools.build.bundletool.model.utils.ResultUtils.splitApkVariants) DeviceFactory.lDeviceWithDensity(com.android.tools.build.bundletool.testing.DeviceFactory.lDeviceWithDensity) AdbServer(com.android.tools.build.bundletool.device.AdbServer) Before(org.junit.Before) AppBundleFactory.createMinMaxSdkAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinMaxSdkAppBundle) PrintStream(java.io.PrintStream) AppBundleFactory.createX86AppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createX86AppBundle) Test(org.junit.Test) Truth.assertThat(com.google.common.truth.Truth.assertThat) AppBundleFactory.createMinSdkBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinSdkBundle) XHDPI(com.android.bundle.Targeting.ScreenDensity.DensityAlias.XHDPI) Rule(org.junit.Rule) FakeAdbServer(com.android.tools.build.bundletool.testing.FakeAdbServer) AppBundleFactory.createMaxSdkBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMaxSdkBundle) IncompatibleDeviceException(com.android.tools.build.bundletool.model.exceptions.IncompatibleDeviceException) InvalidCommandException(com.android.tools.build.bundletool.model.exceptions.InvalidCommandException) AppBundle(com.android.tools.build.bundletool.model.AppBundle) TemporaryFolder(org.junit.rules.TemporaryFolder) AppBundleFactory.createLdpiHdpiAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createLdpiHdpiAppBundle) AppBundleFactory.createMinMaxSdkAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinMaxSdkAppBundle) AppBundleFactory.createX86AppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createX86AppBundle) AppBundle(com.android.tools.build.bundletool.model.AppBundle) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) Test(org.junit.Test)

Example 47 with AppBundle

use of com.android.tools.build.bundletool.model.AppBundle in project bundletool by google.

the class BuildApksDeviceSpecTest method deviceSpec_systemApkMode_partialDeviceSpecMissingDensity_throws.

@Test
@Theory
public void deviceSpec_systemApkMode_partialDeviceSpecMissingDensity_throws() throws Exception {
    DeviceSpec deviceSpec = mergeSpecs(abis("arm64-v8a"));
    AppBundle appBundle = new AppBundleBuilder().addModule("base", module -> module.setManifest(androidManifest("com.app"))).build();
    bundleSerializer.writeToDisk(appBundle, bundlePath);
    BuildApksCommand.Builder command = BuildApksCommand.builder().setBundlePath(bundlePath).setOutputFile(outputFilePath).setDeviceSpec(deviceSpec).setApkBuildMode(SYSTEM);
    Throwable exception = assertThrows(InvalidCommandException.class, command::build);
    assertThat(exception).hasMessageThat().contains("Device spec must have screen density and ABIs set when running with 'system' mode" + " flag.");
}
Also used : DeviceSpec(com.android.bundle.Devices.DeviceSpec) AppBundleFactory.createLdpiHdpiAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createLdpiHdpiAppBundle) SYSTEM(com.android.tools.build.bundletool.commands.BuildApksCommand.ApkBuildMode.SYSTEM) UNIVERSAL(com.android.tools.build.bundletool.commands.BuildApksCommand.ApkBuildMode.UNIVERSAL) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) Variant(com.android.bundle.Commands.Variant) DeviceFactory.createDeviceSpecFile(com.android.tools.build.bundletool.testing.DeviceFactory.createDeviceSpecFile) DeviceSpec(com.android.bundle.Devices.DeviceSpec) DeviceFactory.abis(com.android.tools.build.bundletool.testing.DeviceFactory.abis) DensityAlias(com.android.bundle.Targeting.ScreenDensity.DensityAlias) ZipFile(java.util.zip.ZipFile) Path(java.nio.file.Path) FakeSystemEnvironmentProvider(com.android.tools.build.bundletool.testing.FakeSystemEnvironmentProvider) Theory(org.junit.experimental.theories.Theory) ImmutableMap(com.google.common.collect.ImmutableMap) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) AppBundleFactory.createInstantBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createInstantBundle) FlagParser(com.android.tools.build.bundletool.flags.FlagParser) DeviceFactory.sdkVersion(com.android.tools.build.bundletool.testing.DeviceFactory.sdkVersion) ApkSet(com.android.bundle.Commands.ApkSet) SystemEnvironmentProvider(com.android.tools.build.bundletool.model.utils.SystemEnvironmentProvider) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) DeviceFactory.density(com.android.tools.build.bundletool.testing.DeviceFactory.density) TruthZip.assertThat(com.android.tools.build.bundletool.testing.truth.zip.TruthZip.assertThat) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) DeviceFactory.locales(com.android.tools.build.bundletool.testing.DeviceFactory.locales) DeviceFactory.deviceWithSdk(com.android.tools.build.bundletool.testing.DeviceFactory.deviceWithSdk) ByteArrayOutputStream(java.io.ByteArrayOutputStream) RunWith(org.junit.runner.RunWith) BuildApksResult(com.android.bundle.Commands.BuildApksResult) DeviceFactory.mergeSpecs(com.android.tools.build.bundletool.testing.DeviceFactory.mergeSpecs) HDPI(com.android.bundle.Targeting.ScreenDensity.DensityAlias.HDPI) ApkSetUtils.extractTocFromApkSetFile(com.android.tools.build.bundletool.testing.ApkSetUtils.extractTocFromApkSetFile) ImmutableList(com.google.common.collect.ImmutableList) Theories(org.junit.experimental.theories.Theories) ResultUtils.instantApkVariants(com.android.tools.build.bundletool.model.utils.ResultUtils.instantApkVariants) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ApkDescription(com.android.bundle.Commands.ApkDescription) ResultUtils.splitApkVariants(com.android.tools.build.bundletool.model.utils.ResultUtils.splitApkVariants) DeviceFactory.lDeviceWithDensity(com.android.tools.build.bundletool.testing.DeviceFactory.lDeviceWithDensity) AdbServer(com.android.tools.build.bundletool.device.AdbServer) Before(org.junit.Before) AppBundleFactory.createMinMaxSdkAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinMaxSdkAppBundle) PrintStream(java.io.PrintStream) AppBundleFactory.createX86AppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createX86AppBundle) Test(org.junit.Test) Truth.assertThat(com.google.common.truth.Truth.assertThat) AppBundleFactory.createMinSdkBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinSdkBundle) XHDPI(com.android.bundle.Targeting.ScreenDensity.DensityAlias.XHDPI) Rule(org.junit.Rule) FakeAdbServer(com.android.tools.build.bundletool.testing.FakeAdbServer) AppBundleFactory.createMaxSdkBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMaxSdkBundle) IncompatibleDeviceException(com.android.tools.build.bundletool.model.exceptions.IncompatibleDeviceException) InvalidCommandException(com.android.tools.build.bundletool.model.exceptions.InvalidCommandException) AppBundle(com.android.tools.build.bundletool.model.AppBundle) TemporaryFolder(org.junit.rules.TemporaryFolder) AppBundleFactory.createLdpiHdpiAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createLdpiHdpiAppBundle) AppBundleFactory.createMinMaxSdkAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinMaxSdkAppBundle) AppBundleFactory.createX86AppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createX86AppBundle) AppBundle(com.android.tools.build.bundletool.model.AppBundle) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) Test(org.junit.Test) Theory(org.junit.experimental.theories.Theory)

Example 48 with AppBundle

use of com.android.tools.build.bundletool.model.AppBundle in project bundletool by google.

the class BuildApksDeviceSpecTest method deviceSpec_systemApkMode_partialDeviceSpecMissingAbi_throws.

@Test
@Theory
public void deviceSpec_systemApkMode_partialDeviceSpecMissingAbi_throws() throws Exception {
    DeviceSpec deviceSpec = mergeSpecs(density(DensityAlias.MDPI));
    AppBundle appBundle = new AppBundleBuilder().addModule("base", module -> module.setManifest(androidManifest("com.app"))).build();
    bundleSerializer.writeToDisk(appBundle, bundlePath);
    BuildApksCommand.Builder command = BuildApksCommand.builder().setBundlePath(bundlePath).setOutputFile(outputFilePath).setDeviceSpec(deviceSpec).setApkBuildMode(SYSTEM);
    Throwable exception = assertThrows(InvalidCommandException.class, command::build);
    assertThat(exception).hasMessageThat().contains("Device spec must have screen density and ABIs set when running with 'system' mode" + " flag.");
}
Also used : DeviceSpec(com.android.bundle.Devices.DeviceSpec) AppBundleFactory.createLdpiHdpiAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createLdpiHdpiAppBundle) SYSTEM(com.android.tools.build.bundletool.commands.BuildApksCommand.ApkBuildMode.SYSTEM) UNIVERSAL(com.android.tools.build.bundletool.commands.BuildApksCommand.ApkBuildMode.UNIVERSAL) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) Variant(com.android.bundle.Commands.Variant) DeviceFactory.createDeviceSpecFile(com.android.tools.build.bundletool.testing.DeviceFactory.createDeviceSpecFile) DeviceSpec(com.android.bundle.Devices.DeviceSpec) DeviceFactory.abis(com.android.tools.build.bundletool.testing.DeviceFactory.abis) DensityAlias(com.android.bundle.Targeting.ScreenDensity.DensityAlias) ZipFile(java.util.zip.ZipFile) Path(java.nio.file.Path) FakeSystemEnvironmentProvider(com.android.tools.build.bundletool.testing.FakeSystemEnvironmentProvider) Theory(org.junit.experimental.theories.Theory) ImmutableMap(com.google.common.collect.ImmutableMap) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) AppBundleFactory.createInstantBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createInstantBundle) FlagParser(com.android.tools.build.bundletool.flags.FlagParser) DeviceFactory.sdkVersion(com.android.tools.build.bundletool.testing.DeviceFactory.sdkVersion) ApkSet(com.android.bundle.Commands.ApkSet) SystemEnvironmentProvider(com.android.tools.build.bundletool.model.utils.SystemEnvironmentProvider) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) DeviceFactory.density(com.android.tools.build.bundletool.testing.DeviceFactory.density) TruthZip.assertThat(com.android.tools.build.bundletool.testing.truth.zip.TruthZip.assertThat) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) DeviceFactory.locales(com.android.tools.build.bundletool.testing.DeviceFactory.locales) DeviceFactory.deviceWithSdk(com.android.tools.build.bundletool.testing.DeviceFactory.deviceWithSdk) ByteArrayOutputStream(java.io.ByteArrayOutputStream) RunWith(org.junit.runner.RunWith) BuildApksResult(com.android.bundle.Commands.BuildApksResult) DeviceFactory.mergeSpecs(com.android.tools.build.bundletool.testing.DeviceFactory.mergeSpecs) HDPI(com.android.bundle.Targeting.ScreenDensity.DensityAlias.HDPI) ApkSetUtils.extractTocFromApkSetFile(com.android.tools.build.bundletool.testing.ApkSetUtils.extractTocFromApkSetFile) ImmutableList(com.google.common.collect.ImmutableList) Theories(org.junit.experimental.theories.Theories) ResultUtils.instantApkVariants(com.android.tools.build.bundletool.model.utils.ResultUtils.instantApkVariants) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ApkDescription(com.android.bundle.Commands.ApkDescription) ResultUtils.splitApkVariants(com.android.tools.build.bundletool.model.utils.ResultUtils.splitApkVariants) DeviceFactory.lDeviceWithDensity(com.android.tools.build.bundletool.testing.DeviceFactory.lDeviceWithDensity) AdbServer(com.android.tools.build.bundletool.device.AdbServer) Before(org.junit.Before) AppBundleFactory.createMinMaxSdkAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinMaxSdkAppBundle) PrintStream(java.io.PrintStream) AppBundleFactory.createX86AppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createX86AppBundle) Test(org.junit.Test) Truth.assertThat(com.google.common.truth.Truth.assertThat) AppBundleFactory.createMinSdkBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinSdkBundle) XHDPI(com.android.bundle.Targeting.ScreenDensity.DensityAlias.XHDPI) Rule(org.junit.Rule) FakeAdbServer(com.android.tools.build.bundletool.testing.FakeAdbServer) AppBundleFactory.createMaxSdkBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMaxSdkBundle) IncompatibleDeviceException(com.android.tools.build.bundletool.model.exceptions.IncompatibleDeviceException) InvalidCommandException(com.android.tools.build.bundletool.model.exceptions.InvalidCommandException) AppBundle(com.android.tools.build.bundletool.model.AppBundle) TemporaryFolder(org.junit.rules.TemporaryFolder) AppBundleFactory.createLdpiHdpiAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createLdpiHdpiAppBundle) AppBundleFactory.createMinMaxSdkAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinMaxSdkAppBundle) AppBundleFactory.createX86AppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createX86AppBundle) AppBundle(com.android.tools.build.bundletool.model.AppBundle) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) Test(org.junit.Test) Theory(org.junit.experimental.theories.Theory)

Example 49 with AppBundle

use of com.android.tools.build.bundletool.model.AppBundle in project bundletool by google.

the class AddTransparencyCommandTest method execute_defaultMode_success.

@Test
public void execute_defaultMode_success() throws Exception {
    createBundle(bundlePath);
    AddTransparencyCommand addTransparencyCommand = AddTransparencyCommand.builder().setMode(Mode.DEFAULT).setBundlePath(bundlePath).setOutputPath(outputBundlePath).setSignerConfig(signerConfig).build();
    addTransparencyCommand.execute();
    AppBundle outputBundle = AppBundle.buildFromZip(new ZipFile(outputBundlePath.toFile()));
    Optional<ByteSource> signedTransparencyFile = outputBundle.getBundleMetadata().getFileAsByteSource(BUNDLETOOL_NAMESPACE, BundleMetadata.TRANSPARENCY_SIGNED_FILE_NAME);
    assertThat(signedTransparencyFile).isPresent();
    JsonWebSignature jws = (JsonWebSignature) JsonWebSignature.fromCompactSerialization(signedTransparencyFile.get().asCharSource(Charset.defaultCharset()).read());
    assertThat(jws.getAlgorithmHeaderValue()).isEqualTo(RSA_USING_SHA256);
    assertThat(jws.getCertificateChainHeaderValue()).isEqualTo(signerConfig.getCertificates());
    // jws.getPayload method will do signature verification using the public key set below.
    jws.setKey(signerConfig.getCertificates().get(0).getPublicKey());
    CodeTransparency transparencyProto = getTransparencyProto(jws.getPayload());
    assertThat(transparencyProto).isEqualTo(expectedTransparencyProto());
}
Also used : AppBundle(com.android.tools.build.bundletool.model.AppBundle) ZipFile(java.util.zip.ZipFile) JsonWebSignature(org.jose4j.jws.JsonWebSignature) ByteSource(com.google.common.io.ByteSource) CodeTransparency(com.android.bundle.CodeTransparencyOuterClass.CodeTransparency) Test(org.junit.Test)

Example 50 with AppBundle

use of com.android.tools.build.bundletool.model.AppBundle in project bundletool by google.

the class AddTransparencyCommandTest method execute_injectSignature.

@Test
public void execute_injectSignature() throws Exception {
    // create bundle.
    createBundle(bundlePath);
    // add transparency file in default mode.
    Path tmpOutputBundlePath = tmpDir.resolve("tmp_output_bundle.aab");
    AddTransparencyCommand.builder().setMode(Mode.DEFAULT).setBundlePath(bundlePath).setOutputPath(tmpOutputBundlePath).setSignerConfig(signerConfig).build().execute();
    // get the correct transparency signature bytes.
    AppBundle tmpOutputBundle = AppBundle.buildFromZip(new ZipFile(tmpOutputBundlePath.toFile()));
    ByteSource signedTransparencyFile = tmpOutputBundle.getBundleMetadata().getFileAsByteSource(BUNDLETOOL_NAMESPACE, BundleMetadata.TRANSPARENCY_SIGNED_FILE_NAME).get();
    String jws = signedTransparencyFile.asCharSource(Charset.defaultCharset()).read();
    String signature = ImmutableList.copyOf(Splitter.on(".").split(jws)).get(2);
    byte[] signatureBytes = BaseEncoding.base64Url().decode(signature);
    Files.write(transparencySignatureFilePath, signatureBytes);
    // inject signature into the original bundle
    AddTransparencyCommand.builder().setMode(Mode.INJECT_SIGNATURE).setBundlePath(bundlePath).setOutputPath(outputBundlePath).setTransparencyKeyCertificate(signerConfig.getCertificates().get(0)).setTransparencySignaturePath(transparencySignatureFilePath).build().execute();
    // verify that the output bundle contains signed code transparency metadata.
    AppBundle outputBundle = AppBundle.buildFromZip(new ZipFile(outputBundlePath.toFile()));
    Optional<ByteSource> finalSignedTransparencyFile = outputBundle.getBundleMetadata().getFileAsByteSource(BUNDLETOOL_NAMESPACE, BundleMetadata.TRANSPARENCY_SIGNED_FILE_NAME);
    assertThat(finalSignedTransparencyFile).isPresent();
    JsonWebSignature finalJws = (JsonWebSignature) JsonWebSignature.fromCompactSerialization(finalSignedTransparencyFile.get().asCharSource(Charset.defaultCharset()).read());
    assertThat(finalJws.getAlgorithmHeaderValue()).isEqualTo(RSA_USING_SHA256);
    assertThat(finalJws.getCertificateChainHeaderValue()).isEqualTo(signerConfig.getCertificates());
    // jws.getPayload method will do signature verification using the public key set below.
    finalJws.setKey(signerConfig.getCertificates().get(0).getPublicKey());
    CodeTransparency transparencyProto = getTransparencyProto(finalJws.getPayload());
    assertThat(transparencyProto).isEqualTo(expectedTransparencyProto());
}
Also used : Path(java.nio.file.Path) AppBundle(com.android.tools.build.bundletool.model.AppBundle) ZipFile(java.util.zip.ZipFile) JsonWebSignature(org.jose4j.jws.JsonWebSignature) ByteSource(com.google.common.io.ByteSource) CodeTransparency(com.android.bundle.CodeTransparencyOuterClass.CodeTransparency) Test(org.junit.Test)

Aggregations

AppBundle (com.android.tools.build.bundletool.model.AppBundle)205 Test (org.junit.Test)193 AppBundleBuilder (com.android.tools.build.bundletool.testing.AppBundleBuilder)137 ZipFile (java.util.zip.ZipFile)136 ManifestProtoUtils.androidManifest (com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest)112 Truth.assertThat (com.google.common.truth.Truth.assertThat)112 Path (java.nio.file.Path)112 RunWith (org.junit.runner.RunWith)112 BuildApksResult (com.android.bundle.Commands.BuildApksResult)106 AppBundleSerializer (com.android.tools.build.bundletool.io.AppBundleSerializer)104 ImmutableList (com.google.common.collect.ImmutableList)102 Assertions.assertThrows (org.junit.jupiter.api.Assertions.assertThrows)101 InvalidBundleException (com.android.tools.build.bundletool.model.exceptions.InvalidBundleException)100 Before (org.junit.Before)100 Rule (org.junit.Rule)100 TemporaryFolder (org.junit.rules.TemporaryFolder)100 Variant (com.android.bundle.Commands.Variant)98 IOException (java.io.IOException)94 ApkDescription (com.android.bundle.Commands.ApkDescription)90 ApkSetUtils.extractTocFromApkSetFile (com.android.tools.build.bundletool.testing.ApkSetUtils.extractTocFromApkSetFile)87