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