1# Copyright (C) 2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//foundation/bundlemanager/app_domain_verify/app_domain_verify.gni")
16
17config("app_domain_verify_service_config") {
18  visibility = [ ":*" ]
19  include_dirs = [
20    "${app_domain_verify_client_path}/include",
21    "include/manager/constant",
22    "include/manager/core",
23    "include/manager/rdb",
24    "include/manager/zidl",
25    "include/manager/permission",
26    "include/agent/core",
27    "${app_domain_verify_common_path}/include",
28    "${app_domain_verify_common_path}/include/zidl",
29    "${app_domain_verify_frameworks_common_path}/include",
30    "${app_domain_verify_frameworks_common_path}/include/utils",
31    "${app_domain_verify_frameworks_common_path}/include/config",
32  ]
33  configs = [ "//build/config/compiler:exceptions" ]
34  ldflags = [ "-Wl,--exclude-libs=ALL" ]
35  cflags = [
36    "-fvisibility=hidden",
37    "-fdata-sections",
38    "-ffunction-sections",
39    "-Os",
40  ]
41
42  cflags_cc = [
43    "-fvisibility-inlines-hidden",
44    "-Os",
45  ]
46}
47
48ohos_shared_library("app_domain_verify_mgr_service") {
49  branch_protector_ret = "pac_ret"
50  sources = [
51    "${app_domain_verify_frameworks_common_path}/src/config/white_list_config_mgr.cpp",
52    "${app_domain_verify_frameworks_common_path}/src/utils/domain_url_util.cpp",
53    "src/manager/core/app_domain_verify_data_mgr.cpp",
54    "src/manager/core/app_domain_verify_mgr_service.cpp",
55    "src/manager/permission/permission_manager.cpp",
56    "src/manager/rdb/app_domain_verify_rdb_data_manager.cpp",
57    "src/manager/rdb/app_domain_verify_rdb_open_callback.cpp",
58    "src/manager/rdb/rdb_migrate_mgr.cpp",
59    "src/manager/zidl/app_domain_verify_mgr_service_proxy.cpp",
60    "src/manager/zidl/app_domain_verify_mgr_service_stub.cpp",
61  ]
62  public_configs = [ ":app_domain_verify_service_config" ]
63  deps = [
64    "${app_domain_verify_client_path}:app_domain_verify_agent_client",
65    "${app_domain_verify_common_path}:app_domain_verify_common",
66  ]
67  defines = [ "API_EXPORT=__attribute__((visibility (\"default\")))" ]
68  if (build_variant == "user") {
69    defines += [ "IS_RELEASE_VERSION" ]
70  }
71  external_deps = [
72    "ability_base:base",
73    "ability_base:want",
74    "ability_base:zuri",
75    "ability_runtime:ability_manager",
76    "access_token:libaccesstoken_sdk",
77    "access_token:libtokenid_sdk",
78    "bundle_framework:appexecfwk_base",
79    "bundle_framework:appexecfwk_core",
80    "c_utils:utils",
81    "eventhandler:libeventhandler",
82    "ffrt:libffrt",
83    "hilog:libhilog",
84    "hisysevent:libhisysevent",
85    "ipc:ipc_core",
86    "json:nlohmann_json_static",
87    "preferences:native_preferences",
88    "relational_store:native_rdb",
89    "safwk:system_ability_fwk",
90    "samgr:samgr_proxy",
91  ]
92
93  sanitize = {
94    cfi = true
95    cfi_cross_dso = true
96    debug = false
97  }
98  subsystem_name = "bundlemanager"
99  part_name = "app_domain_verify"
100}
101
102config("app_domain_verify_agent_service_config") {
103  visibility = [ ":*" ]
104  include_dirs = [
105    "${app_domain_verify_client_path}/include",
106    "include/agent/data_share",
107    "include/agent/core",
108    "include/agent/zidl",
109    "include/manager/core",
110    "include/manager/zidl",
111    "include/manager/rdb",
112    "${app_domain_verify_common_path}/include",
113    "${app_domain_verify_common_path}/include/zidl",
114    "${app_domain_verify_frameworks_common_path}/include",
115    "${app_domain_verify_frameworks_common_path}/include/utils",
116    "${app_domain_verify_frameworks_common_path}/include/bms",
117    "${app_domain_verify_frameworks_common_path}/include/config",
118    "${app_domain_verify_frameworks_extension_path}/include",
119    "${app_domain_verify_frameworks_verifier_path}/include",
120  ]
121  configs = [ "//build/config/compiler:exceptions" ]
122  ldflags = [ "-Wl,--exclude-libs=ALL" ]
123  cflags = [
124    "-fvisibility=hidden",
125    "-fdata-sections",
126    "-ffunction-sections",
127    "-Os",
128  ]
129
130  cflags_cc = [
131    "-fvisibility-inlines-hidden",
132    "-Os",
133  ]
134}
135
136ohos_shared_library("app_domain_verify_agent_service") {
137  branch_protector_ret = "pac_ret"
138  sources = [
139    "src/agent/core/app_domain_verify_agent_service.cpp",
140    "src/agent/data_share/setting_data_share_helper.cpp",
141    "src/agent/zidl/app_domain_verify_agent_service_proxy.cpp",
142    "src/agent/zidl/app_domain_verify_agent_service_stub.cpp",
143  ]
144  public_configs = [ ":app_domain_verify_agent_service_config" ]
145  defines = [ "API_EXPORT=__attribute__((visibility (\"default\")))" ]
146  if (build_variant == "user") {
147    defines += [ "IS_RELEASE_VERSION" ]
148  }
149  deps = [
150    "${app_domain_verify_client_path}:app_domain_verify_mgr_client",
151    "${app_domain_verify_common_path}:app_domain_verify_common",
152    "${app_domain_verify_frameworks_common_path}:app_domain_verify_frameworks_common",
153    "${app_domain_verify_frameworks_extension_path}:app_domain_verify_extension_framework",
154    "${app_domain_verify_frameworks_verifier_path}:app_domain_verify_agent_verifier",
155  ]
156
157  external_deps = [
158    "ability_base:base",
159    "ability_base:want",
160    "ability_base:zuri",
161    "ability_runtime:ability_manager",
162    "bundle_framework:appexecfwk_core",
163    "c_utils:utils",
164    "curl:curl_shared",
165    "data_share:datashare_consumer",
166    "eventhandler:libeventhandler",
167    "ffrt:libffrt",
168    "hicollie:libhicollie",
169    "hilog:libhilog",
170    "hisysevent:libhisysevent",
171    "ipc:ipc_core",
172    "json:nlohmann_json_static",
173    "netmanager_base:net_conn_manager_if",
174    "netstack:http_client",
175    "os_account:os_account_innerkits",
176    "preferences:native_preferences",
177    "safwk:system_ability_fwk",
178    "samgr:samgr_proxy",
179  ]
180
181  sanitize = {
182    cfi = true
183    cfi_cross_dso = true
184    debug = false
185  }
186  subsystem_name = "bundlemanager"
187  part_name = "app_domain_verify"
188}
189