1// Copyright (C) 2018 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// Defaults shared between real and test versions of the APEX.
16package {
17    // See: http://go/android-license-faq
18    // A large-scale-change added 'default_applicable_licenses' to import
19    // all of the 'license_kinds' from "external_conscrypt_license"
20    // to get the below license kinds:
21    //   SPDX-license-identifier-Apache-2.0
22    default_applicable_licenses: ["external_conscrypt_license"],
23}
24
25apex_defaults {
26    name: "com.android.conscrypt-defaults",
27    updatable: true,
28    androidManifest: ":com.android.conscrypt-androidManifest",
29    compile_multilib: "both",
30    bootclasspath_fragments: ["com.android.conscrypt-bootclasspath-fragment"],
31    jni_libs: ["libjavacrypto"],
32    prebuilts: ["current_sdkinfo"],
33    multilib: {
34        both: {
35            binaries: ["boringssl_self_test"],
36        },
37    },
38    key: "apex.conscrypt.key",
39    certificate: ":com.android.conscrypt.certificate",
40
41    // IMPORTANT: For the APEX to be installed on Android 10,
42    // min_sdk_version should be 29. This enables the build system to make
43    // sure the package compatible to Android 10 in two ways:
44    // - build the APEX package compatible to Android 10
45    //   so that the package can be installed.
46    // - build artifacts (lib/javalib/bin) against Android 10 SDK
47    //   so that the artifacts can run.
48    min_sdk_version: "29",
49}
50
51filegroup {
52    name: "com.android.conscrypt-androidManifest",
53    srcs: ["AndroidManifest.xml"],
54}
55
56apex_key {
57    name: "apex.conscrypt.key",
58    public_key: "com.android.conscrypt.avbpubkey",
59    private_key: "com.android.conscrypt.pem",
60}
61
62android_app_certificate {
63    name: "com.android.conscrypt.certificate",
64    certificate: "com.android.conscrypt",
65}
66
67prebuilt_etc {
68    name: "com.android.conscrypt.ld.config.txt",
69    src: "ld.config.txt",
70    filename: "ld.config.txt",
71    installable: false,
72}
73
74// Production APEX
75apex {
76    name: "com.android.conscrypt",
77    visibility: [
78        "//vendor:__subpackages__",
79    ],
80    defaults: ["com.android.conscrypt-defaults"],
81    manifest: "apex_manifest.json",
82    binaries: ["boringssl_self_test"],
83    prebuilts: ["com.android.conscrypt.ld.config.txt"],
84}
85
86// Encapsulate the contributions made by the com.android.conscrypt to the bootclasspath.
87bootclasspath_fragment {
88    name: "com.android.conscrypt-bootclasspath-fragment",
89    contents: ["conscrypt"],
90    apex_available: ["com.android.conscrypt"],
91    // The bootclasspath_fragments that provide APIs on which this depends.
92    fragments: [
93        {
94            apex: "com.android.art",
95            module: "art-bootclasspath-fragment",
96        },
97    ],
98    // The APIs provided by this fragment.
99    api: {
100        stub_libs: [
101            "conscrypt.module.public.api",
102        ],
103    },
104    // The core platform APIs provided by this fragment.
105    core_platform_api: {
106        stub_libs: [
107            "conscrypt.module.platform.api",
108        ],
109    },
110    // Additional hidden API flags that override the default flags derived
111    // from the api stub libraries.
112    hidden_api: {
113        max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"],
114    },
115}
116