diff options
Diffstat (limited to 'apexd/apexd_testdata/Android.bp')
-rw-r--r-- | apexd/apexd_testdata/Android.bp | 213 |
1 files changed, 116 insertions, 97 deletions
diff --git a/apexd/apexd_testdata/Android.bp b/apexd/apexd_testdata/Android.bp index e28c567d..4fec5896 100644 --- a/apexd/apexd_testdata/Android.bp +++ b/apexd/apexd_testdata/Android.bp @@ -40,7 +40,7 @@ apex { prebuilts: ["sample_prebuilt_file"], key: "com.android.apex.test_package.key", installable: false, - min_sdk_version: "29", // test requires hashtree to be present. + min_sdk_version: "29", // test requires hashtree to be present. } apex { @@ -66,101 +66,120 @@ apex { } genrule { - // Generates an apex which has a different public key outside the filesystem image - name: "gen_key_mismatch_with_image_apex", - out: ["apex.apexd_test_wrong_public_key.apex"], - srcs: [":apex.apexd_test"], - tools: ["soong_zip", "zipalign"], - cmd: "unzip -q $(in) -d $(genDir) && " + // unzip input - "echo 'different-key' >> $(genDir)/apex_pubkey && " + // modify the public key - "$(location soong_zip) -d -C $(genDir) -D $(genDir) " + - "-s apex_manifest.pb -s apex_payload.img -s apex_pubkey " + - "-o $(genDir)/unaligned.apex && " + - "$(location zipalign) -f 4096 $(genDir)/unaligned.apex " + - "$(genDir)/apex.apexd_test_wrong_public_key.apex", + // Generates an apex which has a different public key outside the filesystem image + name: "gen_key_mismatch_with_image_apex", + out: ["apex.apexd_test_wrong_public_key.apex"], + srcs: [":apex.apexd_test"], + tools: [ + "soong_zip", + "zipalign", + ], + cmd: "unzip -q $(in) -d $(genDir) && " + // unzip input + "echo 'different-key' >> $(genDir)/apex_pubkey && " + // modify the public key + "$(location soong_zip) -d -C $(genDir) -D $(genDir) " + + "-s apex_manifest.pb -s apex_payload.img -s apex_pubkey " + + "-o $(genDir)/unaligned.apex && " + + "$(location zipalign) -f 4096 $(genDir)/unaligned.apex " + + "$(genDir)/apex.apexd_test_wrong_public_key.apex", } genrule { - // Generates a compressed apex which doesn't have an original_apex file in it - name: "gen_capex_without_apex", - out: ["com.android.apex.compressed.v1_without_apex.capex"], - srcs: [":com.android.apex.compressed.v1"], - tools: ["soong_zip"], - cmd: "unzip -q $(in) -d $(genDir) && rm $(genDir)/original_apex && " + - "$(location soong_zip) -d -C $(genDir) -D $(genDir) -L 9 " + - "-o $(genDir)/com.android.apex.compressed.v1_without_apex.capex" + // Generates a compressed apex which doesn't have an original_apex file in it + name: "gen_capex_without_apex", + out: ["com.android.apex.compressed.v1_without_apex.capex"], + srcs: [":com.android.apex.compressed.v1"], + tools: ["soong_zip"], + cmd: "unzip -q $(in) -d $(genDir) && rm $(genDir)/original_apex && " + + "$(location soong_zip) -d -C $(genDir) -D $(genDir) -L 9 " + + "-o $(genDir)/com.android.apex.compressed.v1_without_apex.capex", } genrule { - // Generates a compressed apex which has different version of original_apex in it - name: "gen_capex_with_v2_apex", - out: ["com.android.apex.compressed.v1_with_v2_apex.capex"], - srcs: [":com.android.apex.compressed.v2"], - tools: ["soong_zip", "conv_apex_manifest"], - cmd: "unzip -q $(in) -d $(genDir) && " + - "$(location conv_apex_manifest) setprop version 1 $(genDir)/apex_manifest.pb && " + - "$(location soong_zip) -d -C $(genDir) -D $(genDir) -L 9 " + - "-o $(genDir)/com.android.apex.compressed.v1_with_v2_apex.capex" + // Generates a compressed apex which has different version of original_apex in it + name: "gen_capex_with_v2_apex", + out: ["com.android.apex.compressed.v1_with_v2_apex.capex"], + srcs: [":com.android.apex.compressed.v2"], + tools: [ + "soong_zip", + "conv_apex_manifest", + ], + cmd: "unzip -q $(in) -d $(genDir) && " + + "$(location conv_apex_manifest) setprop version 1 $(genDir)/apex_manifest.pb && " + + "$(location soong_zip) -d -C $(genDir) -D $(genDir) -L 9 " + + "-o $(genDir)/com.android.apex.compressed.v1_with_v2_apex.capex", } genrule { - // Generates a compressed apex which can be opened but not decompressed - name: "gen_capex_not_decompressible", - out: ["com.android.apex.compressed.v1_not_decompressible.capex"], - srcs: [":com.android.apex.compressed.v1"], - tools: ["soong_zip", "conv_apex_manifest"], - cmd: "unzip -q $(in) -d $(genDir) && echo '' > $(genDir)/original_apex && " + - "$(location soong_zip) -d -C $(genDir) -D $(genDir) -L 9 " + - "-o $(genDir)/com.android.apex.compressed.v1_not_decompressible.capex" + // Generates a compressed apex which can be opened but not decompressed + name: "gen_capex_not_decompressible", + out: ["com.android.apex.compressed.v1_not_decompressible.capex"], + srcs: [":com.android.apex.compressed.v1"], + tools: [ + "soong_zip", + "conv_apex_manifest", + ], + cmd: "unzip -q $(in) -d $(genDir) && echo '' > $(genDir)/original_apex && " + + "$(location soong_zip) -d -C $(genDir) -D $(genDir) -L 9 " + + "-o $(genDir)/com.android.apex.compressed.v1_not_decompressible.capex", } genrule { - // Generates a capex which has same module name as com.android.apex.compressed, but - // is contains a different public key. - name: "gen_key_mismatch_capex", - out: ["com.android.apex.compressed_different_key.capex"], - srcs: [":apex.apexd_test_no_inst_key"], - tools: ["soong_zip", "zipalign", "conv_apex_manifest", "apex_compression_tool", "avbtool"], - cmd: "mkdir $(genDir)/tempdir && unzip -q $(in) -d $(genDir)/tempdir && " + - "$(location conv_apex_manifest) setprop name com.android.apex.compressed $(genDir)/tempdir/apex_manifest.pb && " + - "$(location soong_zip) -d -C $(genDir)/tempdir -D $(genDir)/tempdir " + - "-s apex_manifest.pb -s apex_payload.img -s apex_pubkey " + - "-o $(genDir)/unaligned.apex && " + - "$(location zipalign) -f 4096 $(genDir)/unaligned.apex " + - "$(genDir)/com.android.apex.compressed_different_key.apex && " + - "HOST_OUT_BIN=$$(dirname $(location apex_compression_tool)) && " + - "$(location apex_compression_tool) compress " + - "--apex_compression_tool_path=\"$$HOST_OUT_BIN\" " + - "--input=$(genDir)/com.android.apex.compressed_different_key.apex " + - "--output=$(genDir)/com.android.apex.compressed_different_key.capex" + // Generates a capex which has same module name as com.android.apex.compressed, but + // is contains a different public key. + name: "gen_key_mismatch_capex", + out: ["com.android.apex.compressed_different_key.capex"], + srcs: [":apex.apexd_test_no_inst_key"], + tools: [ + "soong_zip", + "zipalign", + "conv_apex_manifest", + "apex_compression_tool", + "avbtool", + ], + cmd: "mkdir $(genDir)/tempdir && unzip -q $(in) -d $(genDir)/tempdir && " + + "$(location conv_apex_manifest) setprop name com.android.apex.compressed $(genDir)/tempdir/apex_manifest.pb && " + + "$(location soong_zip) -d -C $(genDir)/tempdir -D $(genDir)/tempdir " + + "-s apex_manifest.pb -s apex_payload.img -s apex_pubkey " + + "-o $(genDir)/unaligned.apex && " + + "$(location zipalign) -f 4096 $(genDir)/unaligned.apex " + + "$(genDir)/com.android.apex.compressed_different_key.apex && " + + "HOST_OUT_BIN=$$(dirname $(location apex_compression_tool)) && " + + "$(location apex_compression_tool) compress " + + "--apex_compression_tool_path=\"$$HOST_OUT_BIN\" " + + "--input=$(genDir)/com.android.apex.compressed_different_key.apex " + + "--output=$(genDir)/com.android.apex.compressed_different_key.capex", } genrule { - // Generates a capex which has a different public key than original_apex - name: "gen_key_mismatch_with_original_capex", - out: ["com.android.apex.compressed_key_mismatch_with_original.capex"], - srcs: [":com.android.apex.compressed.v1"], - tools: ["soong_zip"], - cmd: "unzip -q $(in) -d $(genDir) && " + // unzip input - "echo 'different-key' >> $(genDir)/apex_pubkey && " + // modify the public key - "$(location soong_zip) -d -C $(genDir) -D $(genDir) -L 9 " +// repack the compressed APEX - "-o $(genDir)/com.android.apex.compressed_key_mismatch_with_original.capex", + // Generates a capex which has a different public key than original_apex + name: "gen_key_mismatch_with_original_capex", + out: ["com.android.apex.compressed_key_mismatch_with_original.capex"], + srcs: [":com.android.apex.compressed.v1"], + tools: ["soong_zip"], + cmd: "unzip -q $(in) -d $(genDir) && " + // unzip input + "echo 'different-key' >> $(genDir)/apex_pubkey && " + // modify the public key + "$(location soong_zip) -d -C $(genDir) -D $(genDir) -L 9 " + // repack the compressed APEX + "-o $(genDir)/com.android.apex.compressed_key_mismatch_with_original.capex", } genrule { - // Generates an apex which has a different manifest outside the filesystem - // image. - name: "gen_manifest_mismatch_compressed_apex_v2", - out: ["com.android.apex.compressed.v2_manifest_mismatch.apex"], - srcs: [":com.android.apex.compressed.v2_original"], - tools: ["soong_zip", "zipalign", "conv_apex_manifest"], - cmd: "unzip -q $(in) -d $(genDir) && " + - "$(location conv_apex_manifest) setprop version 137 $(genDir)/apex_manifest.pb && " + - "$(location soong_zip) -d -C $(genDir) -D $(genDir) " + - "-s apex_manifest.pb -s apex_payload.img -s apex_pubkey " + - "-o $(genDir)/unaligned.apex && " + - "$(location zipalign) -f 4096 $(genDir)/unaligned.apex " + - "$(genDir)/com.android.apex.compressed.v2_manifest_mismatch.apex" + // Generates an apex which has a different manifest outside the filesystem + // image. + name: "gen_manifest_mismatch_compressed_apex_v2", + out: ["com.android.apex.compressed.v2_manifest_mismatch.apex"], + srcs: [":com.android.apex.compressed.v2_original"], + tools: [ + "soong_zip", + "zipalign", + "conv_apex_manifest", + ], + cmd: "unzip -q $(in) -d $(genDir) && " + + "$(location conv_apex_manifest) setprop version 137 $(genDir)/apex_manifest.pb && " + + "$(location soong_zip) -d -C $(genDir) -D $(genDir) " + + "-s apex_manifest.pb -s apex_payload.img -s apex_pubkey " + + "-o $(genDir)/unaligned.apex && " + + "$(location zipalign) -f 4096 $(genDir)/unaligned.apex " + + "$(genDir)/com.android.apex.compressed.v2_manifest_mismatch.apex", } apex { @@ -250,8 +269,8 @@ apex { manifest: "manifest.json", file_contexts: ":apex.test-file_contexts", prebuilts: [ - "another_prebuilt_file", - "sample_prebuilt_file", + "another_prebuilt_file", + "sample_prebuilt_file", ], key: "com.android.apex.test_package.key", installable: false, @@ -280,11 +299,11 @@ apex { } genrule { - name: "apex.apexd_test_v2_no_pb", - srcs: [":apex.apexd_test_v2_legacy"], - out: ["apex.apexd_test_v2_no_pb.apex"], - tools: ["zip2zip"], - cmd: "$(location zip2zip) -i $(in) -x apex_manifest.pb -o $(out)", // remove apex_manifest.pb + name: "apex.apexd_test_v2_no_pb", + srcs: [":apex.apexd_test_v2_legacy"], + out: ["apex.apexd_test_v2_no_pb.apex"], + tools: ["zip2zip"], + cmd: "$(location zip2zip) -i $(in) -x apex_manifest.pb -o $(out)", // remove apex_manifest.pb } apex { @@ -364,15 +383,15 @@ apex { } prebuilt_etc { - name: "another_prebuilt_file", - src: "another_prebuilt_file", + name: "another_prebuilt_file", + src: "another_prebuilt_file", } prebuilt_apex { - name: "apex.corrupted_b146895998", - src: "corrupted_b146895998.apex", - filename: "corrupted_b146895998.apex", - installable: false, + name: "apex.corrupted_b146895998", + src: "corrupted_b146895998.apex", + filename: "corrupted_b146895998.apex", + installable: false, } // APEX for banned name test cannot be generated at build time. @@ -407,7 +426,7 @@ apex { installable: false, updatable: false, // TODO(ioffe): we should have a separate field to hashtree presence. - min_sdk_version: "29", // test requires hashtree to be present. + min_sdk_version: "29", // test requires hashtree to be present. } apex { @@ -418,7 +437,7 @@ apex { installable: false, updatable: false, // TODO(ioffe): we should have a separate field to hashtree presence. - min_sdk_version: "29", // test requires hashtree to be present. + min_sdk_version: "29", // test requires hashtree to be present. } apex { @@ -514,7 +533,7 @@ apex { updatable: false, apps: ["AppInRebootlessApex"], // TODO(ioffe): we should have a separate field to hashtree presence. - min_sdk_version: "29", // test requires hashtree to be present. + min_sdk_version: "29", // test requires hashtree to be present. } apex { @@ -526,7 +545,7 @@ apex { updatable: false, apps: ["PrivAppInRebootlessApex"], // TODO(ioffe): we should have a separate field to hashtree presence. - min_sdk_version: "29", // test requires hashtree to be present. + min_sdk_version: "29", // test requires hashtree to be present. } android_app { @@ -534,7 +553,7 @@ android_app { sdk_version: "29", manifest: "AppInRebootlessApex_AndroidManifest.xml", apex_available: [ - "test.rebootless_apex_app_in_apex", + "test.rebootless_apex_app_in_apex", ], } @@ -544,7 +563,7 @@ android_app { privileged: true, manifest: "AppInRebootlessApex_AndroidManifest.xml", apex_available: [ - "test.rebootless_apex_priv_app_in_apex", + "test.rebootless_apex_priv_app_in_apex", ], } |