xref: /aosp_15_r20/cts/hostsidetests/appsecurity/test-apps/KeyRotationTest/Android.bp (revision b7c941bb3fa97aba169d73cee0bed2de8ac964bf)
1//
2// Copyright (C) 2020 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    default_team: "trendy_team_platform_security",
19    // See: http://go/android-license-faq
20    default_applicable_licenses: ["Android-Apache-2.0"],
21}
22
23java_library {
24    name: "cts_signature_query_service",
25    srcs: [
26        "src/**/*.java",
27        "src/**/I*.aidl",
28    ],
29    sdk_version: "current",
30}
31
32// This is the first version of the test app signed with the initial signing
33// key. This app exports the bound service from the cts_signature_query_service
34// library and is used to verify end to end updates with key rotation.
35android_test {
36    name: "CtsSignatureQueryService",
37    defaults: ["cts_support_defaults"],
38    compile_multilib: "both",
39    sdk_version: "current",
40    static_libs: ["cts_signature_query_service"],
41    test_suites: [
42        "cts",
43        "general-tests",
44    ],
45    certificate: ":ec-p256",
46    v4_signature: true,
47}
48
49// This is the second version of the test app signed with the rotated signing
50// key with an updated version number. This app is intended to verify that an
51// app continues to function as expected after an update with a rotated key.
52android_test {
53    name: "CtsSignatureQueryService_v2",
54    defaults: ["cts_support_defaults"],
55    manifest: "AndroidManifest_v2.xml",
56    compile_multilib: "both",
57    sdk_version: "current",
58    static_libs: ["cts_signature_query_service"],
59    test_suites: [
60        "cts",
61        "general-tests",
62    ],
63    certificate: ":ec-p256_2",
64    additional_certificates: [":ec-p256"],
65    lineage: ":ec-p256-por_1_2-default-caps",
66    v4_signature: true,
67}
68
69// This is the third version of the test app signed with the same rotated
70// signing key as v2. This app is intended to verify that an app can still
71// be updated and function as expected after the signing key has been rotated.
72android_test {
73    name: "CtsSignatureQueryService_v3",
74    defaults: ["cts_support_defaults"],
75    manifest: "AndroidManifest_v3.xml",
76    compile_multilib: "both",
77    sdk_version: "current",
78    static_libs: ["cts_signature_query_service"],
79    test_suites: [
80        "cts",
81        "general-tests",
82    ],
83    certificate: ":ec-p256_2",
84    additional_certificates: [":ec-p256"],
85    lineage: ":ec-p256-por_1_2-default-caps",
86    v4_signature: true,
87}
88
89// This is the second version of the test app signed with the rotated signing
90// key targeting SDK version 33 for rotation with an updated version number.
91// This app is intended to verify that an app continues to function as expected
92// after an update with a rotated key in the v3.1 block.
93android_test {
94    name: "CtsSignatureQueryService_v2-tgt-33",
95    defaults: ["cts_support_defaults"],
96    manifest: "AndroidManifest_v2.xml",
97    compile_multilib: "both",
98    min_sdk_version: "32",
99    sdk_version: "current",
100    static_libs: ["cts_signature_query_service"],
101    test_suites: [
102        "cts",
103        "general-tests",
104    ],
105    certificate: ":ec-p256_2",
106    additional_certificates: [":ec-p256"],
107    lineage: ":ec-p256-por_1_2-default-caps",
108    rotationMinSdkVersion: "33",
109    v4_signature: true,
110}
111
112// This is the third version of the test app signed with the same rotated
113// signing key as v2 and targeting SDK version 33 for rotation. This app
114// is intended to verify that an app can still be updated and function as
115// expected after the signing key has been rotated in the v3.1 block.
116android_test {
117    name: "CtsSignatureQueryService_v3-tgt-33",
118    defaults: ["cts_support_defaults"],
119    manifest: "AndroidManifest_v3.xml",
120    compile_multilib: "both",
121    min_sdk_version: "32",
122    sdk_version: "current",
123    static_libs: ["cts_signature_query_service"],
124    test_suites: [
125        "cts",
126        "general-tests",
127    ],
128    certificate: ":ec-p256_2",
129    additional_certificates: [":ec-p256"],
130    lineage: ":ec-p256-por_1_2-default-caps",
131    rotationMinSdkVersion: "33",
132    v4_signature: true,
133}
134