# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. if (defined(ohos_lite)) { import("//build/lite/config/component/lite_component.gni") } else { import("//build/ohos.gni") } import("//foundation/distributedhardware/device_manager/device_manager.gni") if (defined(ohos_lite)) { if (ohos_kernel_type == "linux") { shared_library("devicemanagerserviceimpl") { include_dirs = [ "include", "include/ability", "include/adapter", "include/credential", "include/dependency/hichain", "include/dependency/softbus", "include/devicestate", "${common_path}/include", "${common_path}/include/ipc", "${common_path}/include/ipc/model", "${common_path}/include/dfx", "${common_path}/include/dfx/lite", "${devicemanager_path}/commondependency/include", "${innerkits_path}/native_cpp/include", "${devicemanager_path}/radar/include", "${utils_path}/include", "${utils_path}/include/appInfo/lite", "${utils_path}/include/crypto", "${utils_path}/include/fwkload/lite", "${utils_path}/include/timer/lite", "${json_path}/include", "${services_path}/include", "${services_path}/include/ipc/lite", "${interfaces_path}/c/ipc/include", "//foundation/communication/dsoftbus/interfaces/kits/bus_center", "//foundation/communication/dsoftbus/interfaces/inner_kits/transport", "//foundation/communication/dsoftbus/interfaces/kits/common", "//foundation/communication/dsoftbus/interfaces/kits/transport", "//foundation/distributedshedule/samgr_lite/interfaces/kits/samgr", "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include", "//commonlibrary/c_utils/base/include", "${softbuscache_parh}/include", ] sources = [ "${devicemanager_path}/commondependency/src/multiple_user_connector.cpp", "src/ability/lite/dm_ability_manager.cpp", "src/adapter/lite/dm_adapter_manager.cpp", "src/credential/dm_credential_manager.cpp", "src/dependency/hichain/hichain_auth_connector.cpp", "src/dependency/hichain/hichain_connector.cpp", "src/dependency/hichain/mine_hichain_connector.cpp", "src/dependency/softbus/softbus_connector.cpp", "src/device_manager_service_impl_lite.cpp", "src/devicestate/dm_device_state_manager.cpp", ] defines = [ "LITE_DEVICE", "DH_LOG_ENABLE", "DH_LOG_TAG=\"devicemanagerserviceimpl\"", "LOG_DOMAIN=0xD004110", ] deps = [ "${devicemanager_path}/radar:devicemanagerradar", "${json_path}:devicemanagerjson", "${softbuscache_parh}:dmdevicecache", "${utils_path}:devicemanagerutils", "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//base/security/device_auth/services:deviceauth_sdk", "//base/startup/init/interfaces/innerkits:libbegetutil", "//commonlibrary/utils_lite:utils", "//foundation/communication/dsoftbus:dsoftbus", "//foundation/systemabilitymgr/safwk_lite:safwk_lite", "//foundation/systemabilitymgr/samgr_lite/samgr:samgr", "//third_party/bounds_checking_function:libsec_shared", ] cflags = [ "-Wall", "-O2", "-Wdate-time", "-Wextra", "-Wfloat-equal", "-Wshadow", ] cflags_cc = cflags } } } else if (!support_jsapi) { group("devicemanagerserviceimpl") { deps = [] } } else { config("devicemanagerserviceimpl_config") { include_dirs = [ "include", "include/config", "include/adapter", "include/attest", "include/authentication", "include/authentication_v2", "include/ability", "include/credential", "include/cryptomgr", "include/devicestate", "include/dependency/commonevent", "include/dependency/deviceprofile", "include/dependency/multipleuser", "include/dependency/hichain", "include/dependency/softbus", "include/dependency/MSDP", "include/i18n", "${common_path}/include", "${common_path}/include/dfx", "${common_path}/include/dfx/standard", "${common_path}/include/ipc", "${common_path}/include/ipc/model", "${devicemanager_path}/commondependency/include", "${devicemanager_path}/radar/include", "${innerkits_path}/native_cpp/include", "${utils_path}/include", "${utils_path}/include/appInfo/standard", "${utils_path}/include/crypto", "${utils_path}/include/dfx", "${utils_path}/include/dfx/standard", "${utils_path}/include/fwkload/standard", "${utils_path}/include/permission/standard", "${utils_path}/include/timer", "${json_path}/include", "${services_path}/include", "${services_path}/include/ipc/standard", "${softbuscache_parh}/include", ] } ohos_shared_library("devicemanagerserviceimpl") { branch_protector_ret = "pac_ret" sanitize = { boundary_sanitize = true cfi = true cfi_cross_dso = true debug = false integer_overflow = true ubsan = true } cflags = [ "-Werror", "-fPIC", "-fstack-protector-strong", ] ldflags = [ "-Wl,-z,relro", "-Wl,-z,now", ] sources = [ "src/ability/standard/dm_ability_manager.cpp", "src/ability/standard/dm_dialog_manager.cpp", "src/adapter/standard/dm_adapter_manager.cpp", "src/attest/dm_auth_attest_common.cpp", "src/attest/dm_auth_cert.cpp", "src/authentication/auth_message_processor.cpp", "src/authentication/auth_request_state.cpp", "src/authentication/auth_response_state.cpp", "src/authentication/auth_ui_state_manager.cpp", "src/authentication/dm_auth_manager.cpp", "src/authentication_v2/auth_manager.cpp", "src/authentication_v2/auth_stages/auth_acl.cpp", "src/authentication_v2/auth_stages/auth_confirm.cpp", "src/authentication_v2/auth_stages/auth_credential.cpp", "src/authentication_v2/auth_stages/auth_negotiate.cpp", "src/authentication_v2/auth_stages/auth_pin_auth.cpp", "src/authentication_v2/dm_auth_context.cpp", "src/authentication_v2/dm_auth_manager_base.cpp", "src/authentication_v2/dm_auth_message_processor.cpp", "src/authentication_v2/dm_auth_state.cpp", "src/authentication_v2/dm_auth_state_machine.cpp", "src/authentication_v2/dm_negotiate_process.cpp", "src/authentication_v2/dm_freeze_process.cpp", "src/config/dm_config_manager.cpp", "src/credential/dm_credential_manager.cpp", "src/cryptomgr/crypto_mgr.cpp", "src/dependency/commonevent/dm_common_event_manager.cpp", "src/dependency/deviceprofile/dp_inited_callback.cpp", "src/dependency/hichain/hichain_auth_connector.cpp", "src/dependency/hichain/hichain_connector.cpp", "src/dependency/hichain/mine_hichain_connector.cpp", "src/dependency/softbus/softbus_connector.cpp", "src/dependency/softbus/softbus_session.cpp", "src/device_manager_service_impl.cpp", "src/devicestate/dm_device_state_manager.cpp", "src/i18n/dm_language_manager.cpp", ] public_configs = [ ":devicemanagerserviceimpl_config" ] defines = [ "HI_LOG_ENABLE", "DH_LOG_TAG=\"devicemanagerserviceimpl\"", "LOG_DOMAIN=0xD004110", ] deps = [ "${devicemanager_path}/commondependency:devicemanagerdependency", "${devicemanager_path}/radar:devicemanagerradar", "${innerkits_path}/native_cpp:devicemanagersdk", "${json_path}:devicemanagerjson", "${softbuscache_parh}:dmdevicecache", "${utils_path}:devicemanagerutils", ] external_deps = [ "ability_base:session_info", "ability_base:want", "ability_runtime:ability_connect_callback_stub", "ability_runtime:ability_manager", "access_token:libaccesstoken_sdk", "cJSON:cjson", "c_utils:utils", "common_event_service:cesfwk_innerkits", "device_auth:deviceauth_sdk", "device_info_manager:distributed_device_profile_common", "device_info_manager:distributed_device_profile_sdk", "dsoftbus:softbus_client", "dsoftbus:softbus_utils", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "mbedtls:mbedtls_shared", "openssl:libcrypto_shared", "os_account:libaccountkits", "os_account:os_account_innerkits", "power_manager:powermgr_client", "resource_management:resmgr_napi_core", "samgr:samgr_proxy", "zlib:shared_libz", ] if (support_screenlock && device_manager_feature_product == "default") { defines += [ "SUPPORT_SCREENLOCK" ] external_deps += [ "screenlock_mgr:screenlock_client" ] } if (device_manager_common) { defines += [ "DEVICE_MANAGER_COMMON_FLAG" ] } if (support_msdp) { sources += [ "src/dependency/MSDP/spatial_location_callback_impl.cpp" ] defines += [ "SUPPORT_MSDP" ] external_deps += [ "spatial_awareness:spatial_awareness_client" ] } subsystem_name = "distributedhardware" part_name = "device_manager" } }