mirror of
https://gitee.com/openharmony/account_os_account
synced 2024-11-23 10:10:11 +00:00
commit
b9ce1edab5
@ -24,7 +24,6 @@ namespace OHOS {
|
||||
namespace AccountSA {
|
||||
class AccountHelperData {
|
||||
public:
|
||||
static std::vector<std::string> GetBundleNameTrustList();
|
||||
static std::map<std::string, std::string> GetAccountEventMap();
|
||||
};
|
||||
} // namespace AccountSA
|
||||
|
@ -57,7 +57,6 @@ public:
|
||||
std::int32_t CmdGetAccountIAMService(MessageParcel &data, MessageParcel &reply);
|
||||
std::int32_t CmdGetDomainAccountService(MessageParcel &data, MessageParcel &reply);
|
||||
bool HasAccountRequestPermission(const std::string &permissionName);
|
||||
bool CheckCallerForTrustList();
|
||||
|
||||
private:
|
||||
std::map<AccountMgrInterfaceCode, AccountStubFunc> stubFuncMap_;
|
||||
|
@ -122,7 +122,6 @@
|
||||
"OHOS::AccountSA::GetValidAccountID(std::__h::basic_string<char, std::__h::char_traits<char>, std::__h::allocator<char>> const&, int&)";
|
||||
"OHOS::AccountSA::IAccountContext::instance_";
|
||||
"OHOS::AccountSA::AccountMgrService::GetCallingUserID()";
|
||||
"OHOS::AccountSA::AccountHelperData::GetBundleNameTrustList()";
|
||||
*OHOS::AccountSA::CommitCredUpdateCallback::CommitCredUpdateCallback*;
|
||||
"OHOS::AccountSA::IInnerOsAccountManager::CheckAndAddLocalIdOperating(int)";
|
||||
"OHOS::AccountSA::IInnerOsAccountManager::UpdateAccountStatusForDomain(int, OHOS::AccountSA::DomainAccountStatus)";
|
||||
|
@ -57,21 +57,6 @@ static bool ParseJsonData(nlohmann::json &jsonData)
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> AccountHelperData::GetBundleNameTrustList()
|
||||
{
|
||||
std::vector<std::string> result = {""};
|
||||
nlohmann::json jsonData;
|
||||
if (!ParseJsonData(jsonData)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (jsonData.find(KEY_BUNDLE_NAME_LIST) != jsonData.end() && jsonData.at(KEY_BUNDLE_NAME_LIST).is_array()) {
|
||||
result = jsonData.at(KEY_BUNDLE_NAME_LIST).get<std::vector<std::string>>();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> AccountHelperData::GetAccountEventMap()
|
||||
{
|
||||
std::map<std::string, std::string> result = {};
|
||||
|
@ -543,21 +543,5 @@ bool AccountStub::HasAccountRequestPermission(const std::string &permissionName)
|
||||
ACCOUNT_LOGE("permission %{public}s denied!", permissionName.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AccountStub::CheckCallerForTrustList()
|
||||
{
|
||||
std::string bundleName;
|
||||
std::int32_t uid = IPCSkeleton::GetCallingUid();
|
||||
if (BundleManagerAdapter::GetInstance()->GetNameForUid(uid, bundleName) != ERR_OK) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::string> trustList = AccountHelperData::GetBundleNameTrustList();
|
||||
if (std::find(trustList.begin(), trustList.end(), bundleName) == trustList.end()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} // namespace AccountSA
|
||||
} // namespace OHOS
|
||||
|
Loading…
Reference in New Issue
Block a user