From cb4a9994d447f58467d48e61d5938b7e6ce0a2a1 Mon Sep 17 00:00:00 2001 From: yangwei_814916 Date: Mon, 9 Jun 2025 21:50:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangwei_814916 --- .../native_cpp/src/device_manager_impl.cpp | 2 +- .../authentication_v2/auth_stages/auth_acl.cpp | 2 +- .../auth_stages/auth_confirm.cpp | 15 +++++++++------ .../src/device_manager_service_impl.cpp | 3 ++- .../src/relationshipsyncmgr/dm_comm_tool.cpp | 8 ++++---- 5 files changed, 17 insertions(+), 13 deletions(-) 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 3a442c21a..42aac4ed7 100644 --- a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp +++ b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp @@ -839,7 +839,7 @@ int32_t DeviceManagerImpl::SetUserOperation(const std::string &pkgName, int32_t { if (pkgName.empty() || params.empty()) { LOGE("DeviceManager::SetUserOperation start, pkgName: %{public}s, params: %{public}s", pkgName.c_str(), - params.c_str()); + GetAnonyString(params).c_str()); return ERR_DM_INPUT_PARA_INVALID; } LOGI("Start, pkgName: %{public}s", pkgName.c_str()); diff --git a/services/implementation/src/authentication_v2/auth_stages/auth_acl.cpp b/services/implementation/src/authentication_v2/auth_stages/auth_acl.cpp index 23ed565e0..73dedccd0 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_acl.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_acl.cpp @@ -85,7 +85,7 @@ int32_t AuthSrcDataSyncState::Action(std::shared_ptr context) char udidHashTmp[DM_MAX_DEVICE_ID_LEN] = {0}; if (Crypto::GetUdidHash(context->accessee.deviceId, reinterpret_cast(udidHashTmp)) != DM_OK) { LOGE("AuthSrcDataSyncState joinLnn get udidhash by udid: %{public}s failed", - context->accessee.deviceId.c_str()); + GetAnonyString(context->accessee.deviceId).c_str()); return ERR_DM_FAILED; } std::string peerUdidHash = std::string(udidHashTmp); diff --git a/services/implementation/src/authentication_v2/auth_stages/auth_confirm.cpp b/services/implementation/src/authentication_v2/auth_stages/auth_confirm.cpp index 564703c74..f9b71d6eb 100644 --- a/services/implementation/src/authentication_v2/auth_stages/auth_confirm.cpp +++ b/services/implementation/src/authentication_v2/auth_stages/auth_confirm.cpp @@ -399,8 +399,9 @@ void AuthSrcConfirmState::GetIdenticalCredentialInfo(std::shared_ptraccesser.userId); queryParams[FILED_CRED_TYPE] = DM_AUTH_CREDENTIAL_ACCOUNT_RELATED; CHECK_NULL_VOID(context->hiChainAuthConnector); - if (context->hiChainAuthConnector->QueryCredentialInfo(context->accesser.userId, queryParams, credInfo) != DM_OK) { - LOGE("QueryCredentialInfo failed credInfo %{public}s.", credInfo.Dump().c_str()); + int32_t ret = context->hiChainAuthConnector->QueryCredentialInfo(context->accesser.userId, queryParams, credInfo); + if (ret != DM_OK) { + LOGE("QueryCredentialInfo failed ret %{public}d.", ret); } } @@ -414,8 +415,9 @@ void AuthSrcConfirmState::GetShareCredentialInfo(std::shared_ptr queryParams[FILED_PEER_USER_SPACE_ID] = std::to_string(context->accessee.userId); queryParams[FILED_CRED_TYPE] = DM_AUTH_CREDENTIAL_ACCOUNT_ACROSS; CHECK_NULL_VOID(context->hiChainAuthConnector); - if (context->hiChainAuthConnector->QueryCredentialInfo(context->accesser.userId, queryParams, credInfo) != DM_OK) { - LOGE("QueryCredentialInfo failed credInfo %{public}s.", credInfo.Dump().c_str()); + int32_t ret = context->hiChainAuthConnector->QueryCredentialInfo(context->accesser.userId, queryParams, credInfo); + if (ret != DM_OK) { + LOGE("QueryCredentialInfo failed ret %{public}d.", ret); } } @@ -430,8 +432,9 @@ void AuthSrcConfirmState::GetP2PCredentialInfo(std::shared_ptr co queryParams[FILED_CRED_TYPE] = DM_AUTH_CREDENTIAL_ACCOUNT_UNRELATED; queryParams[FILED_CRED_OWNER] = "DM"; CHECK_NULL_VOID(context->hiChainAuthConnector); - if (context->hiChainAuthConnector->QueryCredentialInfo(context->accesser.userId, queryParams, credInfo) != DM_OK) { - LOGE("QueryCredentialInfo failed credInfo %{public}s.", credInfo.Dump().c_str()); + int32_t ret = context->hiChainAuthConnector->QueryCredentialInfo(context->accesser.userId, queryParams, credInfo); + if (ret != DM_OK) { + LOGE("QueryCredentialInfo failed ret %{public}d.", ret); } } diff --git a/services/implementation/src/device_manager_service_impl.cpp b/services/implementation/src/device_manager_service_impl.cpp index 236880e52..199b3dcd0 100644 --- a/services/implementation/src/device_manager_service_impl.cpp +++ b/services/implementation/src/device_manager_service_impl.cpp @@ -1772,7 +1772,8 @@ void DeviceManagerServiceImpl::BindTargetImpl(uint64_t tokenId, const std::strin // Created only at the source end. The same target device will not be created repeatedly with the new protocol. std::shared_ptr curSession = GetOrCreateSession(targetIdTmp.deviceId, bindParam); if (curSession == nullptr) { - LOGE("Failed to create the session. Target deviceId: %{public}s.", targetIdTmp.deviceId.c_str()); + LOGE("Failed to create the session. Target deviceId: %{public}s.", + GetAnonyString(targetIdTmp.deviceId).c_str()); OnAuthResultAndOnBindResult(processInfo, targetId, targetIdTmp.deviceId, ERR_DM_TIME_OUT); return; } diff --git a/services/service/src/relationshipsyncmgr/dm_comm_tool.cpp b/services/service/src/relationshipsyncmgr/dm_comm_tool.cpp index 77ecde4ca..56111b691 100644 --- a/services/service/src/relationshipsyncmgr/dm_comm_tool.cpp +++ b/services/service/src/relationshipsyncmgr/dm_comm_tool.cpp @@ -393,7 +393,7 @@ void DMCommTool::ProcessReceiveCommonEvent(const std::shared_ptr c std::string rmtUdid = ""; SoftbusCache::GetInstance().GetUdidFromCache(commMsg->remoteNetworkId.c_str(), rmtUdid); if (rmtUdid.empty()) { - LOGE("Can not find remote udid by networkid: %{public}s", commMsg->remoteNetworkId.c_str()); + LOGE("Can not find remote udid by networkid: %{public}s", GetAnonyString(commMsg->remoteNetworkId).c_str()); return; } @@ -439,7 +439,7 @@ void DMCommTool::ProcessResponseCommonEvent(const std::shared_ptr std::string rmtUdid = ""; SoftbusCache::GetInstance().GetUdidFromCache(commMsg->remoteNetworkId.c_str(), rmtUdid); if (rmtUdid.empty()) { - LOGE("Can not find remote udid by networkid: %{public}s", commMsg->remoteNetworkId.c_str()); + LOGE("Can not find remote udid by networkid: %{public}s", GetAnonyString(commMsg->remoteNetworkId).c_str()); return; } @@ -462,7 +462,7 @@ void DMCommTool::ProcessReceiveUserIdsEvent(const std::shared_ptr std::string rmtUdid = ""; SoftbusCache::GetInstance().GetUdidFromCache(commMsg->remoteNetworkId.c_str(), rmtUdid); if (rmtUdid.empty()) { - LOGE("Can not find remote udid by networkid: %{public}s", commMsg->remoteNetworkId.c_str()); + LOGE("Can not find remote udid by networkid: %{public}s", GetAnonyString(commMsg->remoteNetworkId).c_str()); return; } @@ -565,7 +565,7 @@ void DMCommTool::ProcessReceiveUnBindAppEvent(const std::shared_ptr