From 3c2960035bd570e64c34ecd60bd444868ed2ebab Mon Sep 17 00:00:00 2001 From: changjiaxing Date: Wed, 30 Apr 2025 17:58:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A9=BA=E5=8F=A3=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changjiaxing Change-Id: I1ea200ec673648a54afa656b4bc5eeab6853457c --- .../distributeddataservice/app/src/checker/bundle_checker.cpp | 1 - .../distributeddataservice/service/rdb/rdb_service_impl.cpp | 3 ++- .../distributeddataservice/service/test/mock/checker_mock.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/distributeddataservice/app/src/checker/bundle_checker.cpp b/services/distributeddataservice/app/src/checker/bundle_checker.cpp index 674e09d59..b14a5fedd 100644 --- a/services/distributeddataservice/app/src/checker/bundle_checker.cpp +++ b/services/distributeddataservice/app/src/checker/bundle_checker.cpp @@ -114,7 +114,6 @@ bool BundleChecker::IsValid(const CheckerManager::StoreInfo &info) if (AccessTokenKit::GetHapTokenInfo(info.tokenId, tokenInfo) != RET_SUCCESS) { return false; } - return tokenInfo.bundleName == info.bundleName; } diff --git a/services/distributeddataservice/service/rdb/rdb_service_impl.cpp b/services/distributeddataservice/service/rdb/rdb_service_impl.cpp index 30e197972..b2d0164d1 100644 --- a/services/distributeddataservice/service/rdb/rdb_service_impl.cpp +++ b/services/distributeddataservice/service/rdb/rdb_service_impl.cpp @@ -228,7 +228,8 @@ bool RdbServiceImpl::CheckAccess(const std::string& bundleName, const std::strin storeInfo.tokenId = IPCSkeleton::GetCallingTokenID(); storeInfo.bundleName = bundleName; storeInfo.storeId = RemoveSuffix(storeName); - return !CheckerManager::GetInstance().GetAppId(storeInfo).empty(); + + return CheckerManager::GetInstance().IsValid(storeInfo); } std::string RdbServiceImpl::ObtainDistributedTableName(const std::string &device, const std::string &table) diff --git a/services/distributeddataservice/service/test/mock/checker_mock.cpp b/services/distributeddataservice/service/test/mock/checker_mock.cpp index 22a2e748e..4adc8baa7 100644 --- a/services/distributeddataservice/service/test/mock/checker_mock.cpp +++ b/services/distributeddataservice/service/test/mock/checker_mock.cpp @@ -47,7 +47,7 @@ std::string CheckerMock::GetAppId(const CheckerManager::StoreInfo &info) bool CheckerMock::IsValid(const CheckerManager::StoreInfo &info) { - return true; + return !info.bundleName.empty(); } bool CheckerMock::SetDistrustInfo(const CheckerManager::Distrust &distrust) -- Gitee