• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Build rules to build shim apexes.
16
17package {
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21genrule {
22  name: "com.android.apex.cts.shim.pem",
23  out: ["com.android.apex.cts.shim.pem"],
24  cmd: "openssl genrsa -out $(out) 4096",
25}
26
27genrule {
28  name: "com.android.apex.cts.shim.pubkey",
29  srcs: [":com.android.apex.cts.shim.pem"],
30  out: ["com.android.apex.cts.shim.pubkey"],
31  tools: ["avbtool"],
32  cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)",
33}
34
35apex_key {
36  name: "com.android.apex.cts.shim.key",
37  private_key: ":com.android.apex.cts.shim.pem",
38  public_key: ":com.android.apex.cts.shim.pubkey",
39  installable: false,
40}
41
42genrule {
43  name: "com.android.apex.cts.shim.debug.pem",
44  out: ["com.android.apex.cts.shim.debug.pem"],
45  cmd: "openssl genrsa -out $(out) 4096",
46}
47
48genrule {
49  name: "com.android.apex.cts.shim.debug.pubkey",
50  srcs: [":com.android.apex.cts.shim.debug.pem"],
51  out: ["com.android.apex.cts.shim.debug.pubkey"],
52  tools: ["avbtool"],
53  cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)",
54}
55
56apex_key {
57  name: "com.android.apex.cts.shim.debug.key",
58  private_key: ":com.android.apex.cts.shim.debug.pem",
59  public_key: ":com.android.apex.cts.shim.debug.pubkey",
60  installable: false,
61}
62
63genrule {
64  name: "generate_hash_of_dev_null",
65  out: ["hash.txt"],
66  cmd: "sha512sum -b /dev/null | cut -d' ' -f1 | tee $(out)",
67}
68
69prebuilt_etc {
70  name: "hash_of_dev_null",
71  src: ":generate_hash_of_dev_null",
72  filename: "hash.txt",
73  installable: false,
74}
75
76apex {
77  name: "com.android.apex.cts.shim.v3",
78  manifest: "manifest_v3.json",
79  androidManifest: "AndroidManifest.xml",
80  file_contexts: ":apex.test-file_contexts",
81  key: "com.android.apex.cts.shim.key",
82  prebuilts: ["hash_of_dev_null"],
83  apps: ["CtsShim", "CtsShimPriv"],
84  installable: false,
85  allowed_files: "default_shim_allowed_list.txt",
86  updatable: false,
87}
88
89apex {
90  name: "com.android.apex.cts.shim.v2",
91  manifest: "manifest_v2.json",
92  androidManifest: "AndroidManifest.xml",
93  file_contexts: ":apex.test-file_contexts",
94  key: "com.android.apex.cts.shim.key",
95  prebuilts: ["hash_of_dev_null"],
96  apps: ["CtsShim", "CtsShimPriv"],
97  installable: false,
98  allowed_files: "default_shim_allowed_list.txt",
99  updatable: false,
100}
101
102apex {
103  name: "com.android.apex.cts.shim.v2_sign_payload_with_different_key",
104  // Use manifest_v2_rebootless to also re-use this APEX in the rebootless update test case.
105  manifest: "manifest_v2_rebootless.json",
106  androidManifest: "AndroidManifest.xml",
107  file_contexts: ":apex.test-file_contexts",
108  key: "com.android.apex.cts.shim.debug.key",
109  prebuilts: ["hash_of_dev_null"],
110  installable: false,
111  allowed_files: "default_shim_allowed_list.txt",
112  updatable: false,
113}
114
115apex {
116  name: "com.android.apex.cts.shim.v2_without_apk_in_apex",
117  manifest: "manifest_v2.json",
118  androidManifest: "AndroidManifest.xml",
119  file_contexts: ":apex.test-file_contexts",
120  key: "com.android.apex.cts.shim.key",
121  prebuilts: ["hash_of_dev_null"],
122  installable: false,
123  allowed_files: "default_shim_allowed_list.txt",
124  updatable: false,
125}
126
127apex {
128  name: "com.android.apex.cts.shim.v2_no_hashtree",
129  manifest: "manifest_v2.json",
130  androidManifest: "AndroidManifest.xml",
131  file_contexts: ":apex.test-file_contexts",
132  key: "com.android.apex.cts.shim.key",
133  prebuilts: ["hash_of_dev_null"],
134  apps: ["CtsShim", "CtsShimPriv"],
135  installable: false,
136  allowed_files: "default_shim_allowed_list.txt",
137  generate_hashtree: false,
138  updatable: false,
139}
140
141apex {
142  name: "com.android.apex.cts.shim.v2_unsigned_payload",
143  // Use manifest_v2_rebootless to also re-use this APEX in the rebootless update test case.
144  manifest: "manifest_v2_rebootless.json",
145  androidManifest: "AndroidManifest.xml",
146  file_contexts: ":apex.test-file_contexts",
147  key: "com.android.apex.cts.shim.key",
148  prebuilts: ["hash_of_dev_null"],
149  apps: ["CtsShim", "CtsShimPriv"],
150  installable: false,
151  allowed_files: "default_shim_allowed_list.txt",
152  test_only_unsigned_payload: true,
153  updatable: false,
154}
155
156override_apex {
157    name: "com.android.apex.cts.shim.v2_different_package_name",
158    package_name: "com.android.apex.cts.shim.different",
159    // Use rebootless APEX to re-use this APEX in the rebootless update test case.
160    base: "com.android.apex.cts.shim.v2_rebootless",
161}
162
163genrule {
164  name: "generate_empty_hash",
165  out: ["hash.txt"],
166  cmd: "touch $(out)",
167}
168
169prebuilt_etc {
170  name: "empty_hash",
171  src: ":generate_empty_hash",
172  filename: "hash.txt",
173  installable: false,
174}
175
176// Use empty hash.txt to make sure that this apex has wrong SHA512, hence trying
177// to stage it should fail.
178apex {
179  name: "com.android.apex.cts.shim.v2_wrong_sha",
180  // Use manifest_v2_rebootless to also re-use this APEX in the rebootless update test case.
181  manifest: "manifest_v2_rebootless.json",
182  androidManifest: "AndroidManifest.xml",
183  file_contexts: ":apex.test-file_contexts",
184  key: "com.android.apex.cts.shim.key",
185  prebuilts: ["empty_hash"],
186  installable: false,
187  updatable: false,
188}
189
190prebuilt_etc {
191  name: "apex_shim_additional_file",
192  src: "additional_file",
193  filename: "additional_file",
194  installable: false,
195}
196
197apex {
198  name: "com.android.apex.cts.shim.v2_additional_file",
199  // Use manifest_v2_rebootless to also re-use this APEX in the rebootless update test case.
200  manifest: "manifest_v2_rebootless.json",
201  androidManifest: "AndroidManifest.xml",
202  file_contexts: ":apex.test-file_contexts",
203  key: "com.android.apex.cts.shim.key",
204  prebuilts: ["hash_of_dev_null", "apex_shim_additional_file"],
205  installable: false,
206  updatable: false,
207}
208
209prebuilt_etc {
210  name: "apex_shim_additional_folder",
211  src: "additional_file",
212  filename: "additional_file",
213  sub_dir: "additional_folder",
214  installable: false,
215}
216
217apex {
218  name: "com.android.apex.cts.shim.v2_additional_folder",
219  // Use manifest_v2_rebootless to also re-use this APEX in the rebootless update test case.
220  manifest: "manifest_v2_rebootless.json",
221  androidManifest: "AndroidManifest.xml",
222  file_contexts: ":apex.test-file_contexts",
223  key: "com.android.apex.cts.shim.key",
224  prebuilts: ["hash_of_dev_null", "apex_shim_additional_folder"],
225  installable: false,
226  updatable: false,
227}
228
229apex {
230  name: "com.android.apex.cts.shim.v2_with_pre_install_hook",
231  manifest: "manifest_v2_with_pre_install_hook.json",
232  androidManifest: "AndroidManifest.xml",
233  file_contexts: ":apex.test-file_contexts",
234  key: "com.android.apex.cts.shim.key",
235  prebuilts: ["hash_of_dev_null"],
236  installable: false,
237  updatable: false,
238}
239
240apex {
241  name: "com.android.apex.cts.shim.v2_with_post_install_hook",
242  manifest: "manifest_v2_with_post_install_hook.json",
243  androidManifest: "AndroidManifest.xml",
244  file_contexts: ":apex.test-file_contexts",
245  key: "com.android.apex.cts.shim.key",
246  prebuilts: ["hash_of_dev_null"],
247  installable: false,
248  updatable: false,
249}
250
251genrule {
252  name: "generate_hash_v1",
253  srcs: [
254    ":com.android.apex.cts.shim.v2",
255    ":com.android.apex.cts.shim.v2_without_apk_in_apex",
256    ":com.android.apex.cts.shim.v2_additional_file",
257    ":com.android.apex.cts.shim.v2_additional_folder",
258    ":com.android.apex.cts.shim.v2_different_certificate",
259    ":com.android.apex.cts.shim.v2_different_package_name",
260    ":com.android.apex.cts.shim.v2_no_hashtree",
261    ":com.android.apex.cts.shim.v2_signed_bob",
262    ":com.android.apex.cts.shim.v2_signed_bob_rot",
263    ":com.android.apex.cts.shim.v2_signed_bob_rot_rollback",
264    ":com.android.apex.cts.shim.v2_with_pre_install_hook",
265    ":com.android.apex.cts.shim.v2_with_post_install_hook",
266    ":com.android.apex.cts.shim.v2_sdk_target_p",
267    ":com.android.apex.cts.shim.v2_apk_in_apex_sdk_target_p",
268    ":com.android.apex.cts.shim.v2_apk_in_apex_upgrades",
269    ":com.android.apex.cts.shim.v2_rebootless",
270    ":com.android.apex.cts.shim.v2_install_constraints_empty",
271    ":com.android.apex.cts.shim.v2_install_constraints_invalid_fingerprint",
272    ":com.android.apex.cts.shim.v2_install_constraints_no_value",
273    ":com.android.apex.cts.shim.v3",
274    ":com.android.apex.cts.shim.v3_rebootless",
275    ":com.android.apex.cts.shim.v3_signed_bob",
276    ":com.android.apex.cts.shim.v3_signed_bob_rot",
277  ],
278  out: ["hash.txt"],
279  cmd: "sha512sum -b $(in) | cut -d' ' -f1 | tee $(out)",
280}
281
282prebuilt_etc {
283  name: "hash_v1",
284  src: ":generate_hash_v1",
285  filename: "hash.txt",
286  installable: false,
287}
288
289apex {
290  name: "com.android.apex.cts.shim.v1",
291  manifest: "manifest.json",
292  androidManifest: "AndroidManifest.xml",
293  file_contexts: ":apex.test-file_contexts",
294  key: "com.android.apex.cts.shim.key",
295  prebuilts: ["hash_v1"],
296  apps: ["CtsShim", "CtsShimPriv"],
297  allowed_files: "default_shim_allowed_list.txt",
298  updatable: false,
299}
300
301// This is to install the flattened version of com.android.apex.cts.shim.
302// Because com.android.apex.cts.shim is provided as prebuilt and the build system
303// doesn't support install "flattened" version from "prebult" yet, GSI, which should
304// have both "flatttened" and "unflattened" APEXes, is missing the flattened version
305// of com.android.apex.cts.shim.
306// TODO(b/159426728):  When the build system can install "flattened" from "prebuilts",
307// this can be removed.
308override_apex {
309  name: "com.android.apex.cts.shim.v1_with_prebuilts",
310  base: "com.android.apex.cts.shim.v1",
311  apps: ["CtsShimPrebuilt", "CtsShimPrivPrebuilt"],
312  allowed_files: "prebuilts_shim_allowed_list.txt",
313}
314
315genrule {
316  name: "com.android.apex.cts.shim_not_pre_installed.pem",
317  out: ["com.android.apex.cts.shim_not_pre_installed.pem"],
318  cmd: "openssl genrsa -out $(out) 4096",
319}
320
321genrule {
322  name: "com.android.apex.cts.shim_not_pre_installed.pubkey",
323  srcs: [":com.android.apex.cts.shim_not_pre_installed.pem"],
324  out: ["com.android.apex.cts.shim_not_pre_installed.pubkey"],
325  tools: ["avbtool"],
326  cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)",
327}
328
329apex_key {
330  name: "com.android.apex.cts.shim_not_pre_installed.key",
331  private_key: ":com.android.apex.cts.shim_not_pre_installed.pem",
332  public_key: ":com.android.apex.cts.shim_not_pre_installed.pubkey",
333  installable: false,
334}
335
336apex {
337  name: "com.android.apex.cts.shim_not_pre_installed",
338  manifest: "manifest_not_pre_installed.json",
339  androidManifest: "AndroidManifestNotPreInstalled.xml",
340  file_contexts: ":apex.test-file_contexts",
341  key: "com.android.apex.cts.shim_not_pre_installed.key",
342  prebuilts: ["hash_of_dev_null"],
343  installable: false,
344  updatable: false,
345}
346
347apex {
348  name: "com.android.apex.cts.shim.v2_different_certificate",
349  // Use manifest_v2_rebootless to also re-use this APEX in the rebootless update test case.
350  manifest: "manifest_v2_rebootless.json",
351  androidManifest: "AndroidManifest.xml",
352  file_contexts: ":apex.test-file_contexts",
353  key: "com.android.apex.cts.shim.key",
354  prebuilts: ["hash_of_dev_null"],
355  installable: false,
356  certificate: ":com.android.apex.cts.shim.debug.cert",
357  updatable: false,
358}
359
360android_app_certificate {
361  name: "com.android.apex.cts.shim.debug.cert",
362  certificate: "com.android.apex.cts.shim.debug.cert",
363}
364
365// Build rules to build shim apex with rotated keys
366
367// We name the original key used to sign cts.shim.v1 package as alice.
368// We then create a second key called bob. The second key bob is used to rotate the
369// original key alice.
370
371// Create private key bob in pem format
372genrule {
373  name: "com.android.apex.rotation.key.bob.pem",
374  out: ["bob.pem"],
375  cmd: "openssl req -x509 -newkey rsa:4096 -nodes -days 999999 -subj '/DN=/EMAILADDRESS=android@android.com/CN=Android/OU=Android/O=Android/L=Mountain View/ST=California/C=US' -keyout $(out)",
376}
377
378// Converts bob's private key to pk8 format
379genrule {
380  name: "com.android.apex.rotation.key.bob.pk8",
381  srcs: [":com.android.apex.rotation.key.bob.pem"],
382  out: ["bob.pk8"],
383  cmd: "openssl pkcs8 -topk8 -inform PEM -outform DER -in $(in) -out $(out) -nocrypt",
384}
385
386// Extract bob's public key from its private key
387genrule {
388    name: "com.android.apex.rotation.key.bob.x509.pem",
389    srcs: [":com.android.apex.rotation.key.bob.pem"],
390    out: ["bob.x509.pem"],
391    cmd: "openssl req -x509 -key $(in) -newkey rsa:4096 -nodes -days 999999 -subj '/DN=/EMAILADDRESS=android@android.com/CN=Android/OU=Android/O=Android/L=Mountain View/ST=California/C=US' -out $(out)",
392}
393
394// Create lineage file for rotating alice to bob
395genrule {
396  name: "com.android.apex.rotation.key.bob.rot",
397  srcs: [
398    "alice.pk8",
399    "alice.x509.pem",
400    ":com.android.apex.rotation.key.bob.pk8",
401    ":com.android.apex.rotation.key.bob.x509.pem",
402  ],
403  out: ["bob.rot"],
404  tools: [":apksigner"],
405  cmd: "$(location :apksigner) rotate --out $(out) --old-signer --key $(location alice.pk8) --cert $(location alice.x509.pem) --new-signer --key $(location :com.android.apex.rotation.key.bob.pk8) --cert $(location :com.android.apex.rotation.key.bob.x509.pem)",
406}
407
408// Create lineage file for rotating alice to bob with rollback capability
409genrule {
410  name: "com.android.apex.rotation.key.bob.rot.rollback",
411  srcs: [
412    "alice.pk8",
413    "alice.x509.pem",
414    ":com.android.apex.rotation.key.bob.pk8",
415    ":com.android.apex.rotation.key.bob.x509.pem",
416  ],
417  out: ["bob.rot"],
418  tools: [":apksigner"],
419  cmd: "$(location :apksigner) rotate --out $(out) --old-signer --key $(location alice.pk8) --cert $(location alice.x509.pem) --set-rollback true --new-signer --key $(location :com.android.apex.rotation.key.bob.pk8) --cert $(location :com.android.apex.rotation.key.bob.x509.pem)",
420}
421
422// v2 cts shim package signed by bob, without lineage
423genrule {
424  name: "com.android.apex.cts.shim.v2_signed_bob",
425  out: ["com.android.apex.cts.shim.v2_signed_bob"],
426  tools: [":apksigner"],
427  srcs: [
428    ":com.android.apex.cts.shim.v2",
429    ":com.android.apex.rotation.key.bob.x509.pem",
430    ":com.android.apex.rotation.key.bob.pk8",
431  ],
432  dist: {
433    targets: ["com.android.apex.cts.shim.v2_signed_bob"],
434    dest: "com.android.apex.cts.shim.v2_signed_bob.apex",
435  },
436  cmd: "$(location :apksigner) sign --v1-signing-enabled false --v2-signing-enabled false --key $(location :com.android.apex.rotation.key.bob.pk8) --cert $(location :com.android.apex.rotation.key.bob.x509.pem) --out $(out) $(location :com.android.apex.cts.shim.v2)",
437}
438
439// v2 cts shim package signed by bob + lineage
440genrule {
441  name: "com.android.apex.cts.shim.v2_signed_bob_rot",
442  out: ["com.android.apex.cts.shim.v2_signed_bob_rot"],
443  tools: [":apksigner"],
444  srcs: [
445    ":com.android.apex.cts.shim.v2",
446    ":com.android.apex.rotation.key.bob.x509.pem",
447    ":com.android.apex.rotation.key.bob.pk8",
448    ":com.android.apex.rotation.key.bob.rot",
449  ],
450  dist: {
451    targets: ["com.android.apex.cts.shim.v2_signed_bob_rot"],
452    dest: "com.android.apex.cts.shim.v2_signed_bob_rot.apex",
453  },
454  cmd: "$(location :apksigner) sign --v1-signing-enabled false --v2-signing-enabled false --key $(location :com.android.apex.rotation.key.bob.pk8) --cert $(location :com.android.apex.rotation.key.bob.x509.pem) --lineage $(location :com.android.apex.rotation.key.bob.rot) --rotation-min-sdk-version 28 --out $(out) $(location :com.android.apex.cts.shim.v2)",
455}
456
457// v2 cts shim package signed by bob + lineage + rollback capability
458genrule {
459  name: "com.android.apex.cts.shim.v2_signed_bob_rot_rollback",
460  out: ["com.android.apex.cts.shim.v2_signed_bob_rot_rollback"],
461  tools: [":apksigner"],
462  srcs: [
463    ":com.android.apex.cts.shim.v2",
464    ":com.android.apex.rotation.key.bob.x509.pem",
465    ":com.android.apex.rotation.key.bob.pk8",
466    ":com.android.apex.rotation.key.bob.rot.rollback",
467  ],
468  dist: {
469    targets: ["com.android.apex.cts.shim.v2_signed_bob_rot_rollback"],
470    dest: "com.android.apex.cts.shim.v2_signed_bob_rot_rollback.apex",
471  },
472  cmd: "$(location :apksigner) sign --v1-signing-enabled false --v2-signing-enabled false --key $(location :com.android.apex.rotation.key.bob.pk8) --cert $(location :com.android.apex.rotation.key.bob.x509.pem) --lineage $(location :com.android.apex.rotation.key.bob.rot.rollback) --rotation-min-sdk-version 28 --out $(out) $(location :com.android.apex.cts.shim.v2)",
473}
474
475// v3 cts shim package signed by bob
476genrule {
477  name: "com.android.apex.cts.shim.v3_signed_bob",
478  out: ["com.android.apex.cts.shim.v3_signed_bob"],
479  tools: [":apksigner"],
480  srcs: [
481    ":com.android.apex.cts.shim.v3",
482    ":com.android.apex.rotation.key.bob.x509.pem",
483    ":com.android.apex.rotation.key.bob.pk8",
484  ],
485  dist: {
486    targets: ["com.android.apex.cts.shim.v3_signed_bob"],
487    dest: "com.android.apex.cts.shim.v3_signed_bob.apex",
488  },
489  cmd: "$(location :apksigner) sign --v1-signing-enabled false --v2-signing-enabled false --key $(location :com.android.apex.rotation.key.bob.pk8) --cert $(location :com.android.apex.rotation.key.bob.x509.pem) --out $(out) $(location :com.android.apex.cts.shim.v3)",
490}
491
492// v3 cts shim package signed by bob + lineage
493genrule {
494  name: "com.android.apex.cts.shim.v3_signed_bob_rot",
495  out: ["com.android.apex.cts.shim.v3_signed_bob_rot"],
496  tools: [":apksigner"],
497  srcs: [
498    ":com.android.apex.cts.shim.v3",
499    ":com.android.apex.rotation.key.bob.x509.pem",
500    ":com.android.apex.rotation.key.bob.pk8",
501    ":com.android.apex.rotation.key.bob.rot",
502  ],
503  dist: {
504    targets: ["com.android.apex.cts.shim.v3_signed_bob_rot"],
505    dest: "com.android.apex.cts.shim.v3_signed_bob_rot.apex",
506  },
507  cmd: "$(location :apksigner) sign --v1-signing-enabled false --v2-signing-enabled false --key $(location :com.android.apex.rotation.key.bob.pk8) --cert $(location :com.android.apex.rotation.key.bob.x509.pem) --lineage $(location :com.android.apex.rotation.key.bob.rot) --rotation-min-sdk-version 28 --out $(out) $(location :com.android.apex.cts.shim.v3)",
508}
509
510// This one is only used in ApexdHostTest and not meant to be installed
511// and hence shouldn't be allowed in hash.txt of v1 shim APEX.
512apex {
513  name: "com.android.apex.cts.shim.v2_legacy",
514  manifest: "manifest_v2.json",
515  androidManifest: "AndroidManifest.xml",
516  file_contexts: ":apex.test-file_contexts",
517  key: "com.android.apex.cts.shim.key",
518  prebuilts: ["hash_of_dev_null"],
519  apps: ["CtsShim", "CtsShimPriv"],
520  installable: false,
521  min_sdk_version: "29",
522  updatable: false,
523}
524
525genrule {
526  name: "com.android.apex.cts.shim.v2_no_pb",
527  srcs: [":com.android.apex.cts.shim.v2_legacy"],
528  out: ["com.android.apex.cts.shim.v2_no_pb.apex"],
529  tools: ["zip2zip"],
530  cmd: "$(location zip2zip) -i $(in) -x apex_manifest.pb -o $(out)",
531}
532
533// Apex shim that targets an old sdk (P)
534apex {
535  name: "com.android.apex.cts.shim.v2_sdk_target_p",
536  // Use manifest_v2_rebootless to also re-use this APEX in the rebootless update test case.
537  manifest: "manifest_v2_rebootless.json",
538  androidManifest: "AndroidManifestSdkTargetP.xml",
539  file_contexts: ":apex.test-file_contexts",
540  key: "com.android.apex.cts.shim.key",
541  prebuilts: ["hash_of_dev_null"],
542  installable: false,
543  apps: ["CtsShim", "CtsShimPriv"],
544  updatable: false,
545}
546
547// Apex shim with apk-in-apex that targets sdk P
548apex {
549  name: "com.android.apex.cts.shim.v2_apk_in_apex_sdk_target_p",
550  manifest: "manifest_v2.json",
551  androidManifest: "AndroidManifest.xml",
552  file_contexts: ":apex.test-file_contexts",
553  key: "com.android.apex.cts.shim.key",
554  prebuilts: ["hash_of_dev_null"],
555  apps: ["CtsShimTargetPSdk"],
556  installable: false,
557  updatable: false,
558}
559
560// Apex shim with unsigned apk
561genrule {
562  name: "com.android.apex.cts.shim.v2_unsigned_apk_container",
563  // Use shim.v2_rebootless to re-use same APEX in the rebootless update test case.
564  srcs: [":com.android.apex.cts.shim.v2_rebootless"],
565  out: ["com.android.apex.cts.shim.v2_unsigned_apk_container.apex"],
566  cmd: "cp -v $(in) $(out) && zip -d $(out) META-INF*",
567  dist: {
568    targets: ["com.android.apex.cts.shim.v2_unsigned_apk_container"],
569    dest: "com.android.apex.cts.shim.v2_unsigned_apk_container.apex",
570  },
571}
572
573// Apex shim for testing rebootless updates
574apex {
575  name: "com.android.apex.cts.shim.v2_rebootless",
576  manifest: "manifest_v2_rebootless.json",
577  file_contexts: ":apex.test-file_contexts",
578  key: "com.android.apex.cts.shim.key",
579  prebuilts: ["hash_of_dev_null"],
580  installable: false,
581  updatable: false,
582}
583
584apex {
585  name: "com.android.apex.cts.shim.v3_rebootless",
586  manifest: "manifest_v3_rebootless.json",
587  file_contexts: ":apex.test-file_contexts",
588  key: "com.android.apex.cts.shim.key",
589  prebuilts: ["hash_of_dev_null"],
590  installable: false,
591  updatable: false,
592}
593
594// Apex shim with upgraded apk-in-apexes
595apex {
596  name: "com.android.apex.cts.shim.v2_apk_in_apex_upgrades",
597  manifest: "manifest_v2.json",
598  androidManifest: "AndroidManifest.xml",
599  file_contexts: ":apex.test-file_contexts",
600  key: "com.android.apex.cts.shim.key",
601  prebuilts: ["hash_of_dev_null"],
602  apps: ["CtsShim", "CtsShimPrivUpgrade"],
603  installable: false,
604  updatable: false,
605}
606
607apex {
608  name: "com.android.apex.cts.shim.v2_install_constraints_empty",
609  manifest: "manifest_v2.json",
610  androidManifest: "AndroidManifestInstallConstraints_empty.xml",
611  file_contexts: ":apex.test-file_contexts",
612  key: "com.android.apex.cts.shim.key",
613  prebuilts: ["hash_of_dev_null"],
614  installable: false,
615  updatable: false,
616}
617
618apex {
619  name: "com.android.apex.cts.shim.v2_install_constraints_invalid_fingerprint",
620  manifest: "manifest_v2.json",
621  androidManifest: "AndroidManifestInstallConstraints_invalid_fingerprint.xml",
622  file_contexts: ":apex.test-file_contexts",
623  key: "com.android.apex.cts.shim.key",
624  prebuilts: ["hash_of_dev_null"],
625  installable: false,
626  updatable: false,
627}
628
629apex {
630  name: "com.android.apex.cts.shim.v2_install_constraints_no_value",
631  manifest: "manifest_v2.json",
632  androidManifest: "AndroidManifestInstallConstraints_no_value.xml",
633  file_contexts: ":apex.test-file_contexts",
634  key: "com.android.apex.cts.shim.key",
635  prebuilts: ["hash_of_dev_null"],
636  installable: false,
637  updatable: false,
638}
639