!7118 【5.0.1bug】修改获取extension匹配有误的问题

Merge pull request !7118 from wangtiantian/cherry-pick-1727493330
This commit is contained in:
openharmony_ci 2024-10-09 08:26:04 +00:00 committed by Gitee
commit abe4ff63e7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1632,7 +1632,7 @@ std::optional<HapModuleInfo> InnerBundleInfo::FindHapModuleInfo(
std::string key; std::string key;
key.append(".").append(modulePackage).append("."); key.append(".").append(modulePackage).append(".");
for (const auto &extension : baseExtensionInfos_) { for (const auto &extension : baseExtensionInfos_) {
if (extension.first.find(key) != std::string::npos) { if ((extension.first.find(key) != std::string::npos) && (extension.second.moduleName == hapInfo.moduleName)) {
hapInfo.extensionInfos.emplace_back(extension.second); hapInfo.extensionInfos.emplace_back(extension.second);
} }
} }
@ -1641,7 +1641,7 @@ std::optional<HapModuleInfo> InnerBundleInfo::FindHapModuleInfo(
if (ability.second.name == ServiceConstants::APP_DETAIL_ABILITY) { if (ability.second.name == ServiceConstants::APP_DETAIL_ABILITY) {
continue; continue;
} }
if (ability.first.find(key) != std::string::npos) { if ((ability.first.find(key) != std::string::npos) && (ability.second.moduleName == hapInfo.moduleName)) {
auto &abilityInfo = hapInfo.abilityInfos.emplace_back(ability.second); auto &abilityInfo = hapInfo.abilityInfos.emplace_back(ability.second);
GetApplicationInfo(ApplicationFlag::GET_APPLICATION_INFO_WITH_PERMISSION | GetApplicationInfo(ApplicationFlag::GET_APPLICATION_INFO_WITH_PERMISSION |
ApplicationFlag::GET_APPLICATION_INFO_WITH_CERTIFICATE_FINGERPRINT, userId, ApplicationFlag::GET_APPLICATION_INFO_WITH_CERTIFICATE_FINGERPRINT, userId,