mirror of
https://gitee.com/openharmony/bundlemanager_bundle_framework
synced 2024-11-23 07:09:53 +00:00
commit
a4dbbb32db
@ -3079,9 +3079,9 @@ bool BMSEventHandler::CheckAndParseHapFiles(
|
||||
|
||||
ret = bundleInstallChecker->CheckSysCap(realPaths);
|
||||
if (ret != ERR_OK) {
|
||||
LOG_E(BMS_TAG_DEFAULT, "hap(%{public}s) syscap check failed", hapFilePath.c_str());
|
||||
return false;
|
||||
LOG_I(BMS_TAG_DEFAULT, "hap(%{public}s) syscap check failed", hapFilePath.c_str());
|
||||
}
|
||||
bool isSysCapValid = (ret == ERR_OK);
|
||||
|
||||
std::vector<Security::Verify::HapVerifyResult> hapVerifyResults;
|
||||
ret = bundleInstallChecker->CheckMultipleHapsSignInfo(realPaths, hapVerifyResults);
|
||||
@ -3103,6 +3103,14 @@ bool BMSEventHandler::CheckAndParseHapFiles(
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isSysCapValid) {
|
||||
ret = bundleInstallChecker->CheckDeviceType(infos);
|
||||
if (ret != ERR_OK) {
|
||||
LOG_E(BMS_TAG_INSTALLER, "CheckDeviceType failed due to errorCode : %{public}d", ret);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
ret = bundleInstallChecker->CheckHspInstallCondition(hapVerifyResults);
|
||||
if (ret != ERR_OK) {
|
||||
LOG_E(BMS_TAG_DEFAULT, "CheckHspInstallCondition failed %{public}d", ret);
|
||||
|
@ -181,8 +181,8 @@ ErrCode BundleParser::ParseSysCap(const std::string &pathName, std::vector<std::
|
||||
}
|
||||
|
||||
if (!bundleExtractor.HasEntry(SYSCAP_NAME)) {
|
||||
APP_LOGD("Rpcid.sc is not exist, and do not need verification sysCaps");
|
||||
return ERR_OK;
|
||||
APP_LOGI("Rpcid.sc is not exist, and do not need verification sysCaps");
|
||||
return ERR_APPEXECFWK_PARSE_RPCID_FAILED;
|
||||
}
|
||||
|
||||
std::stringstream rpcidStream;
|
||||
|
@ -511,7 +511,7 @@ HWTEST_F(BmsBundleInstallerTest, ThirdPartyInstall_0100, Function | SmallTest |
|
||||
StopInstalldService();
|
||||
std::string bundleFile = RESOURCE_ROOT_PATH + TYPE_BUNDLE;
|
||||
auto result = InstallThirdPartyBundle(bundleFile);
|
||||
EXPECT_EQ(result, ERR_APPEXECFWK_INSTALLD_GET_PROXY_ERROR);
|
||||
EXPECT_EQ(result, ERR_APPEXECFWK_INSTALL_SYSCAP_FAILED_AND_DEVICE_TYPE_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3066,7 +3066,7 @@ HWTEST_F(BmsBundleInstallerTest, InstallChecker_0100, Function | SmallTest | Lev
|
||||
bundlePaths.push_back(bundlePath);
|
||||
BundleInstallChecker installChecker;
|
||||
auto ret = installChecker.CheckSysCap(bundlePaths);
|
||||
EXPECT_EQ(ret, ERR_OK);
|
||||
EXPECT_EQ(ret, ERR_APPEXECFWK_PARSE_RPCID_FAILED);
|
||||
|
||||
UnInstallBundle(BUNDLE_BACKUP_NAME);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user