• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021-2025 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("//base/security/device_auth/deviceauth_env.gni")
15
16group_auth_path = "${services_path}/legacy/group_auth"
17authenticators_path = "${services_path}/legacy/authenticators"
18protocol_path = "${services_path}/protocol"
19ext_plugin_manager_path = "${services_path}/ext_plugin_manager"
20group_data_manager_path = "${services_path}/data_manager/group_data_manager"
21cred_data_manager_path = "${services_path}/data_manager/cred_data_manager"
22cred_listener_path = "${services_path}/identity_service/listener"
23cred_session_path = "${services_path}/identity_service/session"
24privacy_enhancement_path = "${services_path}/privacy_enhancement"
25dev_frameworks_path = "${services_path}/frameworks"
26group_manager_path = "${services_path}/legacy/group_manager"
27session_manager_path = "${services_path}/session_manager"
28creds_manager_path = "${services_path}/legacy/creds_manager"
29mk_agree_path = "${services_path}/mk_agree"
30identity_manager_path = "${services_path}/legacy/identity_manager"
31identity_service_path = "${services_path}/identity_service"
32device_auth_common = "${services_path}/common"
33
34enable_broadcast = true
35deviceauth_defines = []
36
37identity_service_inc = [
38  "${identity_service_path}/inc",
39  "${cred_data_manager_path}/inc",
40  "${cred_listener_path}/inc",
41  "${cred_session_path}/inc",
42]
43identity_service_files = [
44  "${identity_service_path}/src/identity_service.c",
45  "${identity_service_path}/src/identity_operation.c",
46  "${identity_service_path}/src/identity_service_impl.c",
47  "${cred_data_manager_path}/src/credential_data_manager.c",
48  "${cred_data_manager_path}/src/cred_tlv_parser.c",
49  "${cred_listener_path}/src/cred_listener.c",
50  "${cred_session_path}/src/cred_session_util.c",
51]
52identity_service_mock_files = [
53  "${identity_service_path}/src/mock/identity_service_mock.c",
54  "${identity_service_path}/src/mock/identity_operation_mock.c",
55  "${cred_data_manager_path}/src/mock/credential_data_manager_mock.c",
56  "${cred_listener_path}/src/mock/cred_listener_mock.c",
57  "${cred_session_path}/src/mock/cred_session_util_mock.c",
58]
59
60inc_path = [
61  "${inner_api_path}",
62  "${device_auth_common}/inc",
63  "${services_path}/sa/inc/cache_common_event_handler",
64  "${services_path}/sa/inc/critical_handler",
65  "${services_path}/sa/inc/unload_handler",
66  "${frameworks_path}/inc",
67  "${ext_plugin_manager_path}/inc",
68  "${ext_plugin_manager_path}/inc/account_related",
69  "${group_data_manager_path}/inc",
70  "${privacy_enhancement_path}/inc",
71  "${group_auth_path}/inc",
72  "${group_auth_path}/inc/account_unrelated_group_auth",
73  "${group_auth_path}/inc/account_related_group_auth",
74  "${group_manager_path}/inc",
75  "${group_manager_path}/inc/broadcast_manager",
76  "${group_manager_path}/inc/callback_manager",
77  "${group_manager_path}/inc/channel_manager",
78  "${group_manager_path}/inc/channel_manager/soft_bus_channel",
79  "${dev_frameworks_path}/inc/",
80  "${dev_frameworks_path}/inc/module",
81  "${dev_frameworks_path}/inc/session",
82  "${dev_frameworks_path}/inc/os_account_adapter",
83  "${dev_frameworks_path}/inc/plugin_adapter",
84  "${dev_frameworks_path}/inc/task_manager",
85  "${dev_frameworks_path}/inc/security_label_adapter",
86  "${dev_frameworks_path}/inc/account_task_manager",
87  "${authenticators_path}/inc/account_related",
88  "${authenticators_path}/inc/account_related/auth/iso_auth_task",
89  "${authenticators_path}/inc/account_related/auth/pake_v2_auth_task",
90  "${authenticators_path}/inc/account_related/creds_manager",
91  "${authenticators_path}/inc/account_unrelated",
92  "${authenticators_path}/inc/account_unrelated/iso_task",
93  "${authenticators_path}/inc/account_unrelated/iso_task/iso_protocol_task",
94  "${authenticators_path}/inc/account_unrelated/iso_task/lite_exchange_task",
95  "${authenticators_path}/inc/account_unrelated/pake_task",
96  "${authenticators_path}/inc/account_unrelated/pake_task/pake_v1_task",
97  "${authenticators_path}/inc/account_unrelated/pake_task/pake_v2_task",
98  "${protocol_path}/inc",
99  "${protocol_path}/inc/pake_protocol",
100  "${protocol_path}/inc/pake_protocol/pake_v1_protocol",
101  "${protocol_path}/inc/pake_protocol/pake_v2_protocol",
102  "${protocol_path}/inc/pake_protocol/pake_protocol_dl_common",
103  "${protocol_path}/inc/pake_protocol/pake_protocol_ec_common",
104  "${protocol_path}/inc/iso_protocol",
105  "${session_manager_path}/inc",
106  "${session_manager_path}/inc/session",
107  "${session_manager_path}/inc/session/mini_session",
108  "${session_manager_path}/inc/session/v1",
109  "${session_manager_path}/inc/session/v1/compatible_bind_sub_session",
110  "${session_manager_path}/inc/session/v1/compatible_auth_sub_session",
111  "${session_manager_path}/inc/session/v2",
112  "${session_manager_path}/inc/session/v2/auth_sub_session",
113  "${session_manager_path}/inc/session/v2/auth_sub_session/protocol_lib",
114  "${session_manager_path}/inc/session/v2/expand_sub_session",
115  "${session_manager_path}/inc/session/v2/expand_sub_session/expand_process_lib",
116  "${creds_manager_path}/inc",
117  "${creds_manager_path}/inc/account_related",
118  "${mk_agree_path}/inc",
119]
120
121inc_path += identity_service_inc
122
123deviceauth_common_files = [
124  "${services_path}/device_auth.c",
125  "${device_auth_common}/src/hisysevent_common.c",
126  "${device_auth_common}/src/device_auth_common.c",
127  "${group_manager_path}/src/group_manager.c",
128  "${group_manager_path}/src/channel_manager/channel_manager.c",
129  "${group_manager_path}/src/callback_manager/callback_manager.c",
130  "${protocol_path}/src/protocol_common.c",
131  "${protocol_path}/src/iso_protocol/iso_protocol_common.c",
132  "${protocol_path}/src/pake_protocol/pake_common.c",
133  "${protocol_path}/src/pake_protocol/pake_v1_protocol/pake_v1_protocol_common.c",
134  "${protocol_path}/src/pake_protocol/pake_protocol_dl_common/pake_protocol_dl_common.c",
135  "${protocol_path}/src/pake_protocol/pake_protocol_ec_common/pake_protocol_ec_common.c",
136  "${protocol_path}/src/pake_protocol/pake_v2_protocol/pake_v2_protocol_common.c",
137]
138
139dev_frameworks_files = [
140  "${dev_frameworks_path}/src/module/dev_auth_module_manager.c",
141  "${dev_frameworks_path}/src/task_manager/task_manager.c",
142]
143
144os_account_adapter_files =
145    [ "${dev_frameworks_path}/src/os_account_adapter/os_account_adapter.cpp" ]
146
147os_account_adapter_mock_files = [ "${dev_frameworks_path}/src/os_account_adapter_mock/os_account_adapter_mock.cpp" ]
148
149security_label_adapter_files = [
150  "${dev_frameworks_path}/src/security_label_adapter/security_label_adapter.c",
151]
152
153security_label_adapter_mock_files = [ "${dev_frameworks_path}/src/security_label_adapter_mock/security_label_adapter_mock.c" ]
154
155permission_adapter_files =
156    [ "${dev_frameworks_path}/src/permission_adapter/permission_adapter.cpp" ]
157
158cache_common_event_handler_files =
159    [ "${services_path}/sa/src/cache_common_event_handler/cache_common_event_handler.cpp" ]
160cache_common_event_handler_mock_files =
161    [ "${services_path}/sa/src/cache_common_event_handler/mock/cache_common_event_handler_mock.cpp" ]
162critical_handler_files =
163    [ "${services_path}/sa/src/critical_handler/critical_handler.cpp" ]
164critical_handler_mock_files =
165    [ "${services_path}/sa/src/critical_handler/mock/critical_handler_mock.cpp" ]
166unload_handler_files =
167    [ "${services_path}/sa/src/unload_handler/unload_handler.cpp" ]
168unload_handler_mock_files =
169    [ "${services_path}/sa/src/unload_handler/mock/unload_handler_mock.cpp" ]
170sdk_load_on_demand_files =
171    [ "${frameworks_path}/sdk/sa_load_on_demand/src/sa_load_on_demand.cpp" ]
172sdk_load_on_demand_mock_files =
173    [ "${frameworks_path}/sdk/sa_load_on_demand/src/mock/sa_load_on_demand_mock.cpp" ]
174
175sa_load_on_demand_files = cache_common_event_handler_files + critical_handler_files
176sa_load_on_demand_mock_files = cache_common_event_handler_mock_files + critical_handler_mock_files + unload_handler_mock_files
177
178hiview_adapter_files = [
179  "${dev_frameworks_path}/src/hiview_adapter/hidump_adapter.c",
180  "${dev_frameworks_path}/src/hiview_adapter/hisysevent_adapter.cpp",
181  "${dev_frameworks_path}/src/hiview_adapter/hitrace_adapter.cpp",
182  "${dev_frameworks_path}/src/hiview_adapter/performance_dumper.c",
183]
184
185account_subscriber_files =
186    [ "${dev_frameworks_path}/src/account_subscriber/account_subscriber.cpp" ]
187
188sa_subscriber_files =
189    [ "${dev_frameworks_path}/src/sa_subscriber/sa_subscriber.cpp" ]
190
191net_observer_files =
192    [ "${dev_frameworks_path}/src/net_observer/net_observer.cpp" ]
193
194group_auth_files = [
195  "${group_auth_path}/src/group_auth_manager/group_auth_common/group_auth_data_operation.c",
196  "${group_auth_path}/src/group_auth_manager/group_auth_manager.c",
197]
198
199group_auth_account_unrelated_files = [ "${group_auth_path}/src/group_auth_manager/account_unrelated_group_auth/account_unrelated_group_auth.c" ]
200group_auth_account_unrelated_mock_files = [ "${group_auth_path}/src/group_auth_manager/account_unrelated_group_auth_mock/account_unrelated_group_auth_mock.c" ]
201group_auth_account_related_mock_files = [ "${group_auth_path}/src/group_auth_manager/account_related_group_auth_mock/account_related_group_auth_mock.c" ]
202
203account_related_cred_plugin_mock_files = [ "${ext_plugin_manager_path}/src/account_related_mock/account_related_cred_plugin_mock.c" ]
204
205account_auth_plugin_files = [ "${dev_frameworks_path}/src/plugin_adapter/ext_part/account_auth_plugin/account_auth_plugin_proxy.c" ]
206account_auth_plugin_mock_files = [ "${dev_frameworks_path}/src/plugin_adapter_mock/account_auth_plugin_proxy_mock.c" ]
207
208account_task_manager_files =
209    [ "${dev_frameworks_path}/src/account_task_manager/account_task_manager.c" ]
210account_task_manager_mock_files = [ "${dev_frameworks_path}/src/account_task_manager_mock/account_task_manager_mock.c" ]
211
212ext_plugin_manager_files =
213    [ "${ext_plugin_manager_path}/src/ext_plugin_manager.c" ]
214
215group_database_manager_files =
216    [ "${group_data_manager_path}/src/group_data_manager.c" ]
217
218privacy_enhancement_files =
219    [ "${privacy_enhancement_path}/src/pseudonym_manager.c" ]
220privacy_enhancement_mock_files =
221    [ "${privacy_enhancement_path}/src/mock/pseudonym_manager_mock.c" ]
222
223mk_agree_files = [
224  "${session_manager_path}/src/session/v2/expand_sub_session/expand_process_lib/mk_agree.c",
225  "${mk_agree_path}/src/key_manager.c",
226  "${mk_agree_path}/src/mk_agree_task.c",
227]
228
229mk_agree_mock_files = [
230  "${mk_agree_path}/src/mock/key_manager_mock.c",
231  "${mk_agree_path}/src/mock/mk_agree_task_mock.c",
232]
233
234group_manager_files = [
235  "${group_manager_path}/src/group_operation/group_operation.c",
236  "${group_manager_path}/src/group_operation/group_operation_common/group_operation_common.c",
237]
238
239session_manager_files = [
240  "${session_manager_path}/src/dev_session_mgr.c",
241  "${session_manager_path}/src/session/dev_session_fwk.c",
242]
243
244session_mini_files = [
245  "${session_manager_path}/src/session/mini_session/mini_session_manager.c",
246]
247
248session_v1_files = [
249  "${session_manager_path}/src/session/v1/compatible_sub_session.c",
250  "${session_manager_path}/src/session/v1/compatible_bind_sub_session/compatible_bind_sub_session.c",
251  "${session_manager_path}/src/session/v1/compatible_bind_sub_session/compatible_bind_sub_session_common.c",
252  "${session_manager_path}/src/session/v1/compatible_bind_sub_session/compatible_bind_sub_session_util.c",
253  "${session_manager_path}/src/session/v1/compatible_auth_sub_session/compatible_auth_sub_session.c",
254  "${session_manager_path}/src/session/v1/compatible_auth_sub_session/compatible_auth_sub_session_common.c",
255  "${session_manager_path}/src/session/v1/compatible_auth_sub_session/compatible_auth_sub_session_util.c",
256]
257
258session_v2_files = [
259  "${session_manager_path}/src/session/v2/dev_session_v2.c",
260  "${session_manager_path}/src/session/v2/dev_session_util.c",
261  "${session_manager_path}/src/session/v2/auth_sub_session/auth_sub_session.c",
262  "${session_manager_path}/src/session/v2/expand_sub_session/expand_sub_session.c",
263]
264session_v2_mock_files =
265    [ "${session_manager_path}/src/session/v2_mock/dev_session_v2_mock.c" ]
266
267session_mini_mock_files =
268    [ "${session_manager_path}/src/session/mini_mock/mini_session_mock.c" ]
269
270iso_protocol_files = [ "${session_manager_path}/src/session/v2/auth_sub_session/protocol_lib/iso_protocol.c" ]
271dl_speke_protocol_files = [ "${session_manager_path}/src/session/v2/auth_sub_session/protocol_lib/dl_speke_protocol.c" ]
272ec_speke_protocol_files = [ "${session_manager_path}/src/session/v2/auth_sub_session/protocol_lib/ec_speke_protocol.c" ]
273
274auth_code_import_files = [ "${session_manager_path}/src/session/v2/expand_sub_session/expand_process_lib/auth_code_import.c" ]
275pub_key_exchange_files = [ "${session_manager_path}/src/session/v2/expand_sub_session/expand_process_lib/pub_key_exchange.c" ]
276save_trusted_info_files = [ "${session_manager_path}/src/session/v2/expand_sub_session/expand_process_lib/save_trusted_info.c" ]
277
278creds_manager_files = [ "${creds_manager_path}/src/creds_manager.c" ]
279account_related_creds_manager_mock_files =
280    [ "${identity_manager_path}/src/mock/cert_operation_mock.c" ]
281
282group_manager_peer_to_peer_files = [ "${group_manager_path}/src/group_operation/peer_to_peer_group/peer_to_peer_group.c" ]
283group_manager_peer_to_peer_mock_files = [ "${group_manager_path}/src/group_operation/peer_to_peer_group_mock/peer_to_peer_group_mock.c" ]
284group_manager_identical_account_mock_files = [ "${group_manager_path}/src/group_operation/identical_account_group_mock/identical_account_group_mock.c" ]
285group_manager_across_account_mock_files = [ "${group_manager_path}/src/group_operation/across_account_group_mock/across_account_group_mock.c" ]
286
287authenticators_p2p_files = [
288  "${authenticators_path}/src/account_unrelated/common/das_task_common.c",
289  "${authenticators_path}/src/account_unrelated/das_module.c",
290  "${authenticators_path}/src/account_unrelated/common/das_version_util.c",
291  "${authenticators_path}/src/account_unrelated/das_task_main.c",
292  "${authenticators_path}/src/account_unrelated/pake_task/pake_task_common.c",
293  "${authenticators_path}/src/account_unrelated/pake_task/pake_message_util.c",
294]
295authenticators_p2p_mock_files =
296    [ "${authenticators_path}/src/account_unrelated_mock/das_module_mock.c" ]
297authenticators_account_related_mock_files =
298    [ "${authenticators_path}/src/account_related_mock/account_module_mock.c" ]
299authenticators_p2p_iso_files = [
300  "${authenticators_path}/src/account_unrelated/iso_task/iso_client_task.c",
301  "${authenticators_path}/src/account_unrelated/iso_task/iso_server_task.c",
302  "${authenticators_path}/src/account_unrelated/iso_task/iso_task_common/iso_task_common.c",
303  "${authenticators_path}/src/account_unrelated/iso_task/iso_task_main.c",
304  "${authenticators_path}/src/account_unrelated/iso_task/iso_protocol_task/iso_client_protocol_task.c",
305  "${authenticators_path}/src/account_unrelated/iso_task/iso_protocol_task/iso_server_protocol_task.c",
306  "${authenticators_path}/src/account_unrelated/creds_manager/das_lite_token_manager.c",
307  "${authenticators_path}/src/account_unrelated/iso_task/lite_exchange_task/iso_client_bind_exchange_task.c",
308  "${authenticators_path}/src/account_unrelated/iso_task/lite_exchange_task/iso_server_bind_exchange_task.c",
309]
310authenticators_p2p_iso_mock_files = [ "${authenticators_path}/src/account_unrelated/iso_task_mock/iso_task_main_mock.c" ]
311authenticators_p2p_pake_files = [
312  "${authenticators_path}/src/account_unrelated/pake_task/pake_v1_task/pake_v1_task_main.c",
313  "${authenticators_path}/src/account_unrelated/pake_task/pake_v1_task/pake_v1_client_task.c",
314  "${authenticators_path}/src/account_unrelated/pake_task/pake_v1_task/pake_v1_server_task.c",
315  "${authenticators_path}/src/account_unrelated/pake_task/pake_v1_task/pake_v1_protocol_task/pake_v1_client_protocol_task.c",
316  "${authenticators_path}/src/account_unrelated/pake_task/pake_v1_task/pake_v1_protocol_task/pake_v1_server_protocol_task.c",
317  "${authenticators_path}/src/account_unrelated/pake_task/pake_v1_task/pake_v1_protocol_task/pake_v1_protocol_task_common.c",
318
319  "${authenticators_path}/src/account_unrelated/pake_task/pake_v2_task_mock/pake_v2_task_main_mock.c",
320]
321authenticators_p2p_pake_mock_files = [
322  "${authenticators_path}/src/account_unrelated/pake_task/pake_v1_task_mock/pake_v1_task_main_mock.c",
323  "${authenticators_path}/src/account_unrelated/pake_task/pake_v2_task_mock/pake_v2_task_main_mock.c",
324]
325
326authenticators_standard_exchange_task_files = [
327  "${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task/common_standard_bind_exchange.c",
328  "${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task/standard_client_bind_exchange_task.c",
329  "${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task/standard_server_bind_exchange_task.c",
330  "${authenticators_path}/src/account_unrelated/creds_manager/das_standard_token_manager.c",
331  "${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task/standard_exchange_message_util.c",
332]
333authenticators_standard_exchange_task_mock_files = [ "${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task_mock/standard_exchange_task_mock.c" ]
334
335soft_bus_channel_files = [ "${group_manager_path}/src/channel_manager/soft_bus_channel/soft_bus_channel.c" ]
336soft_bus_channel_mock_files = [ "${group_manager_path}/src/channel_manager/soft_bus_channel_mock/soft_bus_channel_mock.c" ]
337
338broadcast_manager_files =
339    [ "${group_manager_path}/src/broadcast_manager/broadcast_manager.c" ]
340broadcast_manager_mock_files = [
341  "${group_manager_path}/src/broadcast_manager_mock/broadcast_manager_mock.c",
342]
343
344deviceauth_files = dev_frameworks_files + deviceauth_common_files +
345                   session_manager_files + creds_manager_files
346
347if (enable_pseudonym == true) {
348  deviceauth_defines += [ "ENABLE_PSEUDONYM" ]
349  deviceauth_files += privacy_enhancement_files
350  deviceauth_files += mk_agree_files
351} else {
352  deviceauth_files += privacy_enhancement_mock_files
353  deviceauth_files += mk_agree_mock_files
354}
355
356if (enable_p2p_bind_lite_protocol_check) {
357  deviceauth_defines += [ "ENABLE_P2P_BIND_LITE_PROTOCOL_CHECK" ]
358}
359
360if (enable_session_v2 == true) {
361  deviceauth_files += session_v2_files
362  if (enable_p2p_bind_lite_protocol) {
363    deviceauth_defines += [ "ENABLE_P2P_BIND_ISO" ]
364  }
365  if (enable_p2p_bind_dl_speke_protocol) {
366    deviceauth_files += dl_speke_protocol_files
367    deviceauth_defines += [ "ENABLE_P2P_BIND_DL_SPEKE" ]
368  }
369  if (enable_p2p_bind_standard_protocol) {
370    deviceauth_defines += [ "ENABLE_P2P_BIND_EC_SPEKE" ]
371  }
372  if (enable_p2p_auth_lite_protocol) {
373    deviceauth_defines += [ "ENABLE_P2P_AUTH_ISO" ]
374  }
375  if (enable_p2p_auth_standard_protocol) {
376    deviceauth_defines += [ "ENABLE_P2P_AUTH_EC_SPEKE" ]
377  }
378  if (enable_account || enable_p2p_bind_lite_protocol ||
379      enable_p2p_auth_lite_protocol) {
380    deviceauth_defines += [ "ENABLE_ISO" ]
381    deviceauth_files += iso_protocol_files
382    deviceauth_defines += [ "ENABLE_AUTH_CODE_IMPORT" ]
383    deviceauth_files += auth_code_import_files
384  }
385  if (enable_account || enable_p2p_bind_standard_protocol ||
386      enable_p2p_auth_standard_protocol) {
387    deviceauth_defines += [ "ENABLE_EC_SPEKE" ]
388    deviceauth_files += ec_speke_protocol_files
389    deviceauth_defines += [ "ENABLE_PUB_KEY_EXCHANGE" ]
390    deviceauth_files += pub_key_exchange_files
391  }
392  deviceauth_defines += [ "ENABLE_SAVE_TRUSTED_INFO" ]
393  deviceauth_files += save_trusted_info_files
394} else {
395  deviceauth_files += session_v2_mock_files
396}
397
398if (enable_session_mini == true) {
399  deviceauth_files += session_mini_files
400} else {
401  deviceauth_files += session_mini_mock_files
402}
403
404if (enable_session_v1 == true) {
405  deviceauth_files += session_v1_files
406}
407
408if (enable_p2p_pake_dl_prime_len_384 == true) {
409  deviceauth_defines += [ "P2P_PAKE_DL_PRIME_LEN_384" ]
410}
411if (enable_p2p_pake_dl_prime_len_256 == true) {
412  deviceauth_defines += [ "P2P_PAKE_DL_PRIME_LEN_256" ]
413}
414
415deviceauth_files += group_auth_files + group_manager_files +
416                    group_database_manager_files + ext_plugin_manager_files
417
418account_unrelated_deviceauth =
419    enable_p2p_bind_lite_protocol || enable_p2p_auth_lite_protocol ||
420    enable_p2p_bind_standard_protocol || enable_p2p_auth_standard_protocol
421
422if (account_unrelated_deviceauth == true) {
423  deviceauth_files +=
424      group_auth_account_unrelated_files + group_manager_peer_to_peer_files
425} else {
426  deviceauth_files += group_auth_account_unrelated_mock_files +
427                      group_manager_peer_to_peer_mock_files
428}
429
430if (account_unrelated_deviceauth == true) {
431  deviceauth_files += authenticators_p2p_files
432} else {
433  deviceauth_files += authenticators_p2p_mock_files
434}
435
436if (enable_p2p_bind_lite_protocol || enable_p2p_auth_lite_protocol) {
437  deviceauth_files += authenticators_p2p_iso_files
438} else {
439  deviceauth_files += authenticators_p2p_iso_mock_files
440}
441
442if (enable_p2p_bind_standard_protocol == true ||
443    enable_p2p_auth_standard_protocol == true) {
444  deviceauth_defines += [ "P2P_PAKE_EC_TYPE" ]
445  deviceauth_files += authenticators_p2p_pake_files
446} else {
447  deviceauth_files += authenticators_p2p_pake_mock_files
448}
449
450if (enable_p2p_auth_standard_protocol == true) {
451  deviceauth_files += authenticators_standard_exchange_task_files
452} else {
453  deviceauth_files += authenticators_standard_exchange_task_mock_files
454}
455
456if (enable_account == true) {
457  import("//base/security/device_auth/services/deviceauth_account.gni")
458  deviceauth_defines += account_related_defines
459  inc_path += account_related_inc_path
460  deviceauth_files += account_related_files
461} else {
462  deviceauth_files += group_auth_account_related_mock_files +
463                      group_manager_identical_account_mock_files +
464                      group_manager_across_account_mock_files +
465                      authenticators_account_related_mock_files +
466                      account_related_cred_plugin_mock_files +
467                      account_related_creds_manager_mock_files
468}
469
470if (device_auth_enable_run_on_demand_qos == true) {
471  deviceauth_defines += [ "DEVAUTH_ENABLE_RUN_ON_DEMAND_QOS" ]
472}
473
474if (enable_extend_plugin) {
475  deviceauth_files += account_auth_plugin_files
476  deviceauth_files += account_task_manager_files
477} else {
478  deviceauth_files += account_auth_plugin_mock_files
479  deviceauth_files += account_task_manager_mock_files
480}
481
482if (device_auth_enable_soft_bus_channel == true) {
483  deviceauth_files += soft_bus_channel_files
484} else {
485  deviceauth_files += soft_bus_channel_mock_files
486}
487
488if (enable_broadcast == true) {
489  deviceauth_files += broadcast_manager_files
490} else {
491  deviceauth_files += broadcast_manager_mock_files
492}
493
494if (!defined(ohos_lite) && (!defined(global_parts_info) ||
495                            defined(global_parts_info.account_os_account))) {
496  deviceauth_files += os_account_adapter_files
497  support_os_account = true
498} else {
499  deviceauth_files += os_account_adapter_mock_files
500  support_os_account = false
501}
502
503if (defined(global_parts_info) &&
504    defined(global_parts_info.notification_common_event_service)) {
505  common_event_enabled = true
506} else {
507  common_event_enabled = false
508}
509
510if (defined(global_parts_info) &&
511    defined(global_parts_info.resourceschedule_memmgr_override)) {
512  timeline_memmgr_enable = true
513} else {
514  timeline_memmgr_enable = false
515}
516
517if (defined(global_parts_info) &&
518    defined(global_parts_info.notification_eventhandler)) {
519  event_handler_enabled = true
520} else {
521  event_handler_enabled = false
522}
523
524if (defined(ohos_lite)) {
525  deviceauth_files += security_label_adapter_mock_files
526} else {
527  deviceauth_files += security_label_adapter_files
528}
529
530if (target_os == "linux") {
531  build_flags += [ "-D__LINUX__" ]
532}
533
534ipc_src_suffix = "cpp"
535ipc_adapt_path = "standard"
536if (defined(ohos_lite)) {
537  ipc_src_suffix = "c"
538  ipc_adapt_path = "lite"
539}
540
541deviceauth_ipc_files = [
542  "${frameworks_path}/src/${ipc_adapt_path}/ipc_adapt.${ipc_src_suffix}",
543  "${frameworks_path}/src/${ipc_adapt_path}/ipc_dev_auth_proxy.${ipc_src_suffix}",
544  "${frameworks_path}/src/${ipc_adapt_path}/ipc_dev_auth_stub.${ipc_src_suffix}",
545  "${frameworks_path}/src/${ipc_adapt_path}/ipc_callback_proxy.${ipc_src_suffix}",
546  "${frameworks_path}/src/${ipc_adapt_path}/ipc_callback_stub.${ipc_src_suffix}",
547]
548
549identity_manager_inc = [ "${identity_manager_path}/inc" ]
550
551declare_args() {
552  identity_manager_files = []
553}
554
555if (enable_session_v2 == true) {
556  identity_manager_files = [
557    "${identity_manager_path}/src/identity_manager.c",
558    "${identity_manager_path}/src/credential_operator.c",
559    "${identity_manager_path}/src/identity_common.c",
560    "${identity_manager_path}/src/identity_group.c",
561    "${identity_manager_path}/src/identity_p2p.c",
562    "${identity_manager_path}/src/identity_pin.c",
563  ]
564  if (enable_identity_service) {
565    identity_manager_files += [ "${identity_manager_path}/src/identity_cred.c" ]
566  } else {
567    identity_manager_files +=
568        [ "${identity_manager_path}/src/mock/identity_cred_mock.c" ]
569  }
570} else {
571  identity_manager_files = [
572    "${identity_manager_path}/src/mock/identity_manager_mock.c",
573    "${identity_manager_path}/src/mock/identity_common_mock.c",
574  ]
575}
576