!1443 [Bug]: 修改校验appId为appIdentifier

Merge pull request !1443 from 赵凌岚/master
This commit is contained in:
openharmony_ci 2024-09-03 08:44:12 +00:00 committed by Gitee
commit a34739ca0b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 9 additions and 2 deletions

View File

@ -102,7 +102,7 @@ struct DefaultFullImeInfo : public Serializable {
std::string expirationTime;
bool Unmarshal(cJSON *node) override
{
bool ret = GetValue(node, GET_NAME(appId), appId);
bool ret = GetValue(node, GET_NAME(appIdentifier), appId);
ret &= GetValue(node, GET_NAME(expirationTime), expirationTime);
return ret;
}

View File

@ -1128,7 +1128,14 @@ bool ImeInfoInquirer::GetAppIdByBundleName(int32_t userId, const std::string &bu
IMSA_HILOGE("failed to get bundleMgr");
return false;
}
appId = bundleMgr->GetAppIdByBundleName(bundleName, userId);
BundleInfo bundleInfo;
auto ret = bundleMgr->GetBundleInfo(
bundleName, static_cast<int32_t>(GetBundleInfoFlag::GET_BUNDLE_INFO_WITH_SIGNATURE_INFO), bundleInfo, userId);
if (!ret) {
IMSA_HILOGE("failed to get bundle info");
return false;
}
appId = bundleInfo.signatureInfo.appIdentifier;
return !appId.empty();
}
} // namespace MiscServices