mirror of
https://gitee.com/openharmony/bundlemanager_app_domain_verify
synced 2024-12-28 03:25:01 +00:00
commit
ae35d22b1d
@ -44,6 +44,7 @@ void WhiteListConfigMgr::LoadDefault()
|
||||
|
||||
defaultWhiteUrl_ = preferences_->GetString(DEFAULT_URL_KEY, "");
|
||||
if (defaultWhiteUrl_.empty()) {
|
||||
UNIVERSAL_ERROR_EVENT(READ_DEFAULT_WHITE_LIST_FAULT);
|
||||
APP_DOMAIN_VERIFY_HILOGW(APP_DOMAIN_VERIFY_MODULE_COMMON, "WhiteListConfigMgr::Load defaultWhiteUrl empty.");
|
||||
}
|
||||
}
|
||||
@ -157,7 +158,10 @@ void WhiteListConfigMgr::UpdateWhiteList(const std::unordered_set<std::string>&
|
||||
std::lock_guard<std::mutex> lock(whiteListLock_);
|
||||
whiteListSet_ = filtedWhiteList;
|
||||
if (!whiteListSet_.empty()) {
|
||||
Save();
|
||||
if (!Save()) {
|
||||
UNIVERSAL_ERROR_EVENT(WRITE_DYNAMIC_WHITE_LIST_FAULT);
|
||||
APP_DOMAIN_VERIFY_HILOGE(APP_DOMAIN_VERIFY_MGR_MODULE_SERVICE, "save white list failed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,6 +73,7 @@ private:
|
||||
bool LoadAllFromRdb();
|
||||
bool VerifyResultInfoToDB(const std::string bundleName, const VerifyResultInfo& verifyResultInfo);
|
||||
bool DBToVerifyResultInfo(const std::vector<RdbDataItem>& items, VerifyResultInfo& verifyResultInfo);
|
||||
bool LoadData();
|
||||
|
||||
private:
|
||||
std::shared_ptr<AppDomainVerifyRdbDataManager> rdbDataManager_ = nullptr;
|
||||
|
@ -23,8 +23,9 @@ AppDomainVerifyDataMgr::AppDomainVerifyDataMgr()
|
||||
{
|
||||
APP_DOMAIN_VERIFY_HILOGD(APP_DOMAIN_VERIFY_MGR_MODULE_SERVICE, "new instance created.");
|
||||
verifyMap_ = std::make_shared<std::unordered_map<std::string, VerifyResultInfo>>();
|
||||
if (InitRdb()) {
|
||||
LoadAllFromRdb();
|
||||
if (!LoadData()) {
|
||||
UNIVERSAL_ERROR_EVENT(LOAD_DB_FAULT);
|
||||
APP_DOMAIN_VERIFY_HILOGE(APP_DOMAIN_VERIFY_MGR_MODULE_SERVICE, "load data failed.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,5 +209,12 @@ bool AppDomainVerifyDataMgr::QueryAssociatedBundleNames(
|
||||
APP_DOMAIN_VERIFY_HILOGD(APP_DOMAIN_VERIFY_MGR_MODULE_SERVICE, "call end");
|
||||
return true;
|
||||
}
|
||||
bool AppDomainVerifyDataMgr::LoadData()
|
||||
{
|
||||
if (InitRdb()) {
|
||||
return LoadAllFromRdb();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} // namespace AppDomainVerify
|
||||
} // namespace OHOS
|
||||
|
Loading…
Reference in New Issue
Block a user