diff --git a/0002-device-manager-only-support-for-network.patch b/0002-device-manager-only-support-for-network.patch new file mode 100644 index 0000000000000000000000000000000000000000..531df59913d28e28b1b167f5a0d2f715895c31a8 --- /dev/null +++ b/0002-device-manager-only-support-for-network.patch @@ -0,0 +1,55 @@ +From 62b2759508a22df2ce28dea46a20e8f87bf46337 Mon Sep 17 00:00:00 2001 +From: tianhang +Date: Tue, 26 Sep 2023 13:42:14 +0800 +Subject: [PATCH] only support network coap + +--- + .../src/dependency/softbus/softbus_connector.cpp | 2 +- + services/service/src/softbus/softbus_listener.cpp | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/services/implementation/src/dependency/softbus/softbus_connector.cpp b/services/implementation/src/dependency/softbus/softbus_connector.cpp +index 6640fff..4c655e2 100644 +--- a/services/implementation/src/dependency/softbus/softbus_connector.cpp ++++ b/services/implementation/src/dependency/softbus/softbus_connector.cpp +@@ -135,7 +135,7 @@ int32_t SoftbusConnector::PublishDiscovery(const DmPublishInfo &dmPublishInfo) + (void)memset_s(&publishInfo, sizeof(PublishInfo), 0, sizeof(PublishInfo)); + publishInfo.publishId = dmPublishInfo.publishId; + publishInfo.mode = (DiscoverMode)dmPublishInfo.mode; +- publishInfo.medium = ExchangeMedium::AUTO; ++ publishInfo.medium = ExchangeMedium::COAP; + publishInfo.freq = (ExchangeFreq)dmPublishInfo.freq; + publishInfo.capability = DM_CAPABILITY_OSD; + publishInfo.ranging = dmPublishInfo.ranging; +diff --git a/services/service/src/softbus/softbus_listener.cpp b/services/service/src/softbus/softbus_listener.cpp +index b882271..b4d36b5 100644 +--- a/services/service/src/softbus/softbus_listener.cpp ++++ b/services/service/src/softbus/softbus_listener.cpp +@@ -100,7 +100,7 @@ void SoftbusListener::SetPublishInfo(PublishInfo &dmPublishInfo) + { + dmPublishInfo.publishId = DISTRIBUTED_HARDWARE_DEVICEMANAGER_SA_ID; + dmPublishInfo.mode = DiscoverMode::DISCOVER_MODE_ACTIVE; +- dmPublishInfo.medium = ExchangeMedium::AUTO; ++ dmPublishInfo.medium = ExchangeMedium::COAP; + dmPublishInfo.freq = ExchangeFreq::HIGH; + dmPublishInfo.capability = DM_CAPABILITY_OSD; + dmPublishInfo.ranging = false; +@@ -288,7 +288,7 @@ void SoftbusListener::OnParameterChgCallback(const char *key, const char *value, + (void)memset_s(&dmPublishInfo, sizeof(PublishInfo), 0, sizeof(PublishInfo)); + dmPublishInfo.publishId = DISTRIBUTED_HARDWARE_DEVICEMANAGER_SA_ID; + dmPublishInfo.mode = DiscoverMode::DISCOVER_MODE_ACTIVE; +- dmPublishInfo.medium = ExchangeMedium::AUTO; ++ dmPublishInfo.medium = ExchangeMedium::COAP; + dmPublishInfo.freq = ExchangeFreq::HIGH; + dmPublishInfo.capability = DM_CAPABILITY_OSD; + dmPublishInfo.ranging = false; +@@ -331,4 +331,4 @@ void SoftbusListener::OnSoftbusDeviceInfoChanged(NodeBasicInfoType type, NodeBas + LOGD("SoftbusListener::OnSoftbusDeviceInfoChanged."); + } + } // namespace DistributedHardware +-} // namespace OHOS +\ No newline at end of file ++} // namespace OHOS +-- +2.33.0 + diff --git a/0003-enable-pincode-for-device-manager.patch b/0003-enable-pincode-for-device-manager.patch new file mode 100644 index 0000000000000000000000000000000000000000..9de2c506bbac0cd723093c1e0ba933d636f3eedc --- /dev/null +++ b/0003-enable-pincode-for-device-manager.patch @@ -0,0 +1,2074 @@ +From 98813a6febc30eb280194ee647f9d9665f4d44c4 Mon Sep 17 00:00:00 2001 +From: tianhang +Date: Tue, 26 Mar 2024 18:59:30 +0800 +Subject: [PATCH] enable pincode for device manager + +--- + bundle.json | 3 - + common/include/ipc/ipc_def.h | 2 + + .../ipc/model/ipc_set_auth_pincode_req.h | 43 +++++ + common/src/dfx/standard/dm_hisysevent.cpp | 1 - + common/src/dfx/standard/dm_hitrace.cpp | 2 - + ext/BUILD.gn | 4 +- + ext/no_interaction_auth/BUILD.gn | 140 +++++++------- + ext/pin_auth/BUILD.gn | 4 +- + .../include/ability/dm_ability_manager.h | 4 +- + ext/pin_auth/include/pin_auth.h | 4 +- + ext/pin_auth/include/standard/pin_auth_ui.h | 4 +- + ext/pin_auth/src/pin_auth.cpp | 93 +++++----- + ext/pin_auth/src/standard/pin_auth_ui.cpp | 90 ++++----- + interfaces/inner_kits/native_cpp/BUILD.gn | 4 + + .../native_cpp/include/device_manager.h | 7 + + .../include/device_manager_callback.h | 9 + + .../native_cpp/include/device_manager_impl.h | 8 + + .../native_cpp/include/dm_publish_info.h | 1 + + .../native_cpp/include/dm_subscribe_info.h | 1 + + .../include/notify/device_manager_notify.h | 7 + + .../native_cpp/src/device_manager_impl.cpp | 54 +++++- + .../src/ipc/standard/ipc_cmd_parser.cpp | 32 ++++ + .../src/notify/device_manager_notify.cpp | 36 ++++ + interfaces/kits/BUILD.gn | 6 +- + interfaces/kits/js/BUILD.gn | 2 +- + services/implementation/BUILD.gn | 16 +- + .../include/authentication/dm_auth_manager.h | 1 + + .../include/device_manager_service_impl.h | 6 +- + .../ability/standard/dm_ability_manager.cpp | 26 +-- + .../authentication/auth_message_processor.cpp | 2 + + .../src/authentication/dm_auth_manager.cpp | 63 +++++-- + .../src/device_manager_service_impl.cpp | 50 +++-- + services/service/BUILD.gn | 16 +- + .../service/include/device_manager_service.h | 2 + + .../include/device_manager_service_listener.h | 2 + + .../include/idevice_manager_service_impl.h | 2 + + .../idevice_manager_service_listener.h | 2 + + .../service/src/device_manager_service.cpp | 13 ++ + .../src/device_manager_service_listener.cpp | 14 ++ + .../src/ipc/lite/ipc_server_listener.cpp | 172 +++++++++--------- + .../src/ipc/standard/ipc_cmd_parser.cpp | 35 ++++ + test/BUILD.gn | 4 +- + .../dmcommoneventmanager_fuzzer/BUILD.gn | 2 +- + .../dmdiscoverymanager_fuzzer/BUILD.gn | 2 +- + test/fuzztest/pinauth_fuzzer/BUILD.gn | 2 +- + test/fuzztest/pinauthui_fuzzer/BUILD.gn | 2 +- + test/unittest/BUILD.gn | 26 +-- + test/unittest/UTTest_dm_dfx.h | 2 +- + utils/BUILD.gn | 12 +- + .../standard/permission_manager.cpp | 103 +++++------ + 50 files changed, 730 insertions(+), 408 deletions(-) + create mode 100644 common/include/ipc/model/ipc_set_auth_pincode_req.h + +diff --git a/bundle.json b/bundle.json +index bee412cb..6c9457a8 100644 +--- a/bundle.json ++++ b/bundle.json +@@ -78,9 +78,6 @@ + "header_base": "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/include" + } + } +- ], +- "test": [ +- "//foundation/distributedhardware/device_manager:device_manager_test" + ] + } + } +diff --git a/common/include/ipc/ipc_def.h b/common/include/ipc/ipc_def.h +index 436eecc1..88e418f9 100644 +--- a/common/include/ipc/ipc_def.h ++++ b/common/include/ipc/ipc_def.h +@@ -66,6 +66,8 @@ enum IpcCmdID { + REGISTER_CREDENTIAL_CALLBACK, + UNREGISTER_CREDENTIAL_CALLBACK, + NOTIFY_EVENT, ++ SET_AUTH_PINCODE, ++ GENERATE_PINCODE, + // Add ipc msg here + IPC_MSG_BUTT + }; +diff --git a/common/include/ipc/model/ipc_set_auth_pincode_req.h b/common/include/ipc/model/ipc_set_auth_pincode_req.h +new file mode 100644 +index 00000000..69d0f638 +--- /dev/null ++++ b/common/include/ipc/model/ipc_set_auth_pincode_req.h +@@ -0,0 +1,43 @@ ++/* ++ * Copyright (c) 2022 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. ++ */ ++ ++#ifndef OHOS_DM_IPC_SET_AUTH_PINCODE_REQ_H ++#define OHOS_DM_IPC_SET_AUTH_PINCODE_REQ_H ++ ++#include "ipc_req.h" ++ ++namespace OHOS { ++namespace DistributedHardware { ++class IpcSetAuthPinCodeReq : public IpcReq { ++ DECLARE_IPC_MODEL(IpcSetAuthPinCodeReq); ++ ++public: ++ const std::string &GetPinCode() const ++ { ++ return pinCode_; ++ } ++ ++ void SetPinCode(const std::string &pinCode) ++ { ++ pinCode_ = pinCode; ++ } ++ ++private: ++ std::string pinCode_; ++}; ++} // namespace DistributedHardware ++} // namespace OHOS ++ ++#endif // OHOS_DM_IPC_SET_AUTH_PINCODE_REQ_H +diff --git a/common/src/dfx/standard/dm_hisysevent.cpp b/common/src/dfx/standard/dm_hisysevent.cpp +index a508cb85..067677fa 100644 +--- a/common/src/dfx/standard/dm_hisysevent.cpp ++++ b/common/src/dfx/standard/dm_hisysevent.cpp +@@ -24,7 +24,6 @@ namespace OHOS { + namespace DistributedHardware { + void SysEventWrite(const std::string &status, int32_t eventType, const std::string &msg) + { +- return; + // int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + // OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_DEVICE_MANAGER, + // status.c_str(), +diff --git a/common/src/dfx/standard/dm_hitrace.cpp b/common/src/dfx/standard/dm_hitrace.cpp +index caa79885..85a529ff 100644 +--- a/common/src/dfx/standard/dm_hitrace.cpp ++++ b/common/src/dfx/standard/dm_hitrace.cpp +@@ -19,13 +19,11 @@ namespace OHOS { + namespace DistributedHardware { + void DmTraceStart(const std::string &msg) + { +- return; + // StartTrace(HITRACE_TAG_DEVICE_MANAGER, msg); + } + + void DmTraceEnd() + { +- return; + // FinishTrace(HITRACE_TAG_DEVICE_MANAGER); + } + } // namespace DistributedHardware +diff --git a/ext/BUILD.gn b/ext/BUILD.gn +index 03033ecc..5bc04e2a 100644 +--- a/ext/BUILD.gn ++++ b/ext/BUILD.gn +@@ -16,11 +16,11 @@ import("//foundation/distributedhardware/device_manager/device_manager.gni") + + group("ext_modules") { + deps = [] +- if (support_jsapi) { ++ # if (support_jsapi) { + if (device_manager_no_interaction_auth) { + deps += [ "./no_interaction_auth:devicemanagerext_no_interaction_auth" ] + } else { + deps += [ "./pin_auth:devicemanagerext_pin_auth" ] + } +- } ++ # } + } +diff --git a/ext/no_interaction_auth/BUILD.gn b/ext/no_interaction_auth/BUILD.gn +index 29b7d6c1..78cf071f 100644 +--- a/ext/no_interaction_auth/BUILD.gn ++++ b/ext/no_interaction_auth/BUILD.gn +@@ -21,80 +21,80 @@ import("//foundation/distributedhardware/device_manager/device_manager.gni") + + if (defined(ohos_lite)) { + } else { +- ohos_shared_library("devicemanagerext_no_interaction_auth") { +- include_dirs = [ +- "include", +- "${common_path}/include", +- "${ext_path}/pin_auth/include/ability", +- "${servicesimpl_path}/include/dependency/timer", +- "${servicesimpl_path}/include/config", +- "${servicesimpl_path}/include/adapter", +- "${servicesimpl_path}/include/authentication", +- "${servicesimpl_path}/include/ability", +- "${servicesimpl_path}/include/devicestate", +- "${servicesimpl_path}/include/discovery", +- "${servicesimpl_path}/include/dependency/commonevent", +- "${servicesimpl_path}/include/dependency/hichain", +- "${servicesimpl_path}/include/dependency/softbus", +- "${servicesimpl_path}/include/dependency/timer", +- "${services_path}/include/ipc", +- "${services_path}/include/ipc/standard", +- "${utils_path}/include", +- "${utils_path}/include/ipc/standard", +- "${servicesimpl_path}/include", +- "${innerkits_path}/native_cpp/include", +- "${common_path}/include/ipc", +- "${common_path}/include/ipc/model", +- "${innerkits_path}/native_cpp/include", +- "${innerkits_path}/native_cpp/include/ipc", +- "${innerkits_path}/native_cpp/include/ipc/standard", +- "//third_party/json/include", +- "//commonlibrary/c_utils/base/include", +- "//utils/system/safwk/native/include", +- "//base/notification/common_event_service/frameworks/core/include", +- "//base/notification/common_event_service/interfaces/innerkits/native/include", +- "//base/security/device_auth/interfaces/innerkits", +- ] ++ # ohos_shared_library("devicemanagerext_no_interaction_auth") { ++ # include_dirs = [ ++ # "include", ++ # "${common_path}/include", ++ # "${ext_path}/pin_auth/include/ability", ++ # "${servicesimpl_path}/include/dependency/timer", ++ # "${servicesimpl_path}/include/config", ++ # "${servicesimpl_path}/include/adapter", ++ # "${servicesimpl_path}/include/authentication", ++ # "${servicesimpl_path}/include/ability", ++ # "${servicesimpl_path}/include/devicestate", ++ # "${servicesimpl_path}/include/discovery", ++ # "${servicesimpl_path}/include/dependency/commonevent", ++ # "${servicesimpl_path}/include/dependency/hichain", ++ # "${servicesimpl_path}/include/dependency/softbus", ++ # "${servicesimpl_path}/include/dependency/timer", ++ # "${services_path}/include/ipc", ++ # "${services_path}/include/ipc/standard", ++ # "${utils_path}/include", ++ # "${utils_path}/include/ipc/standard", ++ # "${servicesimpl_path}/include", ++ # "${innerkits_path}/native_cpp/include", ++ # "${common_path}/include/ipc", ++ # "${common_path}/include/ipc/model", ++ # "${innerkits_path}/native_cpp/include", ++ # "${innerkits_path}/native_cpp/include/ipc", ++ # "${innerkits_path}/native_cpp/include/ipc/standard", ++ # "//third_party/json/include", ++ # "//commonlibrary/c_utils/base/include", ++ # "//utils/system/safwk/native/include", ++ # "//base/notification/common_event_service/frameworks/core/include", ++ # "//base/notification/common_event_service/interfaces/innerkits/native/include", ++ # "//base/security/device_auth/interfaces/innerkits", ++ # ] + +- sources = [ +- "src/ability/standard/dm_ability_manager.cpp", +- "src/no_interaction_auth.cpp", +- ] ++ # sources = [ ++ # "src/ability/standard/dm_ability_manager.cpp", ++ # "src/no_interaction_auth.cpp", ++ # ] + +- deps = [ +- "${ability_runtime_innerkits_path}/ability_manager:ability_manager", +- "${ability_runtime_services_path}/abilitymgr:abilityms", +- "${innerkits_path}/native_cpp:devicemanagersdk", +- "${utils_path}:devicemanagerutils", +- "//base/security/device_auth/services:deviceauth_sdk", +- "//foundation/distributedhardware/device_manager/services/implementation:devicemanagerserviceimpl", +- "//foundation/distributedhardware/device_manager/services/service:devicemanagerservice", +- ] ++ # deps = [ ++ # "${ability_runtime_innerkits_path}/ability_manager:ability_manager", ++ # "${ability_runtime_services_path}/abilitymgr:abilityms", ++ # "${innerkits_path}/native_cpp:devicemanagersdk", ++ # "${utils_path}:devicemanagerutils", ++ # "//base/security/device_auth/services:deviceauth_sdk", ++ # "//foundation/distributedhardware/device_manager/services/implementation:devicemanagerserviceimpl", ++ # "//foundation/distributedhardware/device_manager/services/service:devicemanagerservice", ++ # ] + +- external_deps = [ +- # "ability_base:want", +- #"bundle_framework:appexecfwk_base", +- #"bundle_framework:appexecfwk_core", +- "c_utils:utils", +- # "common_event_service:cesfwk_core", +- # "common_event_service:cesfwk_innerkits", +- "dsoftbus:softbus_client", +- "hiviewdfx_hilog_native:libhilog", +- "init:libbeget_proxy", +- "init:libbegetutil", +- "ipc:ipc_core", +- "safwk:system_ability_fwk", +- "samgr:samgr_proxy", +- ] ++ # external_deps = [ ++ # "ability_base:want", ++ # "bundle_framework:appexecfwk_base", ++ # "bundle_framework:appexecfwk_core", ++ # "c_utils:utils", ++ # "common_event_service:cesfwk_core", ++ # "common_event_service:cesfwk_innerkits", ++ # "dsoftbus:softbus_client", ++ # "hiviewdfx_hilog_native:libhilog", ++ # "init:libbeget_proxy", ++ # "init:libbegetutil", ++ # "ipc:ipc_core", ++ # "safwk:system_ability_fwk", ++ # "samgr:samgr_proxy", ++ # ] + +- defines = [ +- "HI_LOG_ENABLE", +- "DH_LOG_TAG=\"devicemanagerext\"", +- "LOG_DOMAIN=0xD004100", +- ] ++ # defines = [ ++ # "HI_LOG_ENABLE", ++ # "DH_LOG_TAG=\"devicemanagerext\"", ++ # "LOG_DOMAIN=0xD004100", ++ # ] + +- subsystem_name = "distributedhardware" ++ # subsystem_name = "distributedhardware" + +- part_name = "device_manager" +- } ++ # part_name = "device_manager" ++ # } + } +diff --git a/ext/pin_auth/BUILD.gn b/ext/pin_auth/BUILD.gn +index efcb0321..042de4d9 100644 +--- a/ext/pin_auth/BUILD.gn ++++ b/ext/pin_auth/BUILD.gn +@@ -128,13 +128,13 @@ if (defined(ohos_lite)) { + ] + + sources = [ +- "src/ability/standard/dm_ability_manager.cpp", ++ # "src/ability/standard/dm_ability_manager.cpp", + "src/pin_auth.cpp", + "src/standard/pin_auth_ui.cpp", + ] + + deps = [ +- "${ability_runtime_innerkits_path}/ability_manager:ability_manager", ++ # "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${innerkits_path}/native_cpp:devicemanagersdk", + "//foundation/distributedhardware/device_manager/services/implementation:devicemanagerserviceimpl", + ] +diff --git a/ext/pin_auth/include/ability/dm_ability_manager.h b/ext/pin_auth/include/ability/dm_ability_manager.h +index 83a62f2c..318ad8f0 100644 +--- a/ext/pin_auth/include/ability/dm_ability_manager.h ++++ b/ext/pin_auth/include/ability/dm_ability_manager.h +@@ -18,7 +18,7 @@ + + #include + #include +-#include "want.h" ++// #include "want.h" + + namespace OHOS { + namespace DistributedHardware { +@@ -37,7 +37,7 @@ enum UiAction { + + class DmAbilityManager { + public: +- AbilityStatus StartAbility(AAFwk::Want &want); ++ // AbilityStatus StartAbility(AAFwk::Want &want); + }; + } // namespace DistributedHardware + } // namespace OHOS +diff --git a/ext/pin_auth/include/pin_auth.h b/ext/pin_auth/include/pin_auth.h +index b9151711..4c1fd20b 100644 +--- a/ext/pin_auth/include/pin_auth.h ++++ b/ext/pin_auth/include/pin_auth.h +@@ -19,9 +19,9 @@ + #include + #include + +-#include "authentication.h" ++// #include "authentication.h" + #include "dm_auth_manager.h" +-#include "dm_ability_manager.h" ++// #include "dm_ability_manager.h" + #include "pin_auth_ui.h" + + namespace OHOS { +diff --git a/ext/pin_auth/include/standard/pin_auth_ui.h b/ext/pin_auth/include/standard/pin_auth_ui.h +index aa33b20f..b87b000d 100644 +--- a/ext/pin_auth/include/standard/pin_auth_ui.h ++++ b/ext/pin_auth/include/standard/pin_auth_ui.h +@@ -19,8 +19,8 @@ + #include + + #include "dm_auth_manager.h" +-#include "dm_ability_manager.h" +-#include "want.h" ++// #include "dm_ability_manager.h" ++// #include "want.h" + + namespace OHOS { + namespace DistributedHardware { +diff --git a/ext/pin_auth/src/pin_auth.cpp b/ext/pin_auth/src/pin_auth.cpp +index 948d98e6..b141bb6a 100644 +--- a/ext/pin_auth/src/pin_auth.cpp ++++ b/ext/pin_auth/src/pin_auth.cpp +@@ -38,59 +38,62 @@ PinAuth::~PinAuth() + + int32_t PinAuth::ShowAuthInfo(std::string &authToken, std::shared_ptr authManager) + { +- nlohmann::json jsonObject = nlohmann::json::parse(authToken, nullptr, false); +- if (jsonObject.is_discarded()) { +- LOGE("DecodeRequestAuth jsonStr error"); +- return ERR_DM_FAILED; +- } +- if (!IsInt32(jsonObject, PIN_CODE_KEY)) { +- LOGE("err json string, first time"); +- return ERR_DM_FAILED; +- } +- return pinAuthUi_->ShowPinDialog(jsonObject[PIN_CODE_KEY].get(), authManager); ++ return DM_OK; ++ // nlohmann::json jsonObject = nlohmann::json::parse(authToken, nullptr, false); ++ // if (jsonObject.is_discarded()) { ++ // LOGE("DecodeRequestAuth jsonStr error"); ++ // return ERR_DM_FAILED; ++ // } ++ // if (!IsInt32(jsonObject, PIN_CODE_KEY)) { ++ // LOGE("err json string, first time"); ++ // return ERR_DM_FAILED; ++ // } ++ // return pinAuthUi_->ShowPinDialog(jsonObject[PIN_CODE_KEY].get(), authManager); + } + + int32_t PinAuth::StartAuth(std::string &authToken, std::shared_ptr authManager) + { +- return pinAuthUi_->InputPinDialog(authManager); ++ // return pinAuthUi_->InputPinDialog(authManager); ++ return DM_OK; + } + + int32_t PinAuth::VerifyAuthentication(std::string &authToken, const std::string &authParam) + { +- times_ += 1; +- if (authParam.length() == 1) { +- if (authParam == std::string(EVENT_CONFIRM_CODE)) { +- return DM_OK; +- } +- LOGE("Peer rejection"); +- return ERR_DM_FAILED; +- } +- nlohmann::json authParamJson = nlohmann::json::parse(authParam, nullptr, false); +- if (authParamJson.is_discarded()) { +- LOGE("DecodeRequestAuth jsonStr error"); +- return ERR_DM_FAILED; +- } +- nlohmann::json authTokenJson = nlohmann::json::parse(authToken, nullptr, false); +- if (authTokenJson.is_discarded()) { +- LOGE("DecodeRequestAuth jsonStr error"); +- return ERR_DM_FAILED; +- } +- if (!IsInt32(authTokenJson, PIN_CODE_KEY) || !IsString(authTokenJson, PIN_TOKEN) || +- !IsInt32(authParamJson, PIN_CODE_KEY) || !IsString(authParamJson, PIN_TOKEN)) { +- LOGE("PinAuth::VerifyAuthentication err json string."); +- return ERR_DM_FAILED; +- } +- int32_t code = authTokenJson[PIN_CODE_KEY].get(); +- std::string pinToken = authTokenJson[PIN_TOKEN].get(); +- int32_t inputPinCode = authParamJson[PIN_CODE_KEY].get(); +- std::string inputPinToken = authParamJson[PIN_TOKEN].get(); +- if (code == inputPinCode && pinToken == inputPinToken) { +- return DM_OK; +- } else if (code != inputPinCode && times_ < MAX_VERIFY_TIMES) { +- return ERR_DM_INPUT_PARA_INVALID; +- } else { +- return ERR_DM_FAILED; +- } ++ return DM_OK; ++ // times_ += 1; ++ // if (authParam.length() == 1) { ++ // if (authParam == std::string(EVENT_CONFIRM_CODE)) { ++ // return DM_OK; ++ // } ++ // LOGE("Peer rejection"); ++ // return ERR_DM_FAILED; ++ // } ++ // nlohmann::json authParamJson = nlohmann::json::parse(authParam, nullptr, false); ++ // if (authParamJson.is_discarded()) { ++ // LOGE("DecodeRequestAuth jsonStr error"); ++ // return ERR_DM_FAILED; ++ // } ++ // nlohmann::json authTokenJson = nlohmann::json::parse(authToken, nullptr, false); ++ // if (authTokenJson.is_discarded()) { ++ // LOGE("DecodeRequestAuth jsonStr error"); ++ // return ERR_DM_FAILED; ++ // } ++ // if (!IsInt32(authTokenJson, PIN_CODE_KEY) || !IsString(authTokenJson, PIN_TOKEN) || ++ // !IsInt32(authParamJson, PIN_CODE_KEY) || !IsString(authParamJson, PIN_TOKEN)) { ++ // LOGE("PinAuth::VerifyAuthentication err json string."); ++ // return ERR_DM_FAILED; ++ // } ++ // int32_t code = authTokenJson[PIN_CODE_KEY].get(); ++ // std::string pinToken = authTokenJson[PIN_TOKEN].get(); ++ // int32_t inputPinCode = authParamJson[PIN_CODE_KEY].get(); ++ // std::string inputPinToken = authParamJson[PIN_TOKEN].get(); ++ // if (code == inputPinCode && pinToken == inputPinToken) { ++ // return DM_OK; ++ // } else if (code != inputPinCode && times_ < MAX_VERIFY_TIMES) { ++ // return ERR_DM_INPUT_PARA_INVALID; ++ // } else { ++ // return ERR_DM_FAILED; ++ // } + } + + extern "C" IAuthentication *CreatePinAuthObject(void) +diff --git a/ext/pin_auth/src/standard/pin_auth_ui.cpp b/ext/pin_auth/src/standard/pin_auth_ui.cpp +index 65af67a6..be964702 100644 +--- a/ext/pin_auth/src/standard/pin_auth_ui.cpp ++++ b/ext/pin_auth/src/standard/pin_auth_ui.cpp +@@ -31,55 +31,57 @@ PinAuthUi::PinAuthUi() + + int32_t PinAuthUi::ShowPinDialog(int32_t code, std::shared_ptr authManager) + { +- LOGI("ShowPinDialog start"); +- if (authManager == nullptr) { +- LOGE("authManager is null"); +- return ERR_DM_FAILED; +- } +- std::shared_ptr dmAbilityMgr = std::make_shared(); +- AAFwk::Want want; +- want.SetParam("PinCode", std::to_string(code)); +- char localDeviceId[DEVICE_UUID_LENGTH] = {0}; +- GetDevUdid(localDeviceId, DEVICE_UUID_LENGTH); +- const std::string deviceId = localDeviceId; +- const std::string bundleUiName = "com.ohos.devicemanagerui"; +- const std::string abilityUiName = "com.ohos.devicemanagerui.PincodeServiceExtAbility"; +- AppExecFwk::ElementName element(deviceId, bundleUiName, abilityUiName); +- want.SetElement(element); +- AbilityStatus status = dmAbilityMgr->StartAbility(want); +- if (status != AbilityStatus::ABILITY_STATUS_SUCCESS) { +- LOGE("ShowConfirm::start ui service fail"); +- return ERR_DM_FAILED; +- } +- LOGI("ShowPinDialog end"); +- return DM_OK; ++ return -1; ++ // LOGI("ShowPinDialog start"); ++ // if (authManager == nullptr) { ++ // LOGE("authManager is null"); ++ // return ERR_DM_FAILED; ++ // } ++ // std::shared_ptr dmAbilityMgr = std::make_shared(); ++ // AAFwk::Want want; ++ // want.SetParam("PinCode", std::to_string(code)); ++ // char localDeviceId[DEVICE_UUID_LENGTH] = {0}; ++ // GetDevUdid(localDeviceId, DEVICE_UUID_LENGTH); ++ // const std::string deviceId = localDeviceId; ++ // const std::string bundleUiName = "com.ohos.devicemanagerui"; ++ // const std::string abilityUiName = "com.ohos.devicemanagerui.PincodeServiceExtAbility"; ++ // AppExecFwk::ElementName element(deviceId, bundleUiName, abilityUiName); ++ // want.SetElement(element); ++ // AbilityStatus status = dmAbilityMgr->StartAbility(want); ++ // if (status != AbilityStatus::ABILITY_STATUS_SUCCESS) { ++ // LOGE("ShowConfirm::start ui service fail"); ++ // return ERR_DM_FAILED; ++ // } ++ // LOGI("ShowPinDialog end"); ++ // return DM_OK; + } + + int32_t PinAuthUi::InputPinDialog(std::shared_ptr authManager) + { +- LOGI("InputPinDialog start"); +- if (authManager == nullptr) { +- LOGE("authManager is null"); +- return ERR_DM_FAILED; +- } +- std::shared_ptr dmAbilityMgr = std::make_shared(); ++ return -1; ++ // LOGI("InputPinDialog start"); ++ // if (authManager == nullptr) { ++ // LOGE("authManager is null"); ++ // return ERR_DM_FAILED; ++ // } ++ // std::shared_ptr dmAbilityMgr = std::make_shared(); + +- AAFwk::Want want; +- want.SetParam(VERIFY_FAILED, false); +- char localDeviceId[DEVICE_UUID_LENGTH] = {0}; +- GetDevUdid(localDeviceId, DEVICE_UUID_LENGTH); +- const std::string deviceId = localDeviceId; +- const std::string bundleUiName = "com.ohos.devicemanagerui"; +- const std::string abilityUiName = "com.ohos.devicemanagerui.InputServiceExtAbility"; +- AppExecFwk::ElementName element(deviceId, bundleUiName, abilityUiName); +- want.SetElement(element); +- AbilityStatus status = dmAbilityMgr->StartAbility(want); +- if (status != AbilityStatus::ABILITY_STATUS_SUCCESS) { +- LOGE("ShowConfirm::start ui service success"); +- return ERR_DM_FAILED; +- } +- LOGI("InputPinDialog end"); +- return DM_OK; ++ // AAFwk::Want want; ++ // want.SetParam(VERIFY_FAILED, false); ++ // char localDeviceId[DEVICE_UUID_LENGTH] = {0}; ++ // GetDevUdid(localDeviceId, DEVICE_UUID_LENGTH); ++ // const std::string deviceId = localDeviceId; ++ // const std::string bundleUiName = "com.ohos.devicemanagerui"; ++ // const std::string abilityUiName = "com.ohos.devicemanagerui.InputServiceExtAbility"; ++ // AppExecFwk::ElementName element(deviceId, bundleUiName, abilityUiName); ++ // want.SetElement(element); ++ // AbilityStatus status = dmAbilityMgr->StartAbility(want); ++ // if (status != AbilityStatus::ABILITY_STATUS_SUCCESS) { ++ // LOGE("ShowConfirm::start ui service success"); ++ // return ERR_DM_FAILED; ++ // } ++ // LOGI("InputPinDialog end"); ++ // return DM_OK; + } + } // namespace DistributedHardware + } // namespace OHOS +diff --git a/interfaces/inner_kits/native_cpp/BUILD.gn b/interfaces/inner_kits/native_cpp/BUILD.gn +index 81ea6a65..24989e86 100644 +--- a/interfaces/inner_kits/native_cpp/BUILD.gn ++++ b/interfaces/inner_kits/native_cpp/BUILD.gn +@@ -147,6 +147,10 @@ if (defined(ohos_lite)) { + "LOG_DOMAIN=0xD004100", + ] + ++ deps = [ ++ "//foundation/distributedhardware/device_manager/services/service:devicemanagerservice", ++ ] ++ + external_deps = [ + "c_utils:utils", + # "hisysevent_native:libhisysevent", +diff --git a/interfaces/inner_kits/native_cpp/include/device_manager.h b/interfaces/inner_kits/native_cpp/include/device_manager.h +index d96fb502..b695a761 100644 +--- a/interfaces/inner_kits/native_cpp/include/device_manager.h ++++ b/interfaces/inner_kits/native_cpp/include/device_manager.h +@@ -27,6 +27,7 @@ + + namespace OHOS { + namespace DistributedHardware { ++ + class DeviceManager { + public: + static DeviceManager &GetInstance(); +@@ -207,6 +208,12 @@ public: + * @param event event info + */ + virtual int32_t NotifyEvent(const std::string &pkgName, const int32_t eventId, const std::string &event) = 0; ++ ++ virtual int32_t SetAuthPinCode(const std::string &pkgName, const std::string &pinCode) = 0; ++ ++ virtual int32_t RegNotifyPinCodeCallback(const std::string &pkgName, std::shared_ptr callback) = 0; ++ ++ virtual int32_t UnRegNotifyPinCodeCallback(const std::string &pkgName) = 0; + }; + } // namespace DistributedHardware + } // namespace OHOS +diff --git a/interfaces/inner_kits/native_cpp/include/device_manager_callback.h b/interfaces/inner_kits/native_cpp/include/device_manager_callback.h +index 8f63d023..2c27b909 100644 +--- a/interfaces/inner_kits/native_cpp/include/device_manager_callback.h ++++ b/interfaces/inner_kits/native_cpp/include/device_manager_callback.h +@@ -23,6 +23,7 @@ + + namespace OHOS { + namespace DistributedHardware { ++ + class DmInitCallback { + public: + virtual ~DmInitCallback() +@@ -91,6 +92,14 @@ public: + } + virtual void OnCredentialResult(int32_t &action, const std::string &credentialResult) = 0; + }; ++ ++class NotifyPinCodeCallback { ++public: ++ virtual ~NotifyPinCodeCallback() ++ { ++ } ++ virtual void OnSet(const std::string& pinCode) = 0; ++}; + } // namespace DistributedHardware + } // namespace OHOS + #endif // OHOS_DM_CALLBACK_H +diff --git a/interfaces/inner_kits/native_cpp/include/device_manager_impl.h b/interfaces/inner_kits/native_cpp/include/device_manager_impl.h +index cc3c85b2..db83530a 100644 +--- a/interfaces/inner_kits/native_cpp/include/device_manager_impl.h ++++ b/interfaces/inner_kits/native_cpp/include/device_manager_impl.h +@@ -24,6 +24,7 @@ + + namespace OHOS { + namespace DistributedHardware { ++ + class DeviceManagerImpl : public DeviceManager { + public: + static DeviceManagerImpl &GetInstance(); +@@ -207,7 +208,14 @@ public: + */ + virtual int32_t NotifyEvent(const std::string &pkgName, const int32_t eventId, const std::string &event) override; + ++ virtual int32_t SetAuthPinCode(const std::string &pkgName, const std::string &pinCode) override; ++ ++ virtual int32_t RegNotifyPinCodeCallback(const std::string &pkgName, std::shared_ptr callback) override; ++ ++ virtual int32_t UnRegNotifyPinCodeCallback(const std::string &pkgName) override; ++ + int32_t OnDmServiceDied(); ++ + private: + DeviceManagerImpl() = default; + ~DeviceManagerImpl() = default; +diff --git a/interfaces/inner_kits/native_cpp/include/dm_publish_info.h b/interfaces/inner_kits/native_cpp/include/dm_publish_info.h +index ed352737..f4a68982 100644 +--- a/interfaces/inner_kits/native_cpp/include/dm_publish_info.h ++++ b/interfaces/inner_kits/native_cpp/include/dm_publish_info.h +@@ -17,6 +17,7 @@ + #define OHOS_DM_PUBLISH_INFO_H + + #include ++#include + + #include "dm_subscribe_info.h" + +diff --git a/interfaces/inner_kits/native_cpp/include/dm_subscribe_info.h b/interfaces/inner_kits/native_cpp/include/dm_subscribe_info.h +index 603e2421..2fb8dc37 100644 +--- a/interfaces/inner_kits/native_cpp/include/dm_subscribe_info.h ++++ b/interfaces/inner_kits/native_cpp/include/dm_subscribe_info.h +@@ -17,6 +17,7 @@ + #define OHOS_DM_SUBSCRIBE_INFO_H + + #include ++#include + + #define DM_MAX_DEVICE_CAPABILITY_LEN 65 + +diff --git a/interfaces/inner_kits/native_cpp/include/notify/device_manager_notify.h b/interfaces/inner_kits/native_cpp/include/notify/device_manager_notify.h +index 1e59131f..fb6c9136 100644 +--- a/interfaces/inner_kits/native_cpp/include/notify/device_manager_notify.h ++++ b/interfaces/inner_kits/native_cpp/include/notify/device_manager_notify.h +@@ -52,9 +52,13 @@ public: + void UnRegisterVerifyAuthenticationCallback(const std::string &pkgName); + void RegisterDeviceManagerFaCallback(const std::string &pkgName, std::shared_ptr callback); + void UnRegisterDeviceManagerFaCallback(const std::string &pkgName); ++ + void RegisterCredentialCallback(const std::string &pkgName, std::shared_ptr callback); + void UnRegisterCredentialCallback(const std::string &pkgName); + ++ void RegisterNotifyPinCodeCallback(const std::string &pkgName, std::shared_ptr callback); ++ void UnRegisterNotifyPinCodeCallback(const std::string &pkgName); ++ + public: + void OnRemoteDied(); + void OnDeviceOnline(const std::string &pkgName, const DmDeviceInfo &deviceInfo); +@@ -69,7 +73,9 @@ public: + uint32_t status, uint32_t reason); + void OnVerifyAuthResult(const std::string &pkgName, const std::string &deviceId, int32_t resultCode, int32_t flag); + void OnUiCall(std::string &pkgName, std::string ¶mJson); ++ void OnPinInput(std::string &pkgName, std::string &pinCode); + void OnCredentialResult(const std::string &pkgName, int32_t &action, const std::string &credentialResult); ++ void OnGeneratePinCode(const std::string &pkgName, const std::string &pinCode); + + private: + #if !defined(__LITEOS_M__) +@@ -83,6 +89,7 @@ private: + std::map> dmInitCallback_; + std::map> dmUiCallback_; + std::map> credentialCallback_; ++ std::map> pinCodeCallback_; + }; + } // namespace DistributedHardware + } // namespace OHOS +diff --git a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp +index cf063a9e..a337c9f1 100644 +--- a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp ++++ b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp +@@ -42,6 +42,7 @@ + #include "ipc_unpublish_req.h" + #include "ipc_verify_authenticate_req.h" + #include "ipc_register_dev_state_callback_req.h" ++#include "ipc_set_auth_pincode_req.h" + #include "securec.h" + + namespace OHOS { +@@ -293,7 +294,6 @@ int32_t DeviceManagerImpl::PublishDeviceDiscovery(const std::string &pkgName, co + LOGE("PublishDeviceDiscovery error: Failed with ret %d", ret); + return ret; + } +- + LOGI("PublishDeviceDiscovery completed, pkgName: %s", pkgName.c_str()); + return DM_OK; + } +@@ -792,6 +792,58 @@ int32_t DeviceManagerImpl::NotifyEvent(const std::string &pkgName, const int32_t + return DM_OK; + } + ++int32_t DeviceManagerImpl::SetAuthPinCode(const std::string &pkgName, const std::string &pinCode) ++{ ++ if (pkgName.empty() || pinCode.empty()) { ++ LOGE("SetAuthPinCode error: invalid value"); ++ return ERR_DM_INPUT_PARA_INVALID; ++ } ++ LOGI("DeviceManagerImpl::SetAuthPinCode start, pkgName: %s", pkgName.c_str()); ++ std::shared_ptr req = std::make_shared(); ++ std::shared_ptr rsp = std::make_shared(); ++ req->SetPkgName(pkgName); ++ req->SetPinCode(pinCode); ++ int32_t ret = ipcClientProxy_->SendRequest(SET_AUTH_PINCODE, req, rsp); ++ if (ret != DM_OK) { ++ LOGE("SetAuthPinCode error: Send Request failed ret: %d", ret); ++ SysEventWrite(std::string(DM_SEND_REQUEST_FAILED), DM_HISYEVENT_BEHAVIOR, ++ std::string(DM_SEND_REQUEST_FAILED_MSG)); ++ return ERR_DM_IPC_SEND_REQUEST_FAILED; ++ } ++ SysEventWrite(std::string(DM_SEND_REQUEST_SUCCESS), DM_HISYEVENT_BEHAVIOR, ++ std::string(DM_SEND_REQUEST_SUCCESS_MSG)); ++ ret = rsp->GetErrCode(); ++ if (ret != DM_OK) { ++ LOGE("SetAuthPinCode error: Failed with ret %d", ret); ++ return ret; ++ } ++ DmTraceEnd(); ++ LOGI("SetAuthPinCode completed, pkgName: %s", pkgName.c_str()); ++ return DM_OK; ++} ++ ++int32_t DeviceManagerImpl::RegNotifyPinCodeCallback(const std::string &pkgName, std::shared_ptr callback) ++{ ++ if (pkgName.empty() || callback == nullptr) { ++ LOGE("SetAuthPinCode error: invalid value"); ++ return ERR_DM_INPUT_PARA_INVALID; ++ } ++ LOGI("RegNotifyPinCodeCallback start, pkgName: %s", pkgName.c_str()); ++ DeviceManagerNotify::GetInstance().RegisterNotifyPinCodeCallback(pkgName, callback); ++ return DM_OK; ++} ++ ++int32_t DeviceManagerImpl::UnRegNotifyPinCodeCallback(const std::string &pkgName) ++{ ++ if (pkgName.empty()) { ++ LOGE("UnRegNotifyPinCodeCallback Invalid parameter, pkgName is empty."); ++ return ERR_DM_INPUT_PARA_INVALID; ++ } ++ LOGI("UnRegNotifyPinCodeCallback start, pkgName: %s", pkgName.c_str()); ++ DeviceManagerNotify::GetInstance().UnRegisterNotifyPinCodeCallback(pkgName); ++ return DM_OK; ++} ++ + int32_t DeviceManagerImpl::OnDmServiceDied() + { + LOGI("OnDmServiceDied begin"); +diff --git a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp +index f51c1450..32b5b3b6 100644 +--- a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp ++++ b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp +@@ -40,6 +40,7 @@ + #include "ipc_unpublish_req.h" + #include "ipc_unauthenticate_device_req.h" + #include "ipc_verify_authenticate_req.h" ++#include "ipc_set_auth_pincode_req.h" + #include "securec.h" + namespace OHOS { class IRemoteObject; } + +@@ -739,5 +740,36 @@ ON_IPC_READ_RESPONSE(NOTIFY_EVENT, MessageParcel &reply, std::shared_ptr + pBaseRsp->SetErrCode(reply.ReadInt32()); + return DM_OK; + } ++ ++ON_IPC_SET_REQUEST(SET_AUTH_PINCODE, std::shared_ptr pBaseReq, MessageParcel &data) ++{ ++ std::shared_ptr pReq = std::static_pointer_cast(pBaseReq); ++ std::string pkgName = pReq->GetPkgName(); ++ std::string pinCode = pReq->GetPinCode(); ++ if (!data.WriteString(pkgName)) { ++ LOGE("write pkgName failed"); ++ return ERR_DM_IPC_WRITE_FAILED; ++ } ++ if (!data.WriteString(pinCode)) { ++ LOGE("write pinCode failed"); ++ return ERR_DM_IPC_WRITE_FAILED; ++ } ++ return DM_OK; ++} ++ ++ON_IPC_READ_RESPONSE(SET_AUTH_PINCODE, MessageParcel &reply, std::shared_ptr pBaseRsp) ++{ ++ pBaseRsp->SetErrCode(reply.ReadInt32()); ++ return DM_OK; ++} ++ ++ON_IPC_CMD(GENERATE_PINCODE, MessageParcel &data, MessageParcel &reply) ++{ ++ std::string pkgName = data.ReadString(); ++ std::string pinCode = data.ReadString(); ++ DeviceManagerNotify::GetInstance().OnGeneratePinCode(pkgName, pinCode); ++ reply.WriteInt32(DM_OK); ++ return DM_OK; ++} + } // namespace DistributedHardware + } // namespace OHOS +diff --git a/interfaces/inner_kits/native_cpp/src/notify/device_manager_notify.cpp b/interfaces/inner_kits/native_cpp/src/notify/device_manager_notify.cpp +index def8d7cb..fad34b3a 100644 +--- a/interfaces/inner_kits/native_cpp/src/notify/device_manager_notify.cpp ++++ b/interfaces/inner_kits/native_cpp/src/notify/device_manager_notify.cpp +@@ -217,6 +217,18 @@ void DeviceManagerNotify::UnRegisterCredentialCallback(const std::string &pkgNam + credentialCallback_.erase(pkgName); + } + ++void DeviceManagerNotify::RegisterNotifyPinCodeCallback(const std::string &pkgName, std::shared_ptr callback) ++{ ++ std::lock_guard autoLock(lock_); ++ pinCodeCallback_[pkgName] = callback; ++} ++ ++void DeviceManagerNotify::UnRegisterNotifyPinCodeCallback(const std::string &pkgName) ++{ ++ std::lock_guard autoLock(lock_); ++ pinCodeCallback_.erase(pkgName); ++} ++ + void DeviceManagerNotify::OnRemoteDied() + { + LOGW("DeviceManagerNotify::OnRemoteDied"); +@@ -557,5 +569,29 @@ void DeviceManagerNotify::OnCredentialResult(const std::string &pkgName, int32_t + } + tempCbk->OnCredentialResult(action, credentialResult); + } ++ ++void DeviceManagerNotify::OnGeneratePinCode(const std::string &pkgName, const std::string &pinCode) ++{ ++ if (pkgName.empty() || pinCode.empty()) { ++ LOGE("DeviceManagerNotify::OnGeneratePinCode error: Invalid parameter"); ++ return; ++ } ++ LOGI("DeviceManagerNotify::OnGeneratePinCode in, pkgName:%s", pkgName.c_str()); ++ std::shared_ptr tempCbk; ++ { ++ std::lock_guard autoLock(lock_); ++ if (pinCodeCallback_.count(pkgName) == 0) { ++ LOGE("DeviceManagerNotify::OnGeneratePinCode error, pincode callback not register for pkgName %s.", ++ pkgName.c_str()); ++ return; ++ } ++ tempCbk = pinCodeCallback_[pkgName]; ++ } ++ if (tempCbk == nullptr) { ++ LOGE("OnGeneratePinCode error, registered pincode callback is nullptr."); ++ return; ++ } ++ tempCbk->OnSet(pinCode); ++} + } // namespace DistributedHardware + } // namespace OHOS +diff --git a/interfaces/kits/BUILD.gn b/interfaces/kits/BUILD.gn +index 8aaf23fb..a454cad1 100644 +--- a/interfaces/kits/BUILD.gn ++++ b/interfaces/kits/BUILD.gn +@@ -15,7 +15,7 @@ import("//build/ohos.gni") + + group("devicemanager_native_js") { + deps = [] +- if (support_jsapi) { +- deps += [ "./js:devicemanager" ] +- } ++ # if (support_jsapi) { ++ # deps += [ "./js:devicemanager" ] ++ # } + } +diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn +index bd0febab..a71f79a1 100644 +--- a/interfaces/kits/js/BUILD.gn ++++ b/interfaces/kits/js/BUILD.gn +@@ -46,7 +46,7 @@ ohos_shared_library("devicemanager") { + "LOG_DOMAIN=0xD004100", + ] + +- external_deps = [ #"bundle_framework:appexecfwk_base" ] ++ external_deps = [ "bundle_framework:appexecfwk_base" ] + + subsystem_name = "distributedhardware" + relative_install_dir = "module/distributedhardware" +diff --git a/services/implementation/BUILD.gn b/services/implementation/BUILD.gn +index 45bf523b..c338e958 100644 +--- a/services/implementation/BUILD.gn ++++ b/services/implementation/BUILD.gn +@@ -127,11 +127,13 @@ if (defined(ohos_lite)) { + ] + } + } +-} else if (!support_jsapi) { +- group("devicemanagerserviceimpl") { +- deps = [] +- } +-} else { ++} ++# else if (!support_jsapi) { ++# group("devicemanagerserviceimpl") { ++# deps = [] ++# } ++# } ++else { + config("devicemanagerserviceimpl_config") { + include_dirs = [ + "include", +@@ -183,7 +185,7 @@ if (defined(ohos_lite)) { + "src/authentication/showconfirm/standard/show_confirm.cpp", + "src/config/dm_config_manager.cpp", + "src/credential/dm_credential_manager.cpp", +- "src/dependency/commonevent/dm_common_event_manager.cpp", ++ # "src/dependency/commonevent/dm_common_event_manager.cpp", + "src/dependency/hichain/hichain_connector.cpp", + "src/dependency/multipleuser/multiple_user_connector.cpp", + "src/dependency/softbus/softbus_connector.cpp", +@@ -205,7 +207,7 @@ if (defined(ohos_lite)) { + ] + + deps = [ +- "${ability_runtime_innerkits_path}/ability_manager:ability_manager", ++ # "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${innerkits_path}/native_cpp:devicemanagersdk", + "${utils_path}:devicemanagerutils", + "//base/security/device_auth/services:deviceauth_sdk", +diff --git a/services/implementation/include/authentication/dm_auth_manager.h b/services/implementation/include/authentication/dm_auth_manager.h +index 163361a3..bf4372b3 100644 +--- a/services/implementation/include/authentication/dm_auth_manager.h ++++ b/services/implementation/include/authentication/dm_auth_manager.h +@@ -345,6 +345,7 @@ public: + */ + void ShowStartAuthDialog(); + ++ int32_t SetAuthPinCode(const std::string &pkgName, const std::string &pinCode); + /** + * @tc.name: DmAuthManager::GetAuthenticationParam + * @tc.desc: Get Authentication Param of the DeviceManager Authenticate Manager +diff --git a/services/implementation/include/device_manager_service_impl.h b/services/implementation/include/device_manager_service_impl.h +index 0eec8291..a4bac488 100644 +--- a/services/implementation/include/device_manager_service_impl.h ++++ b/services/implementation/include/device_manager_service_impl.h +@@ -21,7 +21,7 @@ + + #include "dm_ability_manager.h" + #include "dm_auth_manager.h" +-#include "dm_common_event_manager.h" ++// #include "dm_common_event_manager.h" + #include "dm_credential_manager.h" + #include "dm_device_info.h" + #include "dm_device_state_manager.h" +@@ -88,6 +88,8 @@ public: + + int32_t NotifyEvent(const std::string &pkgName, const int32_t eventId, const std::string &event); + ++ int32_t SetAuthPinCode(const std::string &pkgName, const std::string &pinCode); ++ + void LoadHardwareFwkService(); + private: + int32_t PraseNotifyEventJson(const std::string &event, nlohmann::json &jsonObject); +@@ -100,7 +102,7 @@ private: + std::shared_ptr abilityMgr_; + std::shared_ptr hiChainConnector_; + std::shared_ptr credentialMgr_; +- std::shared_ptr commonEventManager_; ++ // std::shared_ptr commonEventManager_; + }; + + using CreateDMServiceFuncPtr = IDeviceManagerServiceImpl *(*)(void); +diff --git a/services/implementation/src/ability/standard/dm_ability_manager.cpp b/services/implementation/src/ability/standard/dm_ability_manager.cpp +index f045fcaa..110070b3 100644 +--- a/services/implementation/src/ability/standard/dm_ability_manager.cpp ++++ b/services/implementation/src/ability/standard/dm_ability_manager.cpp +@@ -15,7 +15,7 @@ + + #include "dm_ability_manager.h" + +-#include "ability_manager_client.h" ++// #include "ability_manager_client.h" + #include "dm_constants.h" + #include "dm_log.h" + #include "parameter.h" +@@ -30,18 +30,18 @@ const std::string abilityName = "com.ohos.devicemanagerui.ConfirmServiceExtAbili + + AbilityStatus DmAbilityManager::StartAbility() + { +- char localDeviceId[DEVICE_UUID_LENGTH] = {0}; +- GetDevUdid(localDeviceId, DEVICE_UUID_LENGTH); +- std::string deviceId = localDeviceId; +- AAFwk::Want want; +- AppExecFwk::ElementName element(deviceId, bundleName, abilityName); +- want.SetElement(element); +- AAFwk::AbilityManagerClient::GetInstance()->Connect(); +- ErrCode result = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want); +- if (result != 0) { +- LOGE("Start Ability failed, error value = %d", (int32_t)result); +- return AbilityStatus::ABILITY_STATUS_FAILED; +- } ++ // char localDeviceId[DEVICE_UUID_LENGTH] = {0}; ++ // GetDevUdid(localDeviceId, DEVICE_UUID_LENGTH); ++ // std::string deviceId = localDeviceId; ++ // AAFwk::Want want; ++ // AppExecFwk::ElementName element(deviceId, bundleName, abilityName); ++ // want.SetElement(element); ++ // AAFwk::AbilityManagerClient::GetInstance()->Connect(); ++ // ErrCode result = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want); ++ // if (result != 0) { ++ // LOGE("Start Ability failed, error value = %d", (int32_t)result); ++ // return AbilityStatus::ABILITY_STATUS_FAILED; ++ // } + return AbilityStatus::ABILITY_STATUS_SUCCESS; + } + } // namespace DistributedHardware +diff --git a/services/implementation/src/authentication/auth_message_processor.cpp b/services/implementation/src/authentication/auth_message_processor.cpp +index 80a2f586..d14c6f60 100644 +--- a/services/implementation/src/authentication/auth_message_processor.cpp ++++ b/services/implementation/src/authentication/auth_message_processor.cpp +@@ -65,6 +65,7 @@ std::vector AuthMessageProcessor::CreateAuthRequestMessage() + jsonObj[TAG_TARGET] = authRequestContext_->targetPkgName; + jsonObj[TAG_HOST] = authRequestContext_->hostPkgName; + } ++ jsonObj[TAG_HOST] = authRequestContext_->hostPkgName; + jsonObj[TAG_APP_NAME] = authRequestContext_->appName; + jsonObj[TAG_APP_DESCRIPTION] = authRequestContext_->appDesc; + jsonObj[TAG_APP_ICON] = authRequestContext_->appIcon; +@@ -235,6 +236,7 @@ int32_t AuthMessageProcessor::ParseAuthRequestMessage(nlohmann::json &json) + authResponseContext_->targetPkgName = json[TAG_TARGET].get(); + authResponseContext_->appName = json[TAG_APP_NAME].get(); + authResponseContext_->appThumbnail = ""; ++ authResponseContext_->hostPkgName = json[TAG_HOST].get(); + } + + if (idx < sliceNum && IsString(json, TAG_APP_THUMBNAIL)) { +diff --git a/services/implementation/src/authentication/dm_auth_manager.cpp b/services/implementation/src/authentication/dm_auth_manager.cpp +index 4b0fbd91..0fb6c71d 100644 +--- a/services/implementation/src/authentication/dm_auth_manager.cpp ++++ b/services/implementation/src/authentication/dm_auth_manager.cpp +@@ -16,6 +16,7 @@ + #include "dm_auth_manager.h" + + #include ++#include + + #include "auth_message_processor.h" + #include "dm_ability_manager.h" +@@ -204,7 +205,7 @@ int32_t DmAuthManager::VerifyAuthentication(const std::string &authParam) + return DM_OK; + } + +-void DmAuthManager::OnSessionOpened(int32_t sessionId, int32_t sessionSide, int32_t result) ++void DmAuthManager::OnSessionOpened(int32_t sessionId, int32_t sessionSide, int32_t result) // sessionSide = IS_SERVER ? 0 : 1 + { + LOGI("DmAuthManager::OnSessionOpened sessionId = %d result = %d", sessionId, result); + if (sessionSide == AUTH_SESSION_SIDE_SERVER) { +@@ -358,6 +359,9 @@ void DmAuthManager::OnGroupCreated(int64_t requestId, const std::string &groupId + LOGI("DmAuthManager::OnGroupCreated start group id %s", GetAnonyString(groupId).c_str()); + authResponseContext_->groupId = groupId; + authResponseContext_->code = pinCode; ++ listener_->OnGeneratePinCode(authResponseContext_->hostPkgName.c_str(), std::to_string(pinCode)); ++ const char* prefix = "------------------------------------"; ++ LOGI("\n%s PINCODE %s\n\t\t\t\t\t%d\n%s PINCODE %s", prefix, prefix, pinCode, prefix, prefix); + authMessageProcessor_->SetResponseContext(authResponseContext_); + std::string message = authMessageProcessor_->CreateSimpleMessage(MSG_TYPE_RESP_AUTH); + softbusConnector_->GetSoftbusSession()->SendData(authResponseContext_->sessionId, message); +@@ -501,6 +505,7 @@ void DmAuthManager::RespNegotiate(const int32_t &sessionId) + return; + } + } ++ + jsonObject[TAG_CRYPTO_SUPPORT] = false; + message = jsonObject.dump(); + softbusConnector_->GetSoftbusSession()->SendData(sessionId, message); +@@ -531,6 +536,7 @@ void DmAuthManager::SendAuthRequest(const int32_t &sessionId) + return; + } + } ++ + if (authResponseContext_->reply == ERR_DM_AUTH_PEER_REJECT) { + if (hiChainConnector_->IsDevicesInGroup(authResponseContext_->localDeviceId, + authRequestContext_->localDeviceId)) { +@@ -555,6 +561,7 @@ int32_t DmAuthManager::StartAuthProcess(const int32_t &action) + LOGE("failed to StartAuthProcess because authResponseContext_ is nullptr"); + return ERR_DM_AUTH_NOT_START; + } ++ + LOGI("DmAuthManager::StartAuthProcess"); + authResponseContext_->reply = action; + if (authResponseContext_->reply == USER_OPERATION_TYPE_ALLOW_AUTH && +@@ -787,20 +794,26 @@ int32_t DmAuthManager::GetPinCode() + + void DmAuthManager::ShowConfigDialog() + { +- if (authResponseContext_ == nullptr) { +- LOGE("failed to ShowConfigDialog because authResponseContext_ is nullptr"); +- return; +- } ++ // if (authResponseContext_ == nullptr) { ++ // LOGE("failed to ShowConfigDialog because authResponseContext_ is nullptr"); ++ // return; ++ // } ++ // LOGI("ShowConfigDialog start"); ++ // dmAbilityMgr_ = std::make_shared(); ++ // nlohmann::json jsonObj; ++ // jsonObj[TAG_AUTH_TYPE] = AUTH_TYPE_PIN; ++ // jsonObj[TAG_TOKEN] = authResponseContext_->token; ++ // jsonObj[TARGET_PKG_NAME_KEY] = authResponseContext_->targetPkgName; ++ // jsonObj.dump(); ++ // const std::string params = jsonObj.dump(); ++ // std::shared_ptr showConfirm_ = std::make_shared(); ++ // showConfirm_->ShowConfirmDialog(params, shared_from_this(), dmAbilityMgr_); ++ // LOGI("ShowConfigDialog end"); + LOGI("ShowConfigDialog start"); +- dmAbilityMgr_ = std::make_shared(); +- nlohmann::json jsonObj; +- jsonObj[TAG_AUTH_TYPE] = AUTH_TYPE_PIN; +- jsonObj[TAG_TOKEN] = authResponseContext_->token; +- jsonObj[TARGET_PKG_NAME_KEY] = authResponseContext_->targetPkgName; +- jsonObj.dump(); +- const std::string params = jsonObj.dump(); +- std::shared_ptr showConfirm_ = std::make_shared(); +- showConfirm_->ShowConfirmDialog(params, shared_from_this(), dmAbilityMgr_); ++ int32_t ret = OnUserOperation(0, ""); ++ if (ret != 0) { ++ LOGI("ShowConfigDialog failed to set user operation"); ++ } + LOGI("ShowConfigDialog end"); + } + +@@ -817,14 +830,24 @@ void DmAuthManager::ShowAuthInfoDialog() + authPtr_->ShowAuthInfo(authParam, shared_from_this()); + } + +-void DmAuthManager::ShowStartAuthDialog() ++int32_t DmAuthManager::SetAuthPinCode(const std::string &pkgName, const std::string &pinCode) + { +- if (authResponseContext_ == nullptr) { +- LOGE("failed to ShowStartAuthDialog because authResponseContext_ is nullptr"); +- return; ++ int32_t ret = OnUserOperation(5, pinCode); ++ if (ret != 0) { ++ LOGE("ShowStartAuthDialog OnUserOperation failed\n"); + } +- LOGI("DmAuthManager::ShowStartAuthDialog start"); +- authPtr_->StartAuth(authResponseContext_->authToken, shared_from_this()); ++ return ret; ++} ++ ++void DmAuthManager::ShowStartAuthDialog() ++{ ++ // if (authResponseContext_ == nullptr) { ++ // LOGE("failed to ShowStartAuthDialog because authResponseContext_ is nullptr"); ++ // return; ++ // } ++ // LOGI("DmAuthManager::ShowStartAuthDialog start"); ++ // authPtr_->StartAuth(authResponseContext_->authToken, shared_from_this()); ++ // LOGI("DmAuthManager::ShowStartAuthDialog end"); + } + + int32_t DmAuthManager::GetAuthenticationParam(DmAuthParam &authParam) +diff --git a/services/implementation/src/device_manager_service_impl.cpp b/services/implementation/src/device_manager_service_impl.cpp +index a78109c1..9742c52f 100644 +--- a/services/implementation/src/device_manager_service_impl.cpp ++++ b/services/implementation/src/device_manager_service_impl.cpp +@@ -23,11 +23,11 @@ + #include "dm_log.h" + #include "multiple_user_connector.h" + #include "permission_manager.h" +-#if !(defined(__LITEOS_M__) || defined(LITE_DEVICE)) +-#include "dm_common_event_manager.h" +-#include "common_event_support.h" +-using namespace OHOS::EventFwk; +-#endif ++// #if !(defined(__LITEOS_M__) || defined(LITE_DEVICE)) ++// #include "dm_common_event_manager.h" ++// #include "common_event_support.h" ++// using namespace OHOS::EventFwk; ++// #endif + + namespace OHOS { + namespace DistributedHardware { +@@ -74,16 +74,16 @@ int32_t DeviceManagerServiceImpl::Initialize(const std::shared_ptr(); +- } +- CommomEventCallback callback = std::bind(&DmAuthManager::UserSwitchEventCallback, *authMgr_.get(), +- std::placeholders::_1); +- if (commonEventManager_->SubscribeServiceEvent(CommonEventSupport::COMMON_EVENT_USER_SWITCHED, callback)) { +- LOGI("subscribe service user switch common event success"); +- } +-#endif ++// #if !(defined(__LITEOS_M__) || defined(LITE_DEVICE)) ++// if (commonEventManager_ == nullptr) { ++// commonEventManager_ = std::make_shared(); ++// } ++// CommomEventCallback callback = std::bind(&DmAuthManager::UserSwitchEventCallback, *authMgr_.get(), ++// std::placeholders::_1); ++// if (commonEventManager_->SubscribeServiceEvent(CommonEventSupport::COMMON_EVENT_USER_SWITCHED, callback)) { ++// LOGI("subscribe service user switch common event success"); ++// } ++// #endif + LOGI("Init success, singleton initialized"); + return DM_OK; + } +@@ -91,9 +91,9 @@ int32_t DeviceManagerServiceImpl::Initialize(const std::shared_ptrGetSoftbusSession()->UnRegisterSessionCallback(); + hiChainConnector_->UnRegisterHiChainCallback(); + authMgr_ = nullptr; +@@ -389,6 +389,20 @@ int32_t DeviceManagerServiceImpl::NotifyEvent(const std::string &pkgName, const + return DM_OK; + } + ++int32_t DeviceManagerServiceImpl::SetAuthPinCode(const std::string &pkgName, const std::string &pinCode) ++{ ++ LOGI("SetAuthPinCode begin, pkgName : %s", pkgName.c_str()); ++ if (!PermissionManager::GetInstance().CheckPermission()) { ++ LOGI("The caller does not have permission to call"); ++ return ERR_DM_NO_PERMISSION; ++ } ++ if (pkgName.empty() || pinCode.empty()) { ++ LOGE("DeviceManagerServiceImpl::SetAuthPinCode failed, pkgName is %s", pkgName.c_str()); ++ return ERR_DM_INPUT_PARA_INVALID; ++ } ++ return authMgr_->SetAuthPinCode(pkgName, pinCode); ++} ++ + void DeviceManagerServiceImpl::LoadHardwareFwkService() + { + DmDistributedHardwareLoad::GetInstance().LoadDistributedHardwareFwk(); +diff --git a/services/service/BUILD.gn b/services/service/BUILD.gn +index fd7bb180..c7bf86f9 100644 +--- a/services/service/BUILD.gn ++++ b/services/service/BUILD.gn +@@ -112,10 +112,10 @@ if (defined(ohos_lite)) { + "//third_party/mbedtls", + ] + +- # external_deps = [ +- # # "hisysevent_native:libhisysevent", +- # # "hitrace_native:hitrace_meter", +- # ] ++ external_deps = [ ++ "hisysevent_native:libhisysevent", ++ "hitrace_native:hitrace_meter", ++ ] + } + } else { + executable("devicemanagerservice") { +@@ -180,7 +180,13 @@ if (defined(ohos_lite)) { + ] + } + } +-} else { ++} ++# else if (!support_jsapi) { ++# group("devicemanagerservice") { ++# deps = [] ++# } ++# } ++else { + config("devicemanagerservice_config") { + include_dirs = [ + "include", +diff --git a/services/service/include/device_manager_service.h b/services/service/include/device_manager_service.h +index d6038878..25b5911e 100644 +--- a/services/service/include/device_manager_service.h ++++ b/services/service/include/device_manager_service.h +@@ -110,6 +110,8 @@ public: + int32_t NotifyEvent(const std::string &pkgName, const int32_t eventId, const std::string &event); + + void LoadHardwareFwkService(); ++ ++ int32_t SetAuthPinCode(const std::string &pkgName, const std::string &pinCode); + private: + bool isImplsoLoaded_ = false; + std::mutex isImplLoadLock_; +diff --git a/services/service/include/device_manager_service_listener.h b/services/service/include/device_manager_service_listener.h +index 43fa5668..9851b946 100644 +--- a/services/service/include/device_manager_service_listener.h ++++ b/services/service/include/device_manager_service_listener.h +@@ -52,6 +52,8 @@ public: + void OnUiCall(std::string &pkgName, std::string ¶mJson); + + void OnCredentialResult(const std::string &pkgName, int32_t action, const std::string &resultInfo); ++ ++ void OnGeneratePinCode(const std::string &pkgName, const std::string &pinCode); + private: + #if !defined(__LITEOS_M__) + IpcServerListener ipcServerListener_; +diff --git a/services/service/include/idevice_manager_service_impl.h b/services/service/include/idevice_manager_service_impl.h +index b7f118b2..c4a2c09a 100644 +--- a/services/service/include/idevice_manager_service_impl.h ++++ b/services/service/include/idevice_manager_service_impl.h +@@ -196,6 +196,8 @@ public: + */ + virtual int32_t NotifyEvent(const std::string &pkgName, const int32_t eventId, const std::string &event); + ++ virtual int32_t SetAuthPinCode(const std::string &pkgName, const std::string &pinCode); ++ + /** + * @tc.name: DeviceManagerService::LoadHardwareFwkService + * @tc.desc: LoadHardwareFwkService +diff --git a/services/service/include/idevice_manager_service_listener.h b/services/service/include/idevice_manager_service_listener.h +index 13afa6e3..0a905c5f 100644 +--- a/services/service/include/idevice_manager_service_listener.h ++++ b/services/service/include/idevice_manager_service_listener.h +@@ -91,6 +91,8 @@ public: + * @tc.type: FUNC + */ + virtual void OnCredentialResult(const std::string &pkgName, int32_t action, const std::string &resultInfo); ++ ++ virtual void OnGeneratePinCode(const std::string &pkgName, const std::string &pinCode); + }; + } // namespace DistributedHardware + } // namespace OHOS +diff --git a/services/service/src/device_manager_service.cpp b/services/service/src/device_manager_service.cpp +index 904bca7c..77ba800e 100755 +--- a/services/service/src/device_manager_service.cpp ++++ b/services/service/src/device_manager_service.cpp +@@ -464,6 +464,19 @@ int32_t DeviceManagerService::NotifyEvent(const std::string &pkgName, const int3 + return dmServiceImpl_->NotifyEvent(pkgName, eventId, event); + } + ++int32_t DeviceManagerService::SetAuthPinCode(const std::string &pkgName, const std::string &pinCode) ++{ ++ if (pkgName.empty() || pinCode.empty()) { ++ LOGE("DeviceManagerService::SetAuthPinCode error: Invalid parameter, pkgName: %s", pkgName.c_str()); ++ return ERR_DM_INPUT_PARA_INVALID; ++ } ++ if (!IsDMServiceImplReady()) { ++ LOGE("SetAuthPinCode failed, instance not init or init failed."); ++ return ERR_DM_NOT_INIT; ++ } ++ return dmServiceImpl_->SetAuthPinCode(pkgName, pinCode); ++} ++ + void DeviceManagerService::LoadHardwareFwkService() + { + std::string extra; +diff --git a/services/service/src/device_manager_service_listener.cpp b/services/service/src/device_manager_service_listener.cpp +index 567b427c..00eb18dc 100644 +--- a/services/service/src/device_manager_service_listener.cpp ++++ b/services/service/src/device_manager_service_listener.cpp +@@ -13,6 +13,9 @@ + * limitations under the License. + */ + ++#include ++#include ++ + #include "device_manager_service_listener.h" + + #include "dm_constants.h" +@@ -24,6 +27,7 @@ + #include "ipc_notify_discover_result_req.h" + #include "ipc_notify_publish_result_req.h" + #include "ipc_notify_verify_auth_result_req.h" ++#include "ipc_set_auth_pincode_req.h" + + namespace OHOS { + namespace DistributedHardware { +@@ -107,6 +111,16 @@ void DeviceManagerServiceListener::OnAuthResult(const std::string &pkgName, cons + ipcServerListener_.SendRequest(SERVER_AUTH_RESULT, pReq, pRsp); + } + ++void DeviceManagerServiceListener::OnGeneratePinCode(const std::string &pkgName, const std::string &pinCode) ++{ ++ std::shared_ptr pReq = std::make_shared(); ++ std::shared_ptr pRsp = std::make_shared(); ++ ++ pReq->SetPkgName(pkgName); ++ pReq->SetPinCode(pinCode); ++ ipcServerListener_.SendRequest(GENERATE_PINCODE, pReq, pRsp); ++} ++ + void DeviceManagerServiceListener::OnVerifyAuthResult(const std::string &pkgName, const std::string &deviceId, + int32_t resultCode, const std::string &flag) + { +diff --git a/services/service/src/ipc/lite/ipc_server_listener.cpp b/services/service/src/ipc/lite/ipc_server_listener.cpp +index 0f9b186b..efb467c5 100644 +--- a/services/service/src/ipc/lite/ipc_server_listener.cpp ++++ b/services/service/src/ipc/lite/ipc_server_listener.cpp +@@ -1,95 +1,95 @@ +-/* +- * Copyright (c) 2022 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. +- */ ++// /* ++// * Copyright (c) 2022 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. ++// */ + +-#include "ipc_server_listener.h" ++// #include "ipc_server_listener.h" + +-#include "dm_constants.h" +-#include "dm_log.h" +-#include "ipc_cmd_register.h" +-#include "ipc_def.h" +-#include "ipc_server_listenermgr.h" ++// #include "dm_constants.h" ++// #include "dm_log.h" ++// #include "ipc_cmd_register.h" ++// #include "ipc_def.h" ++// #include "ipc_server_listenermgr.h" + +-namespace OHOS { +-namespace DistributedHardware { +-void IpcServerListener::CommonSvcToIdentity(CommonSvcId *svcId, SvcIdentity *identity) +-{ +- identity->handle = svcId->handle; +- identity->token = svcId->token; +- identity->cookie = svcId->cookie; +-} ++// namespace OHOS { ++// namespace DistributedHardware { ++// void IpcServerListener::CommonSvcToIdentity(CommonSvcId *svcId, SvcIdentity *identity) ++// { ++// identity->handle = svcId->handle; ++// identity->token = svcId->token; ++// identity->cookie = svcId->cookie; ++// } + +-int32_t IpcServerListener::GetIdentityByPkgName(std::string &name, SvcIdentity *svc) +-{ +- CommonSvcId svcId; +- if (IpcServerListenermgr::GetInstance().GetListenerByPkgName(name, &svcId) != DM_OK) { +- LOGE("get identity failed."); +- return ERR_DM_FAILED; +- } +- CommonSvcToIdentity(&svcId, svc); +- return DM_OK; +-} ++// int32_t IpcServerListener::GetIdentityByPkgName(std::string &name, SvcIdentity *svc) ++// { ++// CommonSvcId svcId; ++// if (IpcServerListenermgr::GetInstance().GetListenerByPkgName(name, &svcId) != DM_OK) { ++// LOGE("get identity failed."); ++// return ERR_DM_FAILED; ++// } ++// CommonSvcToIdentity(&svcId, svc); ++// return DM_OK; ++// } + +-int32_t IpcServerListener::SendRequest(int32_t cmdCode, std::shared_ptr req, std::shared_ptr rsp) +-{ +- std::string pkgName = req->GetPkgName(); +- SvcIdentity svc; +- if (GetIdentityByPkgName(pkgName, &svc) != DM_OK) { +- LOGE("OnDeviceFound callback get listener failed."); +- return ERR_DM_FAILED; +- } ++// int32_t IpcServerListener::SendRequest(int32_t cmdCode, std::shared_ptr req, std::shared_ptr rsp) ++// { ++// std::string pkgName = req->GetPkgName(); ++// SvcIdentity svc; ++// if (GetIdentityByPkgName(pkgName, &svc) != DM_OK) { ++// LOGE("OnDeviceFound callback get listener failed."); ++// return ERR_DM_FAILED; ++// } + +- IpcIo io; +- uint8_t data[MAX_DM_IPC_LEN] = {0}; +- if (IpcCmdRegister::GetInstance().SetRequest(cmdCode, req, io, data, MAX_DM_IPC_LEN) != DM_OK) { +- LOGE("SetRequest failed cmdCode:%d", cmdCode); +- return ERR_DM_FAILED; +- } ++// IpcIo io; ++// uint8_t data[MAX_DM_IPC_LEN] = {0}; ++// if (IpcCmdRegister::GetInstance().SetRequest(cmdCode, req, io, data, MAX_DM_IPC_LEN) != DM_OK) { ++// LOGE("SetRequest failed cmdCode:%d", cmdCode); ++// return ERR_DM_FAILED; ++// } + +- MessageOption option; +- MessageOptionInit(&option); +- option.flags = TF_OP_ASYNC; +- if (::SendRequest(svc, cmdCode, &io, nullptr, option, nullptr) != DM_OK) { +- LOGI("SendRequest failed cmdCode:%d", cmdCode); +- } +- return DM_OK; +-} ++// MessageOption option; ++// MessageOptionInit(&option); ++// option.flags = TF_OP_ASYNC; ++// if (::SendRequest(svc, cmdCode, &io, nullptr, option, nullptr) != DM_OK) { ++// LOGI("SendRequest failed cmdCode:%d", cmdCode); ++// } ++// return DM_OK; ++// } + +-int32_t IpcServerListener::SendAll(int32_t cmdCode, std::shared_ptr req, std::shared_ptr rsp) +-{ +- const std::map &listenerMap = IpcServerListenermgr::GetInstance().GetAllListeners(); +- for (const auto &kv : listenerMap) { +- SvcIdentity svc; +- IpcIo io; +- uint8_t data[MAX_DM_IPC_LEN] = {0}; +- std::string pkgName = kv.first; ++// int32_t IpcServerListener::SendAll(int32_t cmdCode, std::shared_ptr req, std::shared_ptr rsp) ++// { ++// const std::map &listenerMap = IpcServerListenermgr::GetInstance().GetAllListeners(); ++// for (const auto &kv : listenerMap) { ++// SvcIdentity svc; ++// IpcIo io; ++// uint8_t data[MAX_DM_IPC_LEN] = {0}; ++// std::string pkgName = kv.first; + +- req->SetPkgName(pkgName); +- if (IpcCmdRegister::GetInstance().SetRequest(cmdCode, req, io, data, MAX_DM_IPC_LEN) != DM_OK) { +- LOGE("SetRequest failed cmdCode:%d", cmdCode); +- continue; +- } +- CommonSvcId svcId = kv.second; +- CommonSvcToIdentity(&svcId, &svc); +- MessageOption option; +- MessageOptionInit(&option); +- option.flags = TF_OP_ASYNC; +- if (::SendRequest(svc, cmdCode, &io, nullptr, option, nullptr) != DM_OK) { +- LOGI("SendRequest failed cmdCode:%d", cmdCode); +- } +- } +- return DM_OK; +-} +-} // namespace DistributedHardware +-} // namespace OHOS ++// req->SetPkgName(pkgName); ++// if (IpcCmdRegister::GetInstance().SetRequest(cmdCode, req, io, data, MAX_DM_IPC_LEN) != DM_OK) { ++// LOGE("SetRequest failed cmdCode:%d", cmdCode); ++// continue; ++// } ++// CommonSvcId svcId = kv.second; ++// CommonSvcToIdentity(&svcId, &svc); ++// MessageOption option; ++// MessageOptionInit(&option); ++// option.flags = TF_OP_ASYNC; ++// if (::SendRequest(svc, cmdCode, &io, nullptr, option, nullptr) != DM_OK) { ++// LOGI("SendRequest failed cmdCode:%d", cmdCode); ++// } ++// } ++// return DM_OK; ++// } ++// } // namespace DistributedHardware ++// } // namespace OHOS +diff --git a/services/service/src/ipc/standard/ipc_cmd_parser.cpp b/services/service/src/ipc/standard/ipc_cmd_parser.cpp +index 66ccd01e..baf170ea 100644 +--- a/services/service/src/ipc/standard/ipc_cmd_parser.cpp ++++ b/services/service/src/ipc/standard/ipc_cmd_parser.cpp +@@ -30,6 +30,7 @@ + #include "ipc_notify_discover_result_req.h" + #include "ipc_notify_publish_result_req.h" + #include "ipc_notify_verify_auth_result_req.h" ++#include "ipc_set_auth_pincode_req.h" + #include "ipc_server_stub.h" + + namespace OHOS { +@@ -642,6 +643,18 @@ ON_IPC_CMD(NOTIFY_EVENT, MessageParcel &data, MessageParcel &reply) + return DM_OK; + } + ++ON_IPC_CMD(SET_AUTH_PINCODE, MessageParcel &data, MessageParcel &reply) ++{ ++ std::string pkgName = data.ReadString(); ++ std::string pinCode = data.ReadString(); ++ int32_t result = DeviceManagerService::GetInstance().SetAuthPinCode(pkgName, pinCode); ++ if (!reply.WriteInt32(result)) { ++ LOGE("write result failed"); ++ return ERR_DM_IPC_WRITE_FAILED; ++ } ++ return DM_OK; ++} ++ + ON_IPC_SET_REQUEST(SERVER_CREDENTIAL_RESULT, std::shared_ptr pBaseReq, MessageParcel &data) + { + if (pBaseReq == nullptr) { +@@ -676,5 +689,27 @@ ON_IPC_READ_RESPONSE(SERVER_CREDENTIAL_RESULT, MessageParcel &reply, std::shared + pBaseRsp->SetErrCode(reply.ReadInt32()); + return DM_OK; + } ++ ++ON_IPC_SET_REQUEST(GENERATE_PINCODE, std::shared_ptr pBaseReq, MessageParcel &data) ++{ ++ std::shared_ptr pReq = std::static_pointer_cast(pBaseReq); ++ std::string pkgName = pReq->GetPkgName(); ++ std::string pinCode = pReq->GetPinCode(); ++ if (!data.WriteString(pkgName)) { ++ LOGE("write pkgName failed"); ++ return ERR_DM_IPC_WRITE_FAILED; ++ } ++ if (!data.WriteString(pinCode)) { ++ LOGE("write pinCode failed"); ++ return ERR_DM_IPC_WRITE_FAILED; ++ } ++ return DM_OK; ++} ++ ++ON_IPC_READ_RESPONSE(GENERATE_PINCODE, MessageParcel &reply, std::shared_ptr pBaseRsp) ++{ ++ pBaseRsp->SetErrCode(reply.ReadInt32()); ++ return DM_OK; ++} + } // namespace DistributedHardware + } // namespace OHOS +diff --git a/test/BUILD.gn b/test/BUILD.gn +index da8df87e..69bdd8f1 100644 +--- a/test/BUILD.gn ++++ b/test/BUILD.gn +@@ -15,11 +15,11 @@ group("test") { + testonly = true + + deps = [] +- if (support_jsapi) { ++ # if (support_jsapi) { + deps += [ + "benchmarktest:benchmarktest", + "fuzztest:fuzztest", + "unittest:unittest", + ] +- } ++ # } + } +diff --git a/test/fuzztest/dmcommoneventmanager_fuzzer/BUILD.gn b/test/fuzztest/dmcommoneventmanager_fuzzer/BUILD.gn +index 997596f2..a7dda4f8 100644 +--- a/test/fuzztest/dmcommoneventmanager_fuzzer/BUILD.gn ++++ b/test/fuzztest/dmcommoneventmanager_fuzzer/BUILD.gn +@@ -57,7 +57,7 @@ ohos_fuzztest("DmCommonEventManagerFuzzTest") { + ] + + external_deps = [ +- # "ability_base:want", ++ "ability_base:want", + "c_utils:utils", + "common_event_service:cesfwk_core", + "common_event_service:cesfwk_innerkits", +diff --git a/test/fuzztest/dmdiscoverymanager_fuzzer/BUILD.gn b/test/fuzztest/dmdiscoverymanager_fuzzer/BUILD.gn +index 64b5f7bf..a183baab 100644 +--- a/test/fuzztest/dmdiscoverymanager_fuzzer/BUILD.gn ++++ b/test/fuzztest/dmdiscoverymanager_fuzzer/BUILD.gn +@@ -56,7 +56,7 @@ ohos_fuzztest("DmDiscoveryManagerFuzzTest") { + ] + + external_deps = [ +- # "ability_base:want", ++ "ability_base:want", + "c_utils:utils", + "common_event_service:cesfwk_core", + "common_event_service:cesfwk_innerkits", +diff --git a/test/fuzztest/pinauth_fuzzer/BUILD.gn b/test/fuzztest/pinauth_fuzzer/BUILD.gn +index 5d9e7b8c..a37f310f 100644 +--- a/test/fuzztest/pinauth_fuzzer/BUILD.gn ++++ b/test/fuzztest/pinauth_fuzzer/BUILD.gn +@@ -92,7 +92,7 @@ ohos_fuzztest("PinAuthFuzzTest") { + ] + + external_deps = [ +- # "ability_base:want", ++ "ability_base:want", + "init:libbegetutil", + ] + } +diff --git a/test/fuzztest/pinauthui_fuzzer/BUILD.gn b/test/fuzztest/pinauthui_fuzzer/BUILD.gn +index dd56d78e..5de26477 100644 +--- a/test/fuzztest/pinauthui_fuzzer/BUILD.gn ++++ b/test/fuzztest/pinauthui_fuzzer/BUILD.gn +@@ -92,7 +92,7 @@ ohos_fuzztest("PinAuthUiFuzzTest") { + ] + + external_deps = [ +- # "ability_base:want", ++ "ability_base:want", + "init:libbegetutil", + ] + } +diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn +index cae3a92b..b154fdfb 100644 +--- a/test/unittest/BUILD.gn ++++ b/test/unittest/BUILD.gn +@@ -178,8 +178,8 @@ ohos_unittest("UTTest_softbus_connector") { + deps = [ ":device_manager_test_common" ] + + external_deps = [ +- # "hisysevent_native:libhisysevent", +- # "hitrace_native:hitrace_meter", ++ "hisysevent_native:libhisysevent", ++ "hitrace_native:hitrace_meter", + ] + } + +@@ -194,8 +194,8 @@ ohos_unittest("UTTest_softbus_session") { + deps = [ ":device_manager_test_common" ] + + external_deps = [ +- # "hisysevent_native:libhisysevent", +- # "hitrace_native:hitrace_meter", ++ "hisysevent_native:libhisysevent", ++ "hitrace_native:hitrace_meter", + ] + } + +@@ -367,8 +367,8 @@ ohos_unittest("UTTest_dm_device_state_manager") { + deps = [ ":device_manager_test_common" ] + + external_deps = [ +- # "hisysevent_native:libhisysevent", +- # "hitrace_native:hitrace_meter", ++ "hisysevent_native:libhisysevent", ++ "hitrace_native:hitrace_meter", + ] + } + +@@ -504,7 +504,7 @@ ohos_unittest("UTTest_dm_discovery_manager") { + + deps = [ ":device_manager_test_common" ] + +- # external_deps = [ "hitrace_native:hitrace_meter" ] ++ external_deps = [ "hitrace_native:hitrace_meter" ] + } + + ## UnitTest UTTest_dm_discovery_manager }}} +@@ -528,7 +528,7 @@ ohos_unittest("UTTest_dm_publish_manager") { + + deps = [ ":device_manager_test_common" ] + +- # external_deps = [ "hitrace_native:hitrace_meter" ] ++ external_deps = [ "hitrace_native:hitrace_meter" ] + } + + ## UnitTest UTTest_dm_publish_manager }}} +@@ -642,15 +642,15 @@ ohos_static_library("device_manager_test_common") { + } + + external_deps = [ +- # "ability_base:want", +- #"bundle_framework:appexecfwk_base", +- #"bundle_framework:appexecfwk_core", ++ "ability_base:want", ++ "bundle_framework:appexecfwk_base", ++ "bundle_framework:appexecfwk_core", + "common_event_service:cesfwk_core", + "common_event_service:cesfwk_innerkits", + "dsoftbus:softbus_client", + "eventhandler:libeventhandler", +- # "hisysevent_native:libhisysevent", +- # "hitrace_native:hitrace_meter", ++ "hisysevent_native:libhisysevent", ++ "hitrace_native:hitrace_meter", + "hiviewdfx_hilog_native:libhilog", + "init:libbegetutil", + "ipc:ipc_core", +diff --git a/test/unittest/UTTest_dm_dfx.h b/test/unittest/UTTest_dm_dfx.h +index d20b9b8f..8bba3789 100644 +--- a/test/unittest/UTTest_dm_dfx.h ++++ b/test/unittest/UTTest_dm_dfx.h +@@ -29,7 +29,7 @@ + #undef private + #include "dm_hisysevent.h" + #include "dm_hitrace.h" +-// #include "hitrace_meter.h" ++#include "hitrace_meter.h" + + namespace OHOS { + namespace DistributedHardware { +diff --git a/utils/BUILD.gn b/utils/BUILD.gn +index 59e9e9bd..16b2058c 100644 +--- a/utils/BUILD.gn ++++ b/utils/BUILD.gn +@@ -163,12 +163,12 @@ if (defined(ohos_lite)) { + "${common_path}/src/ipc/standard/ipc_cmd_register.cpp", + "src/dm_random.cpp", + ] +- if (support_jsapi) { ++ # if (support_jsapi) { + sources += [ + "src/fwkload/standard/dm_distributed_hardware_load.cpp", + "src/permission/standard/permission_manager.cpp", + ] +- } ++ # } + + public_configs = [ ":devicemanagerutils_config" ] + +@@ -183,15 +183,15 @@ if (defined(ohos_lite)) { + external_deps = [ + # "access_token:libaccesstoken_sdk", + "c_utils:utils", +- # # "hisysevent_native:libhisysevent", ++ # "hisysevent_native:libhisysevent", + # "hitrace_native:hitrace_meter", + "hiviewdfx_hilog_native:libhilog", + "ipc:ipc_core", + "samgr:samgr_proxy", + ] +- if (support_jsapi) { +- external_deps += [ "bundle_framework:appexecfwk_core" ] +- } ++ # if (support_jsapi) { ++ # external_deps += [ "bundle_framework:appexecfwk_core" ] ++ # } + + subsystem_name = "distributedhardware" + +diff --git a/utils/src/permission/standard/permission_manager.cpp b/utils/src/permission/standard/permission_manager.cpp +index e3de417b..2ee224aa 100644 +--- a/utils/src/permission/standard/permission_manager.cpp ++++ b/utils/src/permission/standard/permission_manager.cpp +@@ -15,24 +15,24 @@ + + #include "permission_manager.h" + +-#include "bundle_constants.h" +-#include "bundle_info.h" +-#include "bundle_mgr_client.h" +-#include "bundle_mgr_interface.h" +-#include "bundle_mgr_proxy.h" ++// #include "bundle_constants.h" ++// #include "bundle_info.h" ++// #include "bundle_mgr_client.h" ++// #include "bundle_mgr_interface.h" ++// #include "bundle_mgr_proxy.h" + #include "if_system_ability_manager.h" + #include "iservice_registry.h" + #include "system_ability_definition.h" + #include "ipc_skeleton.h" + // #include "access_token.h" +-#include "hap_token_info.h" +-#include "native_token_info.h" +-#include "accesstoken_kit.h" ++// #include "hap_token_info.h" ++// #include "native_token_info.h" ++// #include "accesstoken_kit.h" + #include "dm_log.h" + +-using namespace OHOS::AppExecFwk; +-using namespace OHOS::AppExecFwk::Constants; +-using namespace OHOS::Security::AccessToken; ++// using namespace OHOS::AppExecFwk; ++// using namespace OHOS::AppExecFwk::Constants; ++// using namespace OHOS::Security::AccessToken; + + namespace OHOS { + namespace DistributedHardware { +@@ -40,49 +40,50 @@ IMPLEMENT_SINGLE_INSTANCE(PermissionManager); + + bool PermissionManager::CheckPermission(void) + { +- LOGI("Enter PermissionManager::CheckPermission"); +- AccessTokenID tokenCaller = IPCSkeleton::GetCallingTokenID(); +- if (tokenCaller == 0) { +- LOGI("PermissionManager::tokenCaller == 0"); +- return false; +- } +- LOGI("PermissionManager::tokenCaller ID == %d", tokenCaller); ++ // LOGI("Enter PermissionManager::CheckPermission"); ++ // AccessTokenID tokenCaller = IPCSkeleton::GetCallingTokenID(); ++ // if (tokenCaller == 0) { ++ // LOGI("PermissionManager::tokenCaller == 0"); ++ // return false; ++ // } ++ // LOGI("PermissionManager::tokenCaller ID == %d", tokenCaller); + +- ATokenTypeEnum tokenTypeFlag = AccessTokenKit::GetTokenTypeFlag(tokenCaller); +- if (tokenTypeFlag == ATokenTypeEnum::TOKEN_HAP) { +- int32_t uid = IPCSkeleton::GetCallingUid(); +- if (uid < 0) { +- LOGI("app caller uid is: %d,", uid); +- return false; +- } ++ // ATokenTypeEnum tokenTypeFlag = AccessTokenKit::GetTokenTypeFlag(tokenCaller); ++ // if (tokenTypeFlag == ATokenTypeEnum::TOKEN_HAP) { ++ // int32_t uid = IPCSkeleton::GetCallingUid(); ++ // if (uid < 0) { ++ // LOGI("app caller uid is: %d,", uid); ++ // return false; ++ // } + +- sptr systemAbilityManager = +- SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); +- if (systemAbilityManager == nullptr) { +- LOGE("failed to get system ability mgr."); +- return false; +- } +- sptr remoteObject = systemAbilityManager->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID); +- if (remoteObject == nullptr) { +- LOGE("failed to get bundle manager proxy."); +- return false; +- } ++ // sptr systemAbilityManager = ++ // SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); ++ // if (systemAbilityManager == nullptr) { ++ // LOGE("failed to get system ability mgr."); ++ // return false; ++ // } ++ // sptr remoteObject = systemAbilityManager->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID); ++ // if (remoteObject == nullptr) { ++ // LOGE("failed to get bundle manager proxy."); ++ // return false; ++ // } + +- LOGI("get bundle manager proxy success."); +- sptr iBundleMgr = iface_cast(remoteObject); +- if (iBundleMgr == nullptr) { +- LOGI("iBundleMgr is nullptr, caller may be a process"); +- return false; +- } +- LOGI("PermissionManager::tokenTypeFlag is hap process"); +- return iBundleMgr->CheckIsSystemAppByUid(uid); +- } else if (tokenTypeFlag == ATokenTypeEnum::TOKEN_NATIVE || tokenTypeFlag == ATokenTypeEnum::TOKEN_SHELL) { +- LOGI("PermissionManager::tokenTypeFlag is native process"); +- return true; +- } else { +- LOGI("PermissionManager::invalid tokenTypeFlag"); +- return false; +- } ++ // LOGI("get bundle manager proxy success."); ++ // sptr iBundleMgr = iface_cast(remoteObject); ++ // if (iBundleMgr == nullptr) { ++ // LOGI("iBundleMgr is nullptr, caller may be a process"); ++ // return false; ++ // } ++ // LOGI("PermissionManager::tokenTypeFlag is hap process"); ++ // return iBundleMgr->CheckIsSystemAppByUid(uid); ++ // } else if (tokenTypeFlag == ATokenTypeEnum::TOKEN_NATIVE || tokenTypeFlag == ATokenTypeEnum::TOKEN_SHELL) { ++ // LOGI("PermissionManager::tokenTypeFlag is native process"); ++ // return true; ++ // } else { ++ // LOGI("PermissionManager::invalid tokenTypeFlag"); ++ // return false; ++ // } ++ return true; + } + } // namespace DistributedHardware + } // namespace OHOS +-- +2.33.0 + diff --git a/device_manager.spec b/device_manager.spec index 6f87954683cb1c3b975e4d91f033924328a5d001..0faf4eb24068a0691ff228de73425e81026fbc48 100644 --- a/device_manager.spec +++ b/device_manager.spec @@ -8,7 +8,7 @@ Name: distributedhardware_device_manager Version: 1.0.0 -Release: 2 +Release: 4 Summary: Distributed middleware used components. License: Apache-2.0 Url: https://gitee.com/openharmony/ @@ -19,6 +19,8 @@ Source4: device_manager.BUILD.gn Source5: device_manager.xml Patch1: 0001-remove-dependency-and-adapt-for-build-device_manager.patch +Patch2: 0002-device-manager-only-support-for-network.patch +Patch3: 0003-enable-pincode-for-device-manager.patch BuildRequires: gcc, make, hilog, kernel-devel, uname-build-checks BuildRequires: distributed-build, distributed-beget @@ -52,6 +54,8 @@ cp -rf %{_builddir}/build/openeuler/compiler_gn/* %{_builddir} %setup -q -D -T -a 1 -c -n %{distributedhardware_dir}/ %patch -P1 -p1 -d %{distributedhardware_dir}/device_manager +%patch -P2 -p1 -d %{distributedhardware_dir}/device_manager +%patch -P3 -p1 -d %{distributedhardware_dir}/device_manager %setup -q -D -T -a 2 -c -n %{third_party_dir}/ @@ -114,6 +118,12 @@ ln -s /usr/include/device_manager %{buildroot}%{build_opt}/openeuler/compiler_gn /system/* %changelog +* Wed Mar 27 2024 tianhang - 1.0.0-4 +- enable pincode for openeuler + +* Tue Mar 26 2024 tianhang - 1.0.0-3 +- the auto parameter in device manager may cause the softbus to be abnormal + * Fri Dec 15 2023 heppen - 1.0.0-2 - Add SA profile