1// Copyright (C) 2020 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 15package { 16 default_applicable_licenses: ["Android-Apache-2.0"], 17} 18 19android_test_helper_app { 20 name: "CtsApkVerityTestApp", 21 manifest: "AndroidManifest.xml", 22 srcs: ["src/**/*.java"], 23 jni_libs: [ 24 "libCtsApkVerityTestAppJni", 25 ], 26 compile_multilib: "both", 27 libs: [ 28 "junit", 29 ], 30 static_libs: [ 31 "androidx.test.runner", 32 "ctstestrunner-axt", 33 ], 34 dex_preopt: { 35 enabled: false, 36 }, 37 use_embedded_native_libs: true, 38 sdk_version: "current", 39 certificate: ":cts-testkey1", 40 dist: { 41 targets: [ 42 "cts", 43 ], 44 }, 45 v4_signature: true, 46} 47 48android_test_helper_app { 49 name: "CtsApkVerityTestAppSplit", 50 manifest: "feature_split/AndroidManifest.xml", 51 srcs: ["feature_split/src/**/*.java"], 52 aaptflags: [ 53 "--custom-package android.appsecurity.cts.apkveritytestapp.feature_x", 54 "--package-id 0x80", 55 ], 56 dex_preopt: { 57 enabled: false, 58 }, 59 sdk_version: "current", 60 certificate: ":cts-testkey1", 61 dist: { 62 targets: [ 63 "cts", 64 ], 65 }, 66} 67 68genrule { 69 name: "CtsApkVerityTestAppApkIdSig", 70 srcs: [":CtsApkVerityTestApp"], 71 cmd: "for file in $(in); do " + 72 " if [[ $$file == *.apk.idsig ]]; then " + 73 " cp $$file $(out); " + 74 " fi " + 75 " done", 76 out: ["CtsApkVerityTestApp.apk.idsig"], 77 dist: { 78 targets: [ 79 "cts", 80 ], 81 }, 82} 83 84cc_library_shared { 85 name: "libCtsApkVerityTestAppJni", 86 srcs: ["jni/**/*.cpp"], 87 shared_libs: [ 88 "libnativehelper_compat_libc++", 89 "liblog", 90 ], 91 static_libs: [ 92 "libbase_ndk", 93 ], 94 cflags: [ 95 "-Wall", 96 "-Werror", 97 ], 98 stl: "c++_static", 99 sdk_version: "current", 100} 101