1//
2// Copyright (C) 2015 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_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21cc_defaults {
22    name: "gatekeeperd_defaults",
23    cflags: [
24        "-Wall",
25        "-Wextra",
26        "-Werror",
27        "-Wunused",
28    ],
29    srcs: [
30        "gatekeeperd.cpp",
31    ],
32    defaults: [
33        "keymint_use_latest_hal_aidl_ndk_shared",
34    ],
35    shared_libs: [
36        "libbinder",
37        "libbinder_ndk",
38        "libgatekeeper",
39        "libgsi",
40        "liblog",
41        "libhardware",
42        "libbase",
43        "libutils",
44        "libcrypto",
45        "libhidlbase",
46        "lib_android_keymaster_keymint_utils",
47        "android.hardware.gatekeeper-V1-ndk",
48        "android.hardware.gatekeeper@1.0",
49        "libgatekeeper_aidl",
50        "android.security.authorization-ndk",
51    ],
52
53    static_libs: ["libscrypt_static"],
54    include_dirs: ["external/scrypt/lib/crypto"],
55}
56
57cc_binary {
58    name: "gatekeeperd",
59    defaults: [
60        "gatekeeperd_defaults",
61    ],
62    srcs: [
63        "main.cpp",
64    ],
65    init_rc: ["gatekeeperd.rc"],
66}
67
68filegroup {
69    name: "gatekeeper_aidl",
70    srcs: [
71        "binder/android/service/gatekeeper/IGateKeeperService.aidl",
72    ],
73    path: "binder",
74}
75
76cc_library_shared {
77    name: "libgatekeeper_aidl",
78    srcs: [
79        ":gatekeeper_aidl",
80        "GateKeeperResponse.cpp",
81    ],
82    aidl: {
83        export_aidl_headers: true,
84        include_dirs: [
85            "system/core/gatekeeperd/binder",
86            "frameworks/base/core/java/",
87        ],
88    },
89    export_include_dirs: ["include"],
90    shared_libs: [
91        "libbase",
92        "libbinder",
93        "libcutils",
94        "liblog",
95        "libutils",
96    ],
97    export_shared_lib_headers: [
98        "libbinder",
99    ],
100}
101
102cc_fuzz {
103    name: "gatekeeperd_service_fuzzer",
104    defaults: [
105        "gatekeeperd_defaults",
106        "service_fuzzer_defaults"
107    ],
108    srcs: [
109        "fuzzer/GateKeeperServiceFuzzer.cpp",
110    ],
111    fuzz_config: {
112        cc: [
113            "subrahmanyaman@google.com",
114            "swillden@google.com",
115        ],
116    },
117}