From cca4144c35a2bef3d9c24c84cd496148efb52f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 12 Sep 2025 11:06:11 +0800 Subject: [PATCH 1/6] dm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- common/include/dm_anonymous.h | 2 + common/src/dm_anonymous.cpp | 29 ++++++++++++++ .../src/deviceprofile_connector.cpp | 39 ++++++++++++------- 3 files changed, 57 insertions(+), 13 deletions(-) diff --git a/common/include/dm_anonymous.h b/common/include/dm_anonymous.h index df4ff3408..ecc2878e1 100644 --- a/common/include/dm_anonymous.h +++ b/common/include/dm_anonymous.h @@ -30,6 +30,8 @@ extern const int32_t LIST_SPLIT_LEN; DM_EXPORT std::string GetAnonyString(const std::string &value); std::string GetAnonyStringList(const std::vector &values); std::string GetAnonyInt32(const int32_t value); +std::string GetAnonyInt64(const int64_t value); +std::string GetAnonyUint64(const uint64_t value); std::string GetAnonyInt32List(const std::vector &values); bool IsNumberString(const std::string &inputString); bool IsString(const JsonItemObject &jsonObj, const std::string &key); diff --git a/common/src/dm_anonymous.cpp b/common/src/dm_anonymous.cpp index 43a0ecfed..7a96282b3 100644 --- a/common/src/dm_anonymous.cpp +++ b/common/src/dm_anonymous.cpp @@ -84,6 +84,35 @@ std::string GetAnonyInt32(const int32_t value) return tempString; } +std::string GetAnonyInt64(const int64_t value) +{ + std::string tempString = std::to_string(value); + size_t length = tempString.length(); + if (length == 0x01) { + tempString[0] = '*'; + return tempString; + } + for (size_t i = 1; i < length - 1; i++) { + + tempString[i] = '*'; + } + return tempString; +} + +std::string GetAnonyUint64(const uint64_t value) +{ + std::string tempString = std::to_string(value); + size_t length = tempString.length(); + if (length == 0x01) { + tempString[0] = '*'; + return tempString; + } + for (size_t i = 1; i < length - 1; i++) { + tempString[i] = '*'; + } + return tempString; +} + std::string GetAnonyInt32List(const std::vector &values) { std::string temp = "[ "; diff --git a/commondependency/src/deviceprofile_connector.cpp b/commondependency/src/deviceprofile_connector.cpp index 49ec04f9f..ea265b7df 100644 --- a/commondependency/src/deviceprofile_connector.cpp +++ b/commondependency/src/deviceprofile_connector.cpp @@ -76,6 +76,7 @@ void PrintProfile(const AccessControlProfile &profile) std::string acerPkgName = profile.GetAccesser().GetAccesserBundleName(); std::string acerCredId = profile.GetAccesser().GetAccesserCredentialIdStr(); int32_t acerSkId = profile.GetAccesser().GetAccesserSessionKeyId(); + int64_t acerTokenId = profile.GetAccesser().GetAccesserTokenId(); std::string aceeDeviceId = profile.GetAccessee().GetAccesseeDeviceId(); int32_t aceeUserId = profile.GetAccessee().GetAccesseeUserId(); @@ -83,15 +84,18 @@ void PrintProfile(const AccessControlProfile &profile) std::string aceePkgName = profile.GetAccessee().GetAccesseeBundleName(); std::string aceeCredId = profile.GetAccessee().GetAccesseeCredentialIdStr(); int32_t aceeSkId = profile.GetAccessee().GetAccesseeSessionKeyId(); + int64_t aceeTokenId = profile.GetAccessee().GetAccesseeTokenId(); LOGI("bindType %{public}d, bindLevel %{public}d, acerDeviceId %{public}s, acerUserId %{public}d," "acerAccountId %{public}s, acerPkgName %{public}s, acerCredId %{public}s," "acerSkId %{public}d, aceeDeviceId %{public}s, aceeUserId %{public}d, aceeAccountId %{public}s," - "aceePkgName %{public}s, aceeCredId %{public}s, aceeSkId %{public}d.", + "aceePkgName %{public}s, aceeCredId %{public}s, aceeSkId %{public}d," + "acerTokenId %{public}s, aceeTokenId %{public}s.", bindType, bindLevel, GetAnonyString(acerDeviceId).c_str(), acerUserId, GetAnonyString(acerAccountId).c_str(), acerPkgName.c_str(), GetAnonyString(acerCredId).c_str(), acerSkId, GetAnonyString(aceeDeviceId).c_str(), aceeUserId, GetAnonyString(aceeAccountId).c_str(), - aceePkgName.c_str(), GetAnonyString(aceeCredId).c_str(), aceeSkId); + aceePkgName.c_str(), GetAnonyString(aceeCredId).c_str(), aceeSkId, + GetAnonyInt64(acerTokenId).c_str(), GetAnonyInt64(aceeTokenId).c_str()); } std::string GetLocalDeviceId() @@ -1828,10 +1832,11 @@ DM_EXPORT bool DeviceProfileConnector::CheckAccessControl( { LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s" "srcAccountId %{public}s, sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s," - "sinkAccountId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, + "callerTokenId %{public}s, calleeTokenId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, caller.pkgName.c_str(), GetAnonyString(caller.accountId).c_str(), GetAnonyString(sinkUdid).c_str(), callee.userId, callee.pkgName.c_str(), - GetAnonyString(callee.accountId).c_str()); + GetAnonyString(callee.accountId).c_str(), GetAnonyUint64(caller.tokenId).c_str(), + GetAnonyUint64(callee.tokenId).c_str()); std::vector profiles = GetAllAccessControlProfile(); std::vector profilesFilter = GetACLByDeviceIdAndUserId(profiles, caller, srcUdid, callee, sinkUdid); @@ -1906,10 +1911,12 @@ DM_EXPORT bool DeviceProfileConnector::CheckIsSameAccount( { LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s," "srcAccountId %{public}s, sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s," - "sinkAccountId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, + "sinkAccountId %{public}s, callerTokenId %{public}s, calleeTokenId %{public}s.", + GetAnonyString(srcUdid).c_str(), caller.userId, caller.pkgName.c_str(), GetAnonyString(caller.accountId).c_str(), GetAnonyString(sinkUdid).c_str(), callee.userId, callee.pkgName.c_str(), - GetAnonyString(callee.accountId).c_str()); + GetAnonyString(callee.accountId).c_str(), GetAnonyUint64(caller.tokenId).c_str(), + GetAnonyUint64(callee.tokenId).c_str()); std::vector profiles = GetAllAccessControlProfile(); std::vector profilesFilter = GetACLByDeviceIdAndUserId(profiles, caller, srcUdid, callee, sinkUdid); @@ -3124,10 +3131,12 @@ DM_EXPORT bool DeviceProfileConnector::CheckSrcAccessControl(const DmAccessCalle { LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s," "srcAccountId %{public}s, sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s," - "sinkAccountId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, + "sinkAccountId %{public}s, callerTokenId %{public}s, calleeTokenId %{public}s.", + GetAnonyString(srcUdid).c_str(), caller.userId, caller.pkgName.c_str(), GetAnonyString(caller.accountId).c_str(), GetAnonyString(sinkUdid).c_str(), callee.userId, callee.pkgName.c_str(), - GetAnonyString(callee.accountId).c_str()); + GetAnonyString(callee.accountId).c_str(), GetAnonyUint64(caller.tokenId).c_str(), + GetAnonyUint64(callee.tokenId).c_str()); std::vector profiles = GetAllAccessControlProfile(); std::string localUdid = GetLocalDeviceId(); std::string trustUdid = (localUdid == srcUdid ? sinkUdid : srcUdid); @@ -3404,12 +3413,14 @@ bool DeviceProfileConnector::CheckSinkAppOrServiceP2PAcl(const DistributedDevice DM_EXPORT bool DeviceProfileConnector::CheckSrcIsSameAccount(const DmAccessCaller &caller, const std::string &srcUdid, const DmAccessCallee &callee, const std::string &sinkUdid) { - LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s, " + LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s," "srcAccountId %{public}s, sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s," - "sinkAccountId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, + "sinkAccountId %{public}s, callerTokenId %{public}s, calleeTokenId %{public}s.", + GetAnonyString(srcUdid).c_str(), caller.userId, caller.pkgName.c_str(), GetAnonyString(caller.accountId).c_str(), GetAnonyString(sinkUdid).c_str(), callee.userId, callee.pkgName.c_str(), - GetAnonyString(callee.accountId).c_str()); + GetAnonyString(callee.accountId).c_str(), GetAnonyUint64(caller.tokenId).c_str(), + GetAnonyUint64(callee.tokenId).c_str()); std::vector profiles = GetAllAccessControlProfile(); std::string localUdid = GetLocalDeviceId(); std::string trustUdid = (localUdid == srcUdid ? sinkUdid : srcUdid); @@ -3430,10 +3441,12 @@ DM_EXPORT bool DeviceProfileConnector::CheckSinkIsSameAccount(const DmAccessCall { LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s," "srcAccountId %{public}s, sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s," - "sinkAccountId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, + "sinkAccountId %{public}s, callerTokenId %{public}s, calleeTokenId %{public}s.", + GetAnonyString(srcUdid).c_str(), caller.userId, caller.pkgName.c_str(), GetAnonyString(caller.accountId).c_str(), GetAnonyString(sinkUdid).c_str(), callee.userId, callee.pkgName.c_str(), - GetAnonyString(callee.accountId).c_str()); + GetAnonyString(callee.accountId).c_str(), GetAnonyUint64(caller.tokenId).c_str(), + GetAnonyUint64(callee.tokenId).c_str()); std::vector profiles = GetAllAccessControlProfile(); std::string localUdid = GetLocalDeviceId(); std::string trustUdid = (localUdid == srcUdid ? sinkUdid : srcUdid); -- Gitee From ac2b2a8d3f3841644be0fadf5a6b52c485502494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 12 Sep 2025 11:06:11 +0800 Subject: [PATCH 2/6] dm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- common/include/dm_anonymous.h | 2 + common/src/dm_anonymous.cpp | 29 +++++++++++++ .../src/deviceprofile_connector.cpp | 43 ++++++++++++------- 3 files changed, 59 insertions(+), 15 deletions(-) diff --git a/common/include/dm_anonymous.h b/common/include/dm_anonymous.h index df4ff3408..ecc2878e1 100644 --- a/common/include/dm_anonymous.h +++ b/common/include/dm_anonymous.h @@ -30,6 +30,8 @@ extern const int32_t LIST_SPLIT_LEN; DM_EXPORT std::string GetAnonyString(const std::string &value); std::string GetAnonyStringList(const std::vector &values); std::string GetAnonyInt32(const int32_t value); +std::string GetAnonyInt64(const int64_t value); +std::string GetAnonyUint64(const uint64_t value); std::string GetAnonyInt32List(const std::vector &values); bool IsNumberString(const std::string &inputString); bool IsString(const JsonItemObject &jsonObj, const std::string &key); diff --git a/common/src/dm_anonymous.cpp b/common/src/dm_anonymous.cpp index 43a0ecfed..7a96282b3 100644 --- a/common/src/dm_anonymous.cpp +++ b/common/src/dm_anonymous.cpp @@ -84,6 +84,35 @@ std::string GetAnonyInt32(const int32_t value) return tempString; } +std::string GetAnonyInt64(const int64_t value) +{ + std::string tempString = std::to_string(value); + size_t length = tempString.length(); + if (length == 0x01) { + tempString[0] = '*'; + return tempString; + } + for (size_t i = 1; i < length - 1; i++) { + + tempString[i] = '*'; + } + return tempString; +} + +std::string GetAnonyUint64(const uint64_t value) +{ + std::string tempString = std::to_string(value); + size_t length = tempString.length(); + if (length == 0x01) { + tempString[0] = '*'; + return tempString; + } + for (size_t i = 1; i < length - 1; i++) { + tempString[i] = '*'; + } + return tempString; +} + std::string GetAnonyInt32List(const std::vector &values) { std::string temp = "[ "; diff --git a/commondependency/src/deviceprofile_connector.cpp b/commondependency/src/deviceprofile_connector.cpp index 49ec04f9f..dabcefeb0 100644 --- a/commondependency/src/deviceprofile_connector.cpp +++ b/commondependency/src/deviceprofile_connector.cpp @@ -76,6 +76,7 @@ void PrintProfile(const AccessControlProfile &profile) std::string acerPkgName = profile.GetAccesser().GetAccesserBundleName(); std::string acerCredId = profile.GetAccesser().GetAccesserCredentialIdStr(); int32_t acerSkId = profile.GetAccesser().GetAccesserSessionKeyId(); + int64_t acerTokenId = profile.GetAccesser().GetAccesserTokenId(); std::string aceeDeviceId = profile.GetAccessee().GetAccesseeDeviceId(); int32_t aceeUserId = profile.GetAccessee().GetAccesseeUserId(); @@ -83,15 +84,18 @@ void PrintProfile(const AccessControlProfile &profile) std::string aceePkgName = profile.GetAccessee().GetAccesseeBundleName(); std::string aceeCredId = profile.GetAccessee().GetAccesseeCredentialIdStr(); int32_t aceeSkId = profile.GetAccessee().GetAccesseeSessionKeyId(); + int64_t aceeTokenId = profile.GetAccessee().GetAccesseeTokenId(); LOGI("bindType %{public}d, bindLevel %{public}d, acerDeviceId %{public}s, acerUserId %{public}d," "acerAccountId %{public}s, acerPkgName %{public}s, acerCredId %{public}s," "acerSkId %{public}d, aceeDeviceId %{public}s, aceeUserId %{public}d, aceeAccountId %{public}s," - "aceePkgName %{public}s, aceeCredId %{public}s, aceeSkId %{public}d.", + "aceePkgName %{public}s, aceeCredId %{public}s, aceeSkId %{public}d," + "acerTokenId %{public}s, aceeTokenId %{public}s.", bindType, bindLevel, GetAnonyString(acerDeviceId).c_str(), acerUserId, GetAnonyString(acerAccountId).c_str(), acerPkgName.c_str(), GetAnonyString(acerCredId).c_str(), acerSkId, GetAnonyString(aceeDeviceId).c_str(), aceeUserId, GetAnonyString(aceeAccountId).c_str(), - aceePkgName.c_str(), GetAnonyString(aceeCredId).c_str(), aceeSkId); + aceePkgName.c_str(), GetAnonyString(aceeCredId).c_str(), aceeSkId, + GetAnonyInt64(acerTokenId).c_str(), GetAnonyInt64(aceeTokenId).c_str()); } std::string GetLocalDeviceId() @@ -1826,12 +1830,13 @@ DM_EXPORT bool DeviceProfileConnector::CheckAccessControl( const DmAccessCaller &caller, const std::string &srcUdid, const DmAccessCallee &callee, const std::string &sinkUdid) { - LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s" - "srcAccountId %{public}s, sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s," - "sinkAccountId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, + LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s srcAccountId %{public}s," + "sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s, sinkAccountId %{public}s" + "callerTokenId %{public}s, calleeTokenId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, caller.pkgName.c_str(), GetAnonyString(caller.accountId).c_str(), GetAnonyString(sinkUdid).c_str(), callee.userId, callee.pkgName.c_str(), - GetAnonyString(callee.accountId).c_str()); + GetAnonyString(callee.accountId).c_str(), GetAnonyUint64(caller.tokenId).c_str(), + GetAnonyUint64(callee.tokenId).c_str()); std::vector profiles = GetAllAccessControlProfile(); std::vector profilesFilter = GetACLByDeviceIdAndUserId(profiles, caller, srcUdid, callee, sinkUdid); @@ -1906,10 +1911,12 @@ DM_EXPORT bool DeviceProfileConnector::CheckIsSameAccount( { LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s," "srcAccountId %{public}s, sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s," - "sinkAccountId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, + "sinkAccountId %{public}s, callerTokenId %{public}s, calleeTokenId %{public}s.", + GetAnonyString(srcUdid).c_str(), caller.userId, caller.pkgName.c_str(), GetAnonyString(caller.accountId).c_str(), GetAnonyString(sinkUdid).c_str(), callee.userId, callee.pkgName.c_str(), - GetAnonyString(callee.accountId).c_str()); + GetAnonyString(callee.accountId).c_str(), GetAnonyUint64(caller.tokenId).c_str(), + GetAnonyUint64(callee.tokenId).c_str()); std::vector profiles = GetAllAccessControlProfile(); std::vector profilesFilter = GetACLByDeviceIdAndUserId(profiles, caller, srcUdid, callee, sinkUdid); @@ -3124,10 +3131,12 @@ DM_EXPORT bool DeviceProfileConnector::CheckSrcAccessControl(const DmAccessCalle { LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s," "srcAccountId %{public}s, sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s," - "sinkAccountId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, + "sinkAccountId %{public}s, callerTokenId %{public}s, calleeTokenId %{public}s.", + GetAnonyString(srcUdid).c_str(), caller.userId, caller.pkgName.c_str(), GetAnonyString(caller.accountId).c_str(), GetAnonyString(sinkUdid).c_str(), callee.userId, callee.pkgName.c_str(), - GetAnonyString(callee.accountId).c_str()); + GetAnonyString(callee.accountId).c_str(), GetAnonyUint64(caller.tokenId).c_str(), + GetAnonyUint64(callee.tokenId).c_str()); std::vector profiles = GetAllAccessControlProfile(); std::string localUdid = GetLocalDeviceId(); std::string trustUdid = (localUdid == srcUdid ? sinkUdid : srcUdid); @@ -3404,12 +3413,14 @@ bool DeviceProfileConnector::CheckSinkAppOrServiceP2PAcl(const DistributedDevice DM_EXPORT bool DeviceProfileConnector::CheckSrcIsSameAccount(const DmAccessCaller &caller, const std::string &srcUdid, const DmAccessCallee &callee, const std::string &sinkUdid) { - LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s, " + LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s," "srcAccountId %{public}s, sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s," - "sinkAccountId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, + "sinkAccountId %{public}s, callerTokenId %{public}s, calleeTokenId %{public}s.", + GetAnonyString(srcUdid).c_str(), caller.userId, caller.pkgName.c_str(), GetAnonyString(caller.accountId).c_str(), GetAnonyString(sinkUdid).c_str(), callee.userId, callee.pkgName.c_str(), - GetAnonyString(callee.accountId).c_str()); + GetAnonyString(callee.accountId).c_str(), GetAnonyUint64(caller.tokenId).c_str(), + GetAnonyUint64(callee.tokenId).c_str()); std::vector profiles = GetAllAccessControlProfile(); std::string localUdid = GetLocalDeviceId(); std::string trustUdid = (localUdid == srcUdid ? sinkUdid : srcUdid); @@ -3430,10 +3441,12 @@ DM_EXPORT bool DeviceProfileConnector::CheckSinkIsSameAccount(const DmAccessCall { LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s," "srcAccountId %{public}s, sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s," - "sinkAccountId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, + "sinkAccountId %{public}s, callerTokenId %{public}s, calleeTokenId %{public}s.", + GetAnonyString(srcUdid).c_str(), caller.userId, caller.pkgName.c_str(), GetAnonyString(caller.accountId).c_str(), GetAnonyString(sinkUdid).c_str(), callee.userId, callee.pkgName.c_str(), - GetAnonyString(callee.accountId).c_str()); + GetAnonyString(callee.accountId).c_str(), GetAnonyUint64(caller.tokenId).c_str(), + GetAnonyUint64(callee.tokenId).c_str()); std::vector profiles = GetAllAccessControlProfile(); std::string localUdid = GetLocalDeviceId(); std::string trustUdid = (localUdid == srcUdid ? sinkUdid : srcUdid); -- Gitee From b9527d66ddc90a4814bd687e90bed53471ef4b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 12 Sep 2025 11:17:34 +0800 Subject: [PATCH 3/6] dm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- commondependency/src/deviceprofile_connector.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/commondependency/src/deviceprofile_connector.cpp b/commondependency/src/deviceprofile_connector.cpp index 059888c17..dabcefeb0 100644 --- a/commondependency/src/deviceprofile_connector.cpp +++ b/commondependency/src/deviceprofile_connector.cpp @@ -1830,13 +1830,8 @@ DM_EXPORT bool DeviceProfileConnector::CheckAccessControl( const DmAccessCaller &caller, const std::string &srcUdid, const DmAccessCallee &callee, const std::string &sinkUdid) { -<<<<<<< HEAD LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s srcAccountId %{public}s," "sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s, sinkAccountId %{public}s" -======= - LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s" - "srcAccountId %{public}s, sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s," ->>>>>>> cca4144c35a2bef3d9c24c84cd496148efb52f18 "callerTokenId %{public}s, calleeTokenId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, caller.pkgName.c_str(), GetAnonyString(caller.accountId).c_str(), GetAnonyString(sinkUdid).c_str(), callee.userId, callee.pkgName.c_str(), -- Gitee From 31fc5baa47b293d6f0270260f1d22b0dd5f51825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 12 Sep 2025 11:19:19 +0800 Subject: [PATCH 4/6] dm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- 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 dabcefeb0..f3f12cb2b 100644 --- a/commondependency/src/deviceprofile_connector.cpp +++ b/commondependency/src/deviceprofile_connector.cpp @@ -1830,7 +1830,7 @@ DM_EXPORT bool DeviceProfileConnector::CheckAccessControl( const DmAccessCaller &caller, const std::string &srcUdid, const DmAccessCallee &callee, const std::string &sinkUdid) { - LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s srcAccountId %{public}s," + LOGI("srcUdid %{public}s, srcUserId %{public}d, srcPkgName %{public}s, srcAccountId %{public}s," "sinkUdid %{public}s, sinkUserId %{public}d, sinkPkgName %{public}s, sinkAccountId %{public}s" "callerTokenId %{public}s, calleeTokenId %{public}s.", GetAnonyString(srcUdid).c_str(), caller.userId, caller.pkgName.c_str(), GetAnonyString(caller.accountId).c_str(), -- Gitee From 09006681439487bc60a2755c803150eacd7a6bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 12 Sep 2025 06:26:37 +0000 Subject: [PATCH 5/6] update common/src/dm_anonymous.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- common/src/dm_anonymous.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/src/dm_anonymous.cpp b/common/src/dm_anonymous.cpp index 7a96282b3..4bc1b8454 100644 --- a/common/src/dm_anonymous.cpp +++ b/common/src/dm_anonymous.cpp @@ -93,7 +93,6 @@ std::string GetAnonyInt64(const int64_t value) return tempString; } for (size_t i = 1; i < length - 1; i++) { - tempString[i] = '*'; } return tempString; -- Gitee From 50b7ca0f44e739519b37272ed66476e5c5a21cdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 12 Sep 2025 06:45:33 +0000 Subject: [PATCH 6/6] update common/src/dm_anonymous.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- common/src/dm_anonymous.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/src/dm_anonymous.cpp b/common/src/dm_anonymous.cpp index 4bc1b8454..6829c1179 100644 --- a/common/src/dm_anonymous.cpp +++ b/common/src/dm_anonymous.cpp @@ -92,6 +92,10 @@ std::string GetAnonyInt64(const int64_t value) tempString[0] = '*'; return tempString; } + if (length == 0x02) { + tempString[1] = '*'; + return tempString; + } for (size_t i = 1; i < length - 1; i++) { tempString[i] = '*'; } @@ -106,6 +110,10 @@ std::string GetAnonyUint64(const uint64_t value) tempString[0] = '*'; return tempString; } + if (length == 0x02) { + tempString[1] = '*'; + return tempString; + } for (size_t i = 1; i < length - 1; i++) { tempString[i] = '*'; } -- Gitee