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    "${app_domain_verify_frameworks_common_path}/include/dfx",
33  ]
34  configs = [ "//build/config/compiler:exceptions" ]
35  ldflags = [ "-Wl,--exclude-libs=ALL" ]
36  cflags = [
37    "-fvisibility=hidden",
38    "-fdata-sections",
39    "-ffunction-sections",
40    "-fstack-protector-strong",
41    "-D_FORTIFY_SOURCE=2",
42    "-Os",
43  ]
44
45  cflags_cc = [
46    "-fvisibility-inlines-hidden",
47    "-Os",
48  ]
49}
50
51ohos_shared_library("app_domain_verify_mgr_service") {
52  branch_protector_ret = "pac_ret"
53  sources = [
54    "${app_domain_verify_frameworks_common_path}/src/config/white_list_config_mgr.cpp",
55    "${app_domain_verify_frameworks_common_path}/src/utils/domain_url_util.cpp",
56    "src/manager/core/app_domain_verify_data_mgr.cpp",
57    "src/manager/core/app_domain_verify_mgr_service.cpp",
58    "src/manager/permission/permission_manager.cpp",
59    "src/manager/rdb/app_domain_verify_rdb_data_manager.cpp",
60    "src/manager/rdb/app_domain_verify_rdb_open_callback.cpp",
61    "src/manager/rdb/rdb_migrate_mgr.cpp",
62    "src/manager/zidl/app_domain_verify_mgr_service_proxy.cpp",
63    "src/manager/zidl/app_domain_verify_mgr_service_stub.cpp",
64  ]
65  public_configs = [ ":app_domain_verify_service_config" ]
66  deps = [
67    "${app_domain_verify_client_path}:app_domain_verify_agent_client",
68    "${app_domain_verify_common_path}:app_domain_verify_common",
69  ]
70  defines = [ "API_EXPORT=__attribute__((visibility (\"default\")))" ]
71  if (build_variant == "user") {
72    defines += [ "IS_RELEASE_VERSION" ]
73  }
74  external_deps = [
75    "ability_base:base",
76    "ability_base:want",
77    "ability_base:zuri",
78    "ability_runtime:ability_manager",
79    "access_token:libaccesstoken_sdk",
80    "access_token:libtokenid_sdk",
81    "bundle_framework:appexecfwk_base",
82    "bundle_framework:appexecfwk_core",
83    "c_utils:utils",
84    "eventhandler:libeventhandler",
85    "ffrt:libffrt",
86    "hilog:libhilog",
87    "hisysevent:libhisysevent",
88    "ipc:ipc_core",
89    "json:nlohmann_json_static",
90    "preferences:native_preferences",
91    "relational_store:native_rdb",
92    "safwk:system_ability_fwk",
93    "samgr:samgr_proxy",
94  ]
95
96  sanitize = {
97    cfi = true
98    cfi_cross_dso = true
99    debug = false
100  }
101  subsystem_name = "bundlemanager"
102  part_name = "app_domain_verify"
103}
104
105config("app_domain_verify_agent_service_config") {
106  visibility = [ ":*" ]
107  include_dirs = [
108    "${app_domain_verify_client_path}/include",
109    "include/agent/core",
110    "include/agent/zidl",
111    "include/manager/core",
112    "include/manager/zidl",
113    "include/manager/rdb",
114    "${app_domain_verify_common_path}/include",
115    "${app_domain_verify_common_path}/include/zidl",
116    "${app_domain_verify_frameworks_common_path}/include",
117    "${app_domain_verify_frameworks_common_path}/include/utils",
118    "${app_domain_verify_frameworks_common_path}/include/bms",
119    "${app_domain_verify_frameworks_common_path}/include/config",
120    "${app_domain_verify_frameworks_extension_path}/include",
121    "${app_domain_verify_frameworks_verifier_path}/include",
122    "${app_domain_verify_frameworks_common_path}/include/dfx",
123  ]
124  configs = [ "//build/config/compiler:exceptions" ]
125  ldflags = [ "-Wl,--exclude-libs=ALL" ]
126  cflags = [
127    "-fvisibility=hidden",
128    "-fdata-sections",
129    "-ffunction-sections",
130    "-fstack-protector-strong",
131    "-D_FORTIFY_SOURCE=2",
132    "-Os",
133  ]
134
135  cflags_cc = [
136    "-fvisibility-inlines-hidden",
137    "-Os",
138  ]
139}
140
141ohos_shared_library("app_domain_verify_agent_service") {
142  branch_protector_ret = "pac_ret"
143  sources = [
144    "src/agent/core/app_domain_verify_agent_service.cpp",
145    "src/agent/zidl/app_domain_verify_agent_service_proxy.cpp",
146    "src/agent/zidl/app_domain_verify_agent_service_stub.cpp",
147  ]
148  public_configs = [ ":app_domain_verify_agent_service_config" ]
149  defines = [ "API_EXPORT=__attribute__((visibility (\"default\")))" ]
150  if (build_variant == "user") {
151    defines += [ "IS_RELEASE_VERSION" ]
152  }
153  deps = [
154    "${app_domain_verify_client_path}:app_domain_verify_mgr_client",
155    "${app_domain_verify_common_path}:app_domain_verify_common",
156    "${app_domain_verify_frameworks_common_path}:app_domain_verify_frameworks_common",
157    "${app_domain_verify_frameworks_extension_path}:app_domain_verify_extension_framework",
158    "${app_domain_verify_frameworks_verifier_path}:app_domain_verify_agent_verifier",
159  ]
160
161  external_deps = [
162    "ability_base:base",
163    "ability_base:want",
164    "ability_base:zuri",
165    "ability_runtime:ability_manager",
166    "bundle_framework:appexecfwk_core",
167    "c_utils:utils",
168    "curl:curl_shared",
169    "eventhandler:libeventhandler",
170    "ffrt:libffrt",
171    "hicollie:libhicollie",
172    "hilog:libhilog",
173    "hisysevent:libhisysevent",
174    "ipc:ipc_core",
175    "json:nlohmann_json_static",
176    "netmanager_base:net_conn_manager_if",
177    "netstack:http_client",
178    "os_account:os_account_innerkits",
179    "preferences:native_preferences",
180    "safwk:system_ability_fwk",
181    "samgr:samgr_proxy",
182  ]
183
184  sanitize = {
185    cfi = true
186    cfi_cross_dso = true
187    debug = false
188  }
189  subsystem_name = "bundlemanager"
190  part_name = "app_domain_verify"
191}
192