From f1e9472ee726fdb23b606a5e900974e766aa31fe Mon Sep 17 00:00:00 2001 From: yangwei_814916 Date: Sat, 22 Feb 2025 01:46:30 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=B6=E5=BA=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangwei_814916 --- interfaces/kits/js4.0/src/dm_native_util.cpp | 3 -- .../src/authentication/dm_auth_manager.cpp | 28 +++++++++++-------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/interfaces/kits/js4.0/src/dm_native_util.cpp b/interfaces/kits/js4.0/src/dm_native_util.cpp index 8b08c668a..711ebe4c5 100644 --- a/interfaces/kits/js4.0/src/dm_native_util.cpp +++ b/interfaces/kits/js4.0/src/dm_native_util.cpp @@ -327,8 +327,6 @@ void JsToBindParam(const napi_env &env, const napi_value &object, std::string &b JsObjectToString(env, object, "targetPkgName", targetPkgName, sizeof(targetPkgName)); char metaType[DM_NAPI_BUF_LENGTH] = ""; JsObjectToString(env, object, "metaType", metaType, sizeof(metaType)); - char peerBundleName[DM_NAPI_BUF_LENGTH] = ""; - JsObjectToString(env, object, "peerBundleName", peerBundleName, sizeof(peerBundleName)); std::string metaTypeStr = metaType; isMetaType = !metaTypeStr.empty(); @@ -356,7 +354,6 @@ void JsToBindParam(const napi_env &env, const napi_value &object, std::string &b jsonObj[CUSTOM_DESCRIPTION] = std::string(customDescription); jsonObj[PARAM_KEY_TARGET_PKG_NAME] = std::string(targetPkgName); jsonObj[PARAM_KEY_META_TYPE] = metaTypeStr; - jsonObj[PARAM_KEY_PEER_BUNDLE_NAME] = std::string(peerBundleName); jsonObj[PARAM_KEY_PIN_CODE] = std::string(pinCode); jsonObj[PARAM_KEY_AUTH_TOKEN] = std::string(authToken); jsonObj[PARAM_KEY_IS_SHOW_TRUST_DIALOG] = std::string(isShowTrustDialog); diff --git a/services/implementation/src/authentication/dm_auth_manager.cpp b/services/implementation/src/authentication/dm_auth_manager.cpp index 1d284dab3..7c03b84a0 100644 --- a/services/implementation/src/authentication/dm_auth_manager.cpp +++ b/services/implementation/src/authentication/dm_auth_manager.cpp @@ -104,6 +104,7 @@ constexpr const char* DM_VERSION_4_1_5_1 = "4.1.5.1"; constexpr const char* DM_VERSION_5_0_1 = "5.0.1"; constexpr const char* DM_VERSION_5_0_2 = "5.0.2"; constexpr const char* DM_VERSION_5_0_3 = "5.0.3"; +constexpr const char* DM_VERSION_5_0_4 = "5.0.4"; std::mutex g_authFinishLock; DmAuthManager::DmAuthManager(std::shared_ptr softbusConnector, @@ -119,7 +120,7 @@ DmAuthManager::DmAuthManager(std::shared_ptr softbusConnector, authUiStateMgr_ = std::make_shared(listener_); authenticationMap_[AUTH_TYPE_IMPORT_AUTH_CODE] = nullptr; authenticationMap_[AUTH_TYPE_CRE] = nullptr; - dmVersion_ = DM_VERSION_5_0_3; + dmVersion_ = DM_VERSION_5_0_4; } DmAuthManager::~DmAuthManager() @@ -230,7 +231,7 @@ void DmAuthManager::GetAuthParam(const std::string &pkgName, int32_t authType, authRequestContext_->localDeviceId = localUdid; authRequestContext_->deviceId = deviceId; authRequestContext_->addr = deviceId; - authRequestContext_->dmVersion = DM_VERSION_5_0_3; + authRequestContext_->dmVersion = DM_VERSION_5_0_4; uint32_t tokenId = 0 ; MultipleUserConnector::GetTokenIdAndForegroundUserId(tokenId, authRequestContext_->localUserId); authRequestContext_->tokenId = static_cast(tokenId); @@ -861,7 +862,7 @@ void DmAuthManager::StartNegotiate(const int32_t &sessionId) authResponseContext_->localAccountId = authRequestContext_->localAccountId; authResponseContext_->localUserId = authRequestContext_->localUserId; authResponseContext_->isIdenticalAccount = false; - authResponseContext_->edition = DM_VERSION_5_0_3; + authResponseContext_->edition = DM_VERSION_5_0_4; authMessageProcessor_->SetResponseContext(authResponseContext_); std::string message = authMessageProcessor_->CreateSimpleMessage(MSG_TYPE_NEGOTIATE); softbusConnector_->GetSoftbusSession()->SendData(sessionId, message); @@ -885,7 +886,8 @@ void DmAuthManager::AbilityNegotiate() CompatiblePutAcl(); } authResponseContext_->reply = ERR_DM_AUTH_PEER_REJECT; - if (authResponseContext_->authType == AUTH_TYPE_IMPORT_AUTH_CODE && !importAuthCode_.empty()) { + if (!CompareVersion(remoteVersion_, std::string(DM_VERSION_5_0_3)) && + authResponseContext_->authType == AUTH_TYPE_IMPORT_AUTH_CODE && !importAuthCode_.empty()) { authResponseContext_->importAuthCode = Crypto::Sha256(importAuthCode_); } } else { @@ -1043,20 +1045,22 @@ void DmAuthManager::GetAuthRequestContext() void DmAuthManager::ProcessAuthRequestExt(const int32_t &sessionId) { LOGI("ProcessAuthRequestExt start."); - if (authResponseContext_->authType == AUTH_TYPE_IMPORT_AUTH_CODE && + if (!CompareVersion(remoteVersion_, std::string(DM_VERSION_5_0_3)) && + authResponseContext_->authType == AUTH_TYPE_IMPORT_AUTH_CODE && !authResponseContext_->importAuthCode.empty() && !importAuthCode_.empty()) { if (authResponseContext_->importAuthCode != Crypto::Sha256(importAuthCode_)) { SetReasonAndFinish(ERR_DM_AUTH_CODE_INCORRECT, AuthState::AUTH_REQUEST_FINISH); return; } - } + } GetAuthRequestContext(); std::vector bindType = DeviceProfileConnector::GetInstance().SyncAclByBindType(authResponseContext_->hostPkgName, authResponseContext_->bindType, authResponseContext_->localDeviceId, authResponseContext_->deviceId); authResponseContext_->authed = !bindType.empty(); - if (authResponseContext_->isOnline && authResponseContext_->authed && + if (!CompareVersion(remoteVersion_, std::string(DM_VERSION_5_0_3)) && + authResponseContext_->isOnline && authResponseContext_->authed && authResponseContext_->authType == AUTH_TYPE_IMPORT_AUTH_CODE && (authResponseContext_->importAuthCode.empty() || importAuthCode_.empty())) { SetReasonAndFinish(ERR_DM_AUTH_CODE_INCORRECT, AuthState::AUTH_REQUEST_FINISH); @@ -1088,7 +1092,7 @@ bool DmAuthManager::IsAuthFinish() authRequestState_->TransitionTo(std::make_shared()); return true; } - + if ((authResponseContext_->isIdenticalAccount && !authResponseContext_->authed) || (authResponseContext_->authed && !authResponseContext_->isOnline)) { softbusConnector_->JoinLnn(authRequestContext_->addr); @@ -2326,7 +2330,7 @@ void DmAuthManager::ProcRespNegotiateExt(const int32_t &sessionId) authResponseContext_->localDeviceId, authResponseContext_->deviceId); authResponseContext_->authed = !authResponseContext_->bindType.empty(); if (authResponseContext_->authed && authResponseContext_->authType == AUTH_TYPE_IMPORT_AUTH_CODE && - !importAuthCode_.empty()) { + !importAuthCode_.empty() && !CompareVersion(remoteVersion_, std::string(DM_VERSION_5_0_3))) { authResponseContext_->importAuthCode = Crypto::Sha256(importAuthCode_); } @@ -2821,14 +2825,14 @@ void DmAuthManager::ConverToFinish() void DmAuthManager::RequestReCheckMsg() { - LOGI("dmVersion %{public}s.", DM_VERSION_5_0_3); + LOGI("dmVersion %{public}s.", DM_VERSION_5_0_4); char localDeviceId[DEVICE_UUID_LENGTH] = {0}; GetDevUdid(localDeviceId, DEVICE_UUID_LENGTH); uint32_t tokenId = 0; int32_t localUserId = 0; MultipleUserConnector::GetTokenIdAndForegroundUserId(tokenId, localUserId); std::string localAccountId = MultipleUserConnector::GetOhosAccountIdByUserId(localUserId); - authResponseContext_->edition = DM_VERSION_5_0_3; + authResponseContext_->edition = DM_VERSION_5_0_4; authResponseContext_->localDeviceId = static_cast(localDeviceId); authResponseContext_->localUserId = localUserId; authResponseContext_->localAccountId = localAccountId; @@ -2855,7 +2859,7 @@ void DmAuthManager::ResponseReCheckMsg() } char localDeviceId[DEVICE_UUID_LENGTH] = {0}; GetDevUdid(localDeviceId, DEVICE_UUID_LENGTH); - authResponseContext_->edition = DM_VERSION_5_0_3; + authResponseContext_->edition = DM_VERSION_5_0_4; authResponseContext_->localDeviceId = std::string(localDeviceId); authResponseContext_->localUserId = MultipleUserConnector::GetFirstForegroundUserId(); authResponseContext_->localAccountId = -- Gitee From 9d8a162f484b93adee0976aba24b4dea97699304 Mon Sep 17 00:00:00 2001 From: yangwei_814916 Date: Sat, 22 Feb 2025 01:52:33 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=B6=E5=BA=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangwei_814916 --- services/implementation/src/authentication/dm_auth_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/implementation/src/authentication/dm_auth_manager.cpp b/services/implementation/src/authentication/dm_auth_manager.cpp index 7c03b84a0..d6b5b8530 100644 --- a/services/implementation/src/authentication/dm_auth_manager.cpp +++ b/services/implementation/src/authentication/dm_auth_manager.cpp @@ -1092,7 +1092,7 @@ bool DmAuthManager::IsAuthFinish() authRequestState_->TransitionTo(std::make_shared()); return true; } - + if ((authResponseContext_->isIdenticalAccount && !authResponseContext_->authed) || (authResponseContext_->authed && !authResponseContext_->isOnline)) { softbusConnector_->JoinLnn(authRequestContext_->addr); -- Gitee From 556212d2fde7e4c0508b065202abbd8318a7afa9 Mon Sep 17 00:00:00 2001 From: yangwei_814916 Date: Sat, 22 Feb 2025 01:57:19 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=B6=E5=BA=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangwei_814916 --- services/implementation/src/authentication/dm_auth_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/implementation/src/authentication/dm_auth_manager.cpp b/services/implementation/src/authentication/dm_auth_manager.cpp index d6b5b8530..31312c494 100644 --- a/services/implementation/src/authentication/dm_auth_manager.cpp +++ b/services/implementation/src/authentication/dm_auth_manager.cpp @@ -1052,7 +1052,7 @@ void DmAuthManager::ProcessAuthRequestExt(const int32_t &sessionId) SetReasonAndFinish(ERR_DM_AUTH_CODE_INCORRECT, AuthState::AUTH_REQUEST_FINISH); return; } - } + } GetAuthRequestContext(); std::vector bindType = -- Gitee From d47ca25afdad77e4a5419c6a1f94ac4114dae8a7 Mon Sep 17 00:00:00 2001 From: yangwei_814916 Date: Sat, 22 Feb 2025 10:40:22 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=B6=E5=BA=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangwei_814916 --- .../src/deviceprofile_connector.cpp | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/commondependency/src/deviceprofile_connector.cpp b/commondependency/src/deviceprofile_connector.cpp index 5d67e5518..e2f69bd29 100644 --- a/commondependency/src/deviceprofile_connector.cpp +++ b/commondependency/src/deviceprofile_connector.cpp @@ -249,11 +249,16 @@ int32_t DeviceProfileConnector::GetAuthForm(DistributedDeviceProfile::AccessCont std::vector DeviceProfileConnector::GetBindTypeByPkgName(std::string pkgName, std::string requestDeviceId, std::string trustUdid) { - LOGI("Start."); + LOGI("Start requestDeviceId %{public}s, trustUdid %{public}d.", GetAnonyString(requestDeviceId).c_str(), + GetAnonyString(trustUdid).c_str()); + std::vector bindTypeVec; + if (requestDeviceId.empty() || trustUdid.empty() || requestDeviceId == trustUdid) { + LOGE("Input udid param invalied."); + return bindTypeVec; + } std::vector profiles = GetAccessControlProfileByUserId(MultipleUserConnector::GetFirstForegroundUserId()); LOGI("AccessControlProfile size is %{public}zu", profiles.size()); - std::vector bindTypeVec; for (auto &item : profiles) { if (trustUdid != item.GetTrustDeviceId() || item.GetStatus() != ACTIVE) { continue; @@ -285,38 +290,35 @@ uint64_t DeviceProfileConnector::GetTokenIdByNameAndDeviceId(std::string pkgName void DeviceProfileConnector::GetParamBindTypeVec(AccessControlProfile profiles, std::string requestDeviceId, std::vector &bindTypeVec, std::string trustUdid) { - if (profiles.GetBindType() == DM_IDENTICAL_ACCOUNT) { - bindTypeVec.push_back(IDENTICAL_ACCOUNT_TYPE); + if (!(profiles.GetAccesser().GetAccesserDeviceId() == trustUdid && + profiles.GetAccessee().GetAccesseeDeviceId() == requestDeviceId) || + !(profiles.GetAccessee().GetAccesseeDeviceId() == trustUdid && + profiles.GetAccesser().GetAccesserDeviceId() == requestDeviceId)) { + LOGE("input udid param invalied."); + return; } - if (profiles.GetBindType() == DM_POINT_TO_POINT) { - if (profiles.GetBindLevel() == DEVICE) { - bindTypeVec.push_back(DEVICE_PEER_TO_PEER_TYPE); - } - if (profiles.GetBindLevel() == APP) { - if (profiles.GetAccesser().GetAccesserDeviceId() == trustUdid && - profiles.GetAccessee().GetAccesseeDeviceId() == requestDeviceId) { - bindTypeVec.push_back(APP_PEER_TO_PEER_TYPE); + uint32_t bindType = profiles.GetBindType(); + switch (bindType) { + case DM_IDENTICAL_ACCOUNT: + bindTypeVec.push_back(IDENTICAL_ACCOUNT_TYPE); + break; + case DM_POINT_TO_POINT: + if (profiles.GetBindLevel() == DEVICE) { + bindTypeVec.push_back(DEVICE_PEER_TO_PEER_TYPE); } - if (profiles.GetAccessee().GetAccesseeDeviceId() == trustUdid && - profiles.GetAccesser().GetAccesserDeviceId() == requestDeviceId) { + if (profiles.GetBindLevel() == APP) { bindTypeVec.push_back(APP_PEER_TO_PEER_TYPE); } - } - } - if (profiles.GetBindType() == DM_ACROSS_ACCOUNT) { - if (profiles.GetBindLevel() == DEVICE) { - bindTypeVec.push_back(DEVICE_ACROSS_ACCOUNT_TYPE); - } - if (profiles.GetBindLevel() == APP) { - if (profiles.GetAccesser().GetAccesserDeviceId() == trustUdid && - profiles.GetAccessee().GetAccesseeDeviceId() == requestDeviceId) { - bindTypeVec.push_back(APP_ACROSS_ACCOUNT_TYPE); + break; + case DM_POINT_TO_POINT: + if (profiles.GetBindLevel() == DEVICE) { + bindTypeVec.push_back(DEVICE_ACROSS_ACCOUNT_TYPE); } - if (profiles.GetAccessee().GetAccesseeDeviceId() == trustUdid && - profiles.GetAccesser().GetAccesserDeviceId() == requestDeviceId) { + if (profiles.GetBindLevel() == APP) { bindTypeVec.push_back(APP_ACROSS_ACCOUNT_TYPE); } - } + default: + break; } } -- Gitee From fd1302752d1b247aa0d56fd484d02c4a226038e6 Mon Sep 17 00:00:00 2001 From: yangwei_814916 Date: Sat, 22 Feb 2025 10:41:00 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=B6=E5=BA=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangwei_814916 --- commondependency/src/deviceprofile_connector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commondependency/src/deviceprofile_connector.cpp b/commondependency/src/deviceprofile_connector.cpp index e2f69bd29..2ad8f9b9c 100644 --- a/commondependency/src/deviceprofile_connector.cpp +++ b/commondependency/src/deviceprofile_connector.cpp @@ -251,7 +251,7 @@ std::vector DeviceProfileConnector::GetBindTypeByPkgName(std::string pk { LOGI("Start requestDeviceId %{public}s, trustUdid %{public}d.", GetAnonyString(requestDeviceId).c_str(), GetAnonyString(trustUdid).c_str()); - std::vector bindTypeVec; + std::vector bindTypeVec; if (requestDeviceId.empty() || trustUdid.empty() || requestDeviceId == trustUdid) { LOGE("Input udid param invalied."); return bindTypeVec; -- Gitee From 7f747f2e5ed720a626f6dc5882283a50ef255623 Mon Sep 17 00:00:00 2001 From: yangwei_814916 Date: Sat, 22 Feb 2025 10:43:22 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=B6=E5=BA=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangwei_814916 --- .../src/authentication/auth_message_processor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/implementation/src/authentication/auth_message_processor.cpp b/services/implementation/src/authentication/auth_message_processor.cpp index b67246a0b..dd1aa32fe 100644 --- a/services/implementation/src/authentication/auth_message_processor.cpp +++ b/services/implementation/src/authentication/auth_message_processor.cpp @@ -401,6 +401,8 @@ void AuthMessageProcessor::ParseResponseFinishMessage(nlohmann::json &json) void AuthMessageProcessor::GetAuthReqMessage(nlohmann::json &json) { + authResponseContext_->localDeviceId = ""; + authResponseContext_->deviceId = ""; if (IsInt32(json, TAG_AUTH_TYPE)) { authResponseContext_->authType = json[TAG_AUTH_TYPE].get(); } -- Gitee From 0c4e61349466e687e9450641c904e25b23bca294 Mon Sep 17 00:00:00 2001 From: yangwei_814916 Date: Sat, 22 Feb 2025 10:52:28 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=B6=E5=BA=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangwei_814916 --- commondependency/src/deviceprofile_connector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commondependency/src/deviceprofile_connector.cpp b/commondependency/src/deviceprofile_connector.cpp index 2ad8f9b9c..785cee489 100644 --- a/commondependency/src/deviceprofile_connector.cpp +++ b/commondependency/src/deviceprofile_connector.cpp @@ -249,7 +249,7 @@ int32_t DeviceProfileConnector::GetAuthForm(DistributedDeviceProfile::AccessCont std::vector DeviceProfileConnector::GetBindTypeByPkgName(std::string pkgName, std::string requestDeviceId, std::string trustUdid) { - LOGI("Start requestDeviceId %{public}s, trustUdid %{public}d.", GetAnonyString(requestDeviceId).c_str(), + LOGI("Start requestDeviceId %{public}s, trustUdid %{public}s.", GetAnonyString(requestDeviceId).c_str(), GetAnonyString(trustUdid).c_str()); std::vector bindTypeVec; if (requestDeviceId.empty() || trustUdid.empty() || requestDeviceId == trustUdid) { @@ -310,7 +310,7 @@ void DeviceProfileConnector::GetParamBindTypeVec(AccessControlProfile profiles, bindTypeVec.push_back(APP_PEER_TO_PEER_TYPE); } break; - case DM_POINT_TO_POINT: + case DM_ACROSS_ACCOUNT: if (profiles.GetBindLevel() == DEVICE) { bindTypeVec.push_back(DEVICE_ACROSS_ACCOUNT_TYPE); } -- Gitee From 696c3eda761350463d83e338c86de57dcaadf0c4 Mon Sep 17 00:00:00 2001 From: yangwei_814916 Date: Sat, 22 Feb 2025 11:03:47 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=B6=E5=BA=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangwei_814916 --- commondependency/src/deviceprofile_connector.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commondependency/src/deviceprofile_connector.cpp b/commondependency/src/deviceprofile_connector.cpp index 785cee489..7516318f5 100644 --- a/commondependency/src/deviceprofile_connector.cpp +++ b/commondependency/src/deviceprofile_connector.cpp @@ -317,7 +317,9 @@ void DeviceProfileConnector::GetParamBindTypeVec(AccessControlProfile profiles, if (profiles.GetBindLevel() == APP) { bindTypeVec.push_back(APP_ACROSS_ACCOUNT_TYPE); } + break; default: + LOGE("unknown bind type %{public}d.", bindType); break; } } -- Gitee From 55ef259a52779741c7c4bd4a6eacc12e19042a0b Mon Sep 17 00:00:00 2001 From: yangwei_814916 Date: Sat, 22 Feb 2025 12:06:30 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=B6=E5=BA=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangwei_814916 --- commondependency/src/deviceprofile_connector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commondependency/src/deviceprofile_connector.cpp b/commondependency/src/deviceprofile_connector.cpp index 7516318f5..e1aefa96b 100644 --- a/commondependency/src/deviceprofile_connector.cpp +++ b/commondependency/src/deviceprofile_connector.cpp @@ -291,7 +291,7 @@ void DeviceProfileConnector::GetParamBindTypeVec(AccessControlProfile profiles, std::vector &bindTypeVec, std::string trustUdid) { if (!(profiles.GetAccesser().GetAccesserDeviceId() == trustUdid && - profiles.GetAccessee().GetAccesseeDeviceId() == requestDeviceId) || + profiles.GetAccessee().GetAccesseeDeviceId() == requestDeviceId) && !(profiles.GetAccessee().GetAccesseeDeviceId() == trustUdid && profiles.GetAccesser().GetAccesserDeviceId() == requestDeviceId)) { LOGE("input udid param invalied."); -- Gitee From 78e2082099d31f4d34e1ee33df483c248e26f034 Mon Sep 17 00:00:00 2001 From: yangwei_814916 Date: Sat, 22 Feb 2025 14:37:43 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=B6=E5=BA=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangwei_814916 --- .../src/deviceprofile_connector.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/commondependency/src/deviceprofile_connector.cpp b/commondependency/src/deviceprofile_connector.cpp index e1aefa96b..af342d6cd 100644 --- a/commondependency/src/deviceprofile_connector.cpp +++ b/commondependency/src/deviceprofile_connector.cpp @@ -287,34 +287,34 @@ uint64_t DeviceProfileConnector::GetTokenIdByNameAndDeviceId(std::string pkgName return peerTokenId; } -void DeviceProfileConnector::GetParamBindTypeVec(AccessControlProfile profiles, std::string requestDeviceId, +void DeviceProfileConnector::GetParamBindTypeVec(AccessControlProfile profile, std::string requestDeviceId, std::vector &bindTypeVec, std::string trustUdid) { - if (!(profiles.GetAccesser().GetAccesserDeviceId() == trustUdid && - profiles.GetAccessee().GetAccesseeDeviceId() == requestDeviceId) && - !(profiles.GetAccessee().GetAccesseeDeviceId() == trustUdid && - profiles.GetAccesser().GetAccesserDeviceId() == requestDeviceId)) { + if (!(profile.GetAccesser().GetAccesserDeviceId() == trustUdid && + profile.GetAccessee().GetAccesseeDeviceId() == requestDeviceId) && + !(profile.GetAccessee().GetAccesseeDeviceId() == trustUdid && + profile.GetAccesser().GetAccesserDeviceId() == requestDeviceId)) { LOGE("input udid param invalied."); return; } - uint32_t bindType = profiles.GetBindType(); + uint32_t bindType = profile.GetBindType(); switch (bindType) { case DM_IDENTICAL_ACCOUNT: bindTypeVec.push_back(IDENTICAL_ACCOUNT_TYPE); break; case DM_POINT_TO_POINT: - if (profiles.GetBindLevel() == DEVICE) { + if (profile.GetBindLevel() == DEVICE) { bindTypeVec.push_back(DEVICE_PEER_TO_PEER_TYPE); } - if (profiles.GetBindLevel() == APP) { + if (profile.GetBindLevel() == APP) { bindTypeVec.push_back(APP_PEER_TO_PEER_TYPE); } break; case DM_ACROSS_ACCOUNT: - if (profiles.GetBindLevel() == DEVICE) { + if (profile.GetBindLevel() == DEVICE) { bindTypeVec.push_back(DEVICE_ACROSS_ACCOUNT_TYPE); } - if (profiles.GetBindLevel() == APP) { + if (profile.GetBindLevel() == APP) { bindTypeVec.push_back(APP_ACROSS_ACCOUNT_TYPE); } break; -- Gitee