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. 14package { 15 default_applicable_licenses: ["Android-Apache-2.0"], 16} 17 18apex_key { 19 name: "com.android.apex.test.baz.key", 20 public_key: "com.android.apex.test.baz.avbpubkey", 21 private_key: "com.android.apex.test.baz.pem", 22} 23 24android_app_certificate { 25 name: "com.android.apex.test.baz.certificate", 26 certificate: "com.android.apex.test.baz", 27} 28 29apex { 30 name: "com.android.apex.test.baz", 31 manifest: "manifest.json", 32 file_contexts: ":apex.test-file_contexts", 33 key: "com.android.apex.test.baz.key", 34 installable: false, 35 binaries: [ "baz_test" ], 36 dist: { 37 targets: ["sharedlibs_test"], 38 }, 39 updatable: false, 40} 41 42cc_binary { 43 name: "baz_test", 44 srcs: ["baz_test.cc"], 45 shared_libs: [ 46 "libsharedlibtest", 47 ], 48 apex_available: [ "com.android.apex.test.baz" ], 49} 50 51genrule { 52 name: "com.android.apex.test.baz_stripped", 53 out: ["com.android.apex.test.baz_stripped.apex"], 54 defaults: ["apexer_test_host_tools_list"], 55 dist: { 56 targets: ["sharedlibs_test"], 57 }, 58 srcs: [ 59 ":com.android.apex.test.baz", 60 "com.android.apex.test.baz.avbpubkey", 61 "com.android.apex.test.baz.pem", 62 "com.android.apex.test.baz.pk8", 63 "com.android.apex.test.baz.x509.pem", 64 ], 65 tools: [ 66 "shared_libs_repack", 67 ], 68 cmd: "$(location shared_libs_repack) " + 69 " --mode strip" + 70 " --key $(location com.android.apex.test.baz.pem)" + 71 " --input $(location :com.android.apex.test.baz)" + 72 " --output $(genDir)/com.android.apex.test.baz_stripped.apex" + 73 " --pk8key $(location com.android.apex.test.baz.pk8)" + 74 " --pubkey $(location com.android.apex.test.baz.avbpubkey)" + 75 " --x509key $(location com.android.apex.test.baz.x509.pem)" + 76 " --tmpdir $(genDir)", 77} 78