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 // See: http://go/android-license-faq 19 default_applicable_licenses: ["Android-Apache-2.0"], 20} 21 22// This is the default test package signed with the default key. 23android_test_helper_app { 24 name: "CtsPkgInstallTinyApp", 25 srcs: ["src/**/*.java"], 26 // resource_dirs is the default value: ["res"] 27 test_suites: [ 28 "cts", 29 "general-tests", 30 ], 31 sdk_version: "current", 32} 33 34// This is the test package v2 signed with the default key. 35android_test_helper_app { 36 name: "CtsPkgInstallTinyAppV2", 37 manifest: "AndroidManifest-v2.xml", 38 srcs: ["src/**/*.java"], 39 // resource_dirs is the default value: ["res"] 40 test_suites: [ 41 "cts", 42 "general-tests", 43 ], 44 sdk_version: "current", 45} 46 47// This is the test package signed using the V1/V2 signature schemes with 48// two signers targeting SDK version 30 with sandbox version 1. From this 49// package the v1-ec-p256-two-signers-targetSdk-30.apk is created with the 50// following command: 51// apksigner sign --in v1v2-ec-p256-two-signers-targetSdk-30.apk --out 52// v1-ec-p256-two-signers-targetSdk-30.apk --cert ec-p256.x509.pem --key 53// ec-p256.pk8 --next-signer --cert ec-p256_2.x509.pem --key ec-p256_2.pk8 54// --v2-signing-enabled false --v3-signing-enabled false --v4-signing-enabled false 55android_test_helper_app { 56 name: "v1v2-ec-p256-two-signers-targetSdk-30", 57 manifest: "AndroidManifest-sandbox-v1.xml", 58 certificate: ":ec-p256", 59 additional_certificates: [":ec-p256_2"], 60 srcs: ["src/**/*.java"], 61 // resource_dirs is the default value: ["res"] 62 test_suites: [ 63 "cts", 64 "general-tests", 65 ], 66 sdk_version: "30", 67} 68 69// This is the test package signed using the V3 signature scheme 70// with the previous key in the lineage and part of a sharedUid. 71android_test_helper_app { 72 name: "v3-ec-p256-1-sharedUid", 73 manifest: "AndroidManifest-shareduid.xml", 74 certificate: ":ec-p256", 75 srcs: ["src/**/*.java"], 76 // resource_dirs is the default value: ["res"] 77 test_suites: [ 78 "cts", 79 "general-tests", 80 ], 81 sdk_version: "current", 82} 83 84// This is the test package signed using the V3 signature scheme with 85// a rotated key and one signer in the lineage with default capabilities. 86android_test_helper_app { 87 name: "v3-ec-p256-with-por_1_2-default-caps", 88 certificate: ":ec-p256_2", 89 additional_certificates: [":ec-p256"], 90 lineage: ":ec-p256-por_1_2-default-caps", 91 srcs: ["src/**/*.java"], 92 // resource_dirs is the default value: ["res"] 93 test_suites: [ 94 "cts", 95 "general-tests", 96 ], 97 sdk_version: "current", 98} 99 100// This is the test package signed using the V3 signature scheme with 101// a rotated key and multiple signers in the lineage with default 102// capabilities. 103android_test_helper_app { 104 name: "v3-ec-p256-with-por-1_2_3_4_5-default-caps", 105 certificate: ":ec-p256_5", 106 additional_certificates: [":ec-p256"], 107 lineage: ":ec-p256-por-1_2_3_4_5-default-caps", 108 srcs: ["src/**/*.java"], 109 // resource_dirs is the default value: ["res"] 110 test_suites: [ 111 "cts", 112 "general-tests", 113 ], 114 sdk_version: "current", 115} 116 117// This is the test package signed using the V3 signature scheme with 118// a rotated key and part of a shareduid. The capabilities of this lineage 119// grant access to the previous key in the lineage to join the sharedUid. 120android_test_helper_app { 121 name: "v3-ec-p256-with-por_1_2-default-caps-sharedUid", 122 manifest: "AndroidManifest-shareduid.xml", 123 certificate: ":ec-p256_2", 124 additional_certificates: [":ec-p256"], 125 lineage: ":ec-p256-por_1_2-default-caps", 126 srcs: ["src/**/*.java"], 127 // resource_dirs is the default value: ["res"] 128 test_suites: [ 129 "cts", 130 "general-tests", 131 ], 132 sdk_version: "current", 133} 134 135// This is the test package signed using the V3 signature scheme with 136// a rotated key and part of a shareduid. The signing lineage begins 137// with a key that is not in any of the other lineages and is intended 138// to verify that two packages signed with lineages that have diverged 139// ancestors are not allowed to be installed in the same sharedUserId. 140android_test_helper_app { 141 name: "v3-por_Y_1_2-default-caps-sharedUid", 142 manifest: "AndroidManifest-shareduid.xml", 143 certificate: ":ec-p256_2", 144 additional_certificates: [ 145 ":rsa-2048", 146 ":ec-p256", 147 ], 148 lineage: ":por_Y_1_2-default-caps", 149 srcs: ["src/**/*.java"], 150 // resource_dirs is the default value: ["res"] 151 test_suites: [ 152 "cts", 153 "general-tests", 154 ], 155 sdk_version: "current", 156} 157 158// This is the test package signed using the V3 signature scheme with 159// a rotated key and part of a shareduid. The capabilities of this lineage 160// prevent the previous key in the lineage from joining the sharedUid. 161android_test_helper_app { 162 name: "v3-ec-p256-with-por_1_2-no-shUid-cap-sharedUid", 163 manifest: "AndroidManifest-shareduid.xml", 164 certificate: ":ec-p256_2", 165 additional_certificates: [":ec-p256"], 166 lineage: ":ec-p256-por_1_2-no-shUid-cap", 167 srcs: ["src/**/*.java"], 168 // resource_dirs is the default value: ["res"] 169 test_suites: [ 170 "cts", 171 "general-tests", 172 ], 173 sdk_version: "current", 174} 175 176// This is the test package signed using the V3 signature scheme with 177// a rotated key and part of a shareduid. The capabilities of this lineage 178// prevent the previous key in the lineage from using a signature permission. 179// This package is intended to verify shared signing keys in separate app 180// lineages retain their own declared capabilities. 181android_test_helper_app { 182 name: "v3-ec-p256-with-por_1_2-no-perm-cap-sharedUid", 183 manifest: "AndroidManifest-shareduid.xml", 184 certificate: ":ec-p256_2", 185 additional_certificates: [":ec-p256"], 186 lineage: ":ec-p256-por_1_2-no-perm-cap", 187 srcs: ["src/**/*.java"], 188 // resource_dirs is the default value: ["res"] 189 test_suites: [ 190 "cts", 191 "general-tests", 192 ], 193 sdk_version: "current", 194} 195 196// This is the test package with a new name intended to be installed 197// alongside the original test package when verifying platform behavior when 198// two apps share the same previous signer in their lineage with different 199// capabilities granted; the lineage for this package prevents an app signed 200// with the previous signing key from joining a sharedUserId. 201android_test_helper_app { 202 name: "v3-ec-p256-with-por_1_2-no-shUid-cap-declperm2", 203 manifest: "AndroidManifest-declperm2.xml", 204 certificate: ":ec-p256_2", 205 additional_certificates: [":ec-p256"], 206 lineage: ":ec-p256-por_1_2-no-shUid-cap", 207 srcs: ["src/**/*.java"], 208 // resource_dirs is the default value: ["res"] 209 test_suites: [ 210 "cts", 211 "general-tests", 212 ], 213 sdk_version: "current", 214} 215 216// This is the first companion package signed using the V3 signature scheme 217// with a rotated key and part of a sharedUid. The capabilities of this lineage 218// grant access to the previous key in the lineage to join the sharedUid. 219android_test_helper_app { 220 name: "v3-ec-p256-with-por_1_2-default-caps-sharedUid-companion", 221 manifest: "AndroidManifest-companion-shareduid.xml", 222 certificate: ":ec-p256_2", 223 additional_certificates: [":ec-p256"], 224 lineage: ":ec-p256-por_1_2-default-caps", 225 srcs: ["src/**/*.java"], 226 // resource_dirs is the default value: ["res"] 227 test_suites: [ 228 "cts", 229 "general-tests", 230 ], 231 sdk_version: "current", 232} 233 234// This is the first companion package signed using the V3 signature scheme 235// with a rotated key and part of a sharedUid. The capabilities of this lineage 236// prevent the previous signing key from joining the sharedUserId. 237android_test_helper_app { 238 name: "v3-ec-p256-with-por_1_2-no-shUid-cap-sharedUid-companion", 239 manifest: "AndroidManifest-companion-shareduid.xml", 240 certificate: ":ec-p256_2", 241 additional_certificates: [":ec-p256"], 242 lineage: ":ec-p256-por_1_2-no-shUid-cap", 243 srcs: ["src/**/*.java"], 244 // resource_dirs is the default value: ["res"] 245 test_suites: [ 246 "cts", 247 "general-tests", 248 ], 249 sdk_version: "current", 250} 251 252// This is the companion package signed using the V3 signature scheme with 253// a rotated key and part of a shareduid. The signing lineage begins 254// with a key that is not in any of the other lineages and is intended 255// to verify that two packages signed with lineages that have diverged 256// ancestors are not allowed to be installed in the same sharedUserId. 257android_test_helper_app { 258 name: "v3-por_Z_1_2-default-caps-sharedUid-companion", 259 manifest: "AndroidManifest-shareduid.xml", 260 certificate: ":ec-p256_2", 261 additional_certificates: [ 262 ":dsa-2048", 263 ":ec-p256", 264 ], 265 lineage: ":por_Z_1_2-default-caps", 266 srcs: ["src/**/*.java"], 267 // resource_dirs is the default value: ["res"] 268 test_suites: [ 269 "cts", 270 "general-tests", 271 ], 272 sdk_version: "current", 273} 274 275// This is the first companion package signed using the V3 signature scheme 276// with a rotated key and part of a sharedUid but without the signing lineage. 277// This app is intended to test lineage scenarios where an app is only signed 278// with the latest key in the lineage. 279android_test_helper_app { 280 name: "v3-ec-p256-2-sharedUid-companion", 281 manifest: "AndroidManifest-companion-shareduid.xml", 282 certificate: ":ec-p256_2", 283 srcs: ["src/**/*.java"], 284 // resource_dirs is the default value: ["res"] 285 test_suites: [ 286 "cts", 287 "general-tests", 288 ], 289 sdk_version: "current", 290} 291 292// This is the second companion package signed using the V3 signature scheme 293// with the previous key in the lineage and part of a sharedUid. 294android_test_helper_app { 295 name: "v3-ec-p256-1-sharedUid-companion2", 296 manifest: "AndroidManifest-companion2-shareduid.xml", 297 certificate: ":ec-p256", 298 srcs: ["src/**/*.java"], 299 // resource_dirs is the default value: ["res"] 300 test_suites: [ 301 "cts", 302 "general-tests", 303 ], 304 sdk_version: "current", 305} 306 307// This is the second companion package signed using the V3 signature scheme 308// with a rotated key and part of a sharedUid. The capabilities of this lineage 309// prevent the previous signing key from joining the sharedUserId. 310android_test_helper_app { 311 name: "v3-ec-p256-with-por_1_2-no-shUid-cap-sharedUid-companion2", 312 manifest: "AndroidManifest-companion2-shareduid.xml", 313 certificate: ":ec-p256_2", 314 additional_certificates: [":ec-p256"], 315 lineage: ":ec-p256-por_1_2-no-shUid-cap", 316 srcs: ["src/**/*.java"], 317 // resource_dirs is the default value: ["res"] 318 test_suites: [ 319 "cts", 320 "general-tests", 321 ], 322 sdk_version: "current", 323} 324 325// This is the third companion package signed using the V3 signature scheme 326// with a rotated key and part of a sharedUid. The capabilities of this lineage 327// grant access to the previous key in the lineage to join the sharedUid. 328android_test_helper_app { 329 name: "v3-ec-p256-with-por_1_2-default-caps-sharedUid-companion3", 330 manifest: "AndroidManifest-companion3-shareduid.xml", 331 certificate: ":ec-p256_2", 332 additional_certificates: [":ec-p256"], 333 lineage: ":ec-p256-por_1_2-default-caps", 334 srcs: ["src/**/*.java"], 335 // resource_dirs is the default value: ["res"] 336 test_suites: [ 337 "cts", 338 "general-tests", 339 ], 340 sdk_version: "current", 341} 342 343// This is a version of the test package that declares a signature permission. 344// The lineage used to sign this test package does not trust the first signing 345// key but grants default capabilities to the second signing key. 346android_test_helper_app { 347 name: "v3-ec-p256-with-por_1_2_3-1-no-caps-2-default-declperm", 348 manifest: "AndroidManifest-declperm.xml", 349 certificate: ":ec-p256_3", 350 additional_certificates: [ 351 ":ec-p256", 352 ], 353 lineage: ":ec-p256-por-1_2_3-1-no-caps-2-default", 354 srcs: ["src/**/*.java"], 355 // resource_dirs is the default value: ["res"] 356 test_suites: [ 357 "cts", 358 "general-tests", 359 ], 360 sdk_version: "current", 361} 362 363// This is a version of the test package that declares a signature permission. 364// The lineage used to sign this test package does not trust either of the signing 365// keys so an app with only common signers in the lineage should not be granted the 366// permission. 367android_test_helper_app { 368 name: "v3-ec-p256-with-por_1_2_3-no-caps-declperm", 369 manifest: "AndroidManifest-declperm.xml", 370 certificate: ":ec-p256_3", 371 additional_certificates: [ 372 ":ec-p256", 373 ], 374 lineage: ":ec-p256-por-1_2_3-no-caps", 375 srcs: ["src/**/*.java"], 376 // resource_dirs is the default value: ["res"] 377 test_suites: [ 378 "cts", 379 "general-tests", 380 ], 381 sdk_version: "current", 382} 383 384// This is a version of the companion package that requests the signature permission 385// declared by the test package above. This package is signed with a signing key that 386// diverges from the package above and is intended to verify that a common signing 387// key in the lineage that is still granted the permission capability is sufficient 388// to be granted a signature permission. 389android_test_helper_app { 390 name: "v3-ec-p256-with-por_1_2_4-companion-usesperm", 391 manifest: "AndroidManifest-companion-usesperm.xml", 392 certificate: ":ec-p256_4", 393 additional_certificates: [ 394 ":ec-p256", 395 ], 396 lineage: ":ec-p256-por-1_2_4-default-caps", 397 srcs: ["src/**/*.java"], 398 // resource_dirs is the default value: ["res"] 399 test_suites: [ 400 "cts", 401 "general-tests", 402 ], 403 sdk_version: "current", 404} 405 406// This is a version of the companion package that requests the signature permission 407// declared by the test package. This package is signed with the original signing 408// key and is intended to verify that a common signing key shared between two 409// lineages retains its capability from the package declaring the signature permission. 410android_test_helper_app { 411 name: "v3-ec-p256-1-companion-usesperm", 412 manifest: "AndroidManifest-companion-usesperm.xml", 413 certificate: ":ec-p256", 414 srcs: ["src/**/*.java"], 415 // resource_dirs is the default value: ["res"] 416 test_suites: [ 417 "cts", 418 "general-tests", 419 ], 420 sdk_version: "current", 421} 422 423// This is a version of the test package that declares a signature permission 424// with the knownSigner protection flag. This app is signed with the rsa-2048 425// signing key with the trusted certificates being ec-p256 and ec-p256_3. 426android_test_helper_app { 427 name: "v3-rsa-2048-decl-knownSigner-ec-p256-1-3", 428 manifest: "AndroidManifest-decl-knownSigner.xml", 429 certificate: ":rsa-2048", 430 srcs: ["src/**/*.java"], 431 // resource_dirs is the default value: ["res"] 432 test_suites: [ 433 "cts", 434 "general-tests", 435 ], 436 sdk_version: "current", 437} 438 439// This is a version of the test package that declares a signature permission 440// without the knownSigner protection flag. This app is signed with the same 441// rsa-2048 signing key to allow updates from the package above. This app can 442// be used to verify behavior when an app initially uses the knownSigner flag 443// and subsequently removes the flag from the permission declaration. 444android_test_helper_app { 445 name: "v3-rsa-2048-declperm", 446 manifest: "AndroidManifest-declperm.xml", 447 certificate: ":rsa-2048", 448 srcs: ["src/**/*.java"], 449 // resource_dirs is the default value: ["res"] 450 test_suites: [ 451 "cts", 452 "general-tests", 453 ], 454 sdk_version: "current", 455} 456 457// This is a version of the test package that declares a signature permission 458// with the knownSigner protection flag using a string resource instead of a 459// string-array resource for the trusted certs. 460android_test_helper_app { 461 name: "v3-rsa-2048-decl-knownSigner-str-res-ec-p256-1", 462 manifest: "AndroidManifest-decl-knownSigner-str-res.xml", 463 certificate: ":rsa-2048", 464 srcs: ["src/**/*.java"], 465 // resource_dirs is the default value: ["res"] 466 test_suites: [ 467 "cts", 468 "general-tests", 469 ], 470 sdk_version: "current", 471} 472 473// This is a version of the test package that declares a signature permission 474// with the knownSigner protection flag using a string constant as the value 475// of the knownCerts attribute. 476android_test_helper_app { 477 name: "v3-rsa-2048-decl-knownSigner-str-const-ec-p256-1", 478 manifest: "AndroidManifest-decl-knownSigner-str-const.xml", 479 certificate: ":rsa-2048", 480 srcs: ["src/**/*.java"], 481 // resource_dirs is the default value: ["res"] 482 test_suites: [ 483 "cts", 484 "general-tests", 485 ], 486 sdk_version: "current", 487} 488 489// This is a version of the companion package that uses the permission 490// declared with the knownSigner flag. This app's current signer is in 491// the array of certificate digests as declared by the test package 492// above. 493android_test_helper_app { 494 name: "v3-ec-p256_3-companion-uses-knownSigner", 495 manifest: "AndroidManifest-uses-knownSigner.xml", 496 certificate: ":ec-p256_3", 497 srcs: ["src/**/*.java"], 498 // resource_dirs is the default value: ["res"] 499 test_suites: [ 500 "cts", 501 "general-tests", 502 ], 503 sdk_version: "current", 504} 505 506// This is a version of the companion package that uses the permission 507// declared with the knownSigner flag. This app's current signer is not 508// in the array of certificate digests as declared by the test package 509// above. 510android_test_helper_app { 511 name: "v3-ec-p256_2-companion-uses-knownSigner", 512 manifest: "AndroidManifest-uses-knownSigner.xml", 513 certificate: ":ec-p256_2", 514 srcs: ["src/**/*.java"], 515 // resource_dirs is the default value: ["res"] 516 test_suites: [ 517 "cts", 518 "general-tests", 519 ], 520 sdk_version: "current", 521} 522 523// This is a version of the companion package that uses the permission 524// declared with the knownSigner flag. This app is signed with a rotated 525// signing key with the current signer not in the array of certificate 526// digests as declared by the test package, but the previous signer in 527// the lineage is. This app can be used to verify that knownSigner 528// permissions are also granted if the app was previously signed with 529// one of the declared digests. 530android_test_helper_app { 531 name: "v3-ec-p256-with-por_1_2-companion-uses-knownSigner", 532 manifest: "AndroidManifest-uses-knownSigner.xml", 533 certificate: ":ec-p256_2", 534 additional_certificates: [ 535 ":ec-p256", 536 ], 537 lineage: ":ec-p256-por_1_2-default-caps", 538 srcs: ["src/**/*.java"], 539 // resource_dirs is the default value: ["res"] 540 test_suites: [ 541 "cts", 542 "general-tests", 543 ], 544 sdk_version: "current", 545} 546