mirror of
https://gitee.com/openharmony/bundlemanager_bundle_framework
synced 2024-11-27 01:11:15 +00:00
commit
7f8b4605a8
@ -4870,6 +4870,7 @@ ErrCode BaseBundleInstaller::SaveHapToInstallPath(const std::unordered_map<std::
|
||||
}
|
||||
// 1. copy hsp or hap file to temp installation dir
|
||||
ErrCode result = ERR_OK;
|
||||
bool isDriver = HasDriverExtensionAbility(bundleName_);
|
||||
for (const auto &hapPathRecord : hapPathRecords_) {
|
||||
LOG_D(BMS_TAG_INSTALLER, "Save from %{public}s to %{public}s",
|
||||
hapPathRecord.first.c_str(), hapPathRecord.second.c_str());
|
||||
@ -4879,10 +4880,18 @@ ErrCode BaseBundleInstaller::SaveHapToInstallPath(const std::unordered_map<std::
|
||||
signatureFileMap_.at(hapPathRecord.first));
|
||||
CHECK_RESULT(result, "Copy hap to install path failed or code signature hap failed %{public}d");
|
||||
} else {
|
||||
if (InstalldClient::GetInstance()->MoveHapToCodeDir(
|
||||
hapPathRecord.first, hapPathRecord.second) != ERR_OK) {
|
||||
LOG_E(BMS_TAG_INSTALLER, "Copy hap to install path failed");
|
||||
return ERR_APPEXECFWK_INSTALLD_MOVE_FILE_FAILED;
|
||||
if (isDriver) {
|
||||
if (InstalldClient::GetInstance()->CopyFile(
|
||||
hapPathRecord.first, hapPathRecord.second) != ERR_OK) {
|
||||
LOG_E(BMS_TAG_INSTALLER, "Copy hap to install path failed");
|
||||
return ERR_APPEXECFWK_INSTALL_COPY_HAP_FAILED;
|
||||
}
|
||||
} else {
|
||||
if (InstalldClient::GetInstance()->MoveHapToCodeDir(
|
||||
hapPathRecord.first, hapPathRecord.second) != ERR_OK) {
|
||||
LOG_E(BMS_TAG_INSTALLER, "Move hap to install path failed");
|
||||
return ERR_APPEXECFWK_INSTALLD_MOVE_FILE_FAILED;
|
||||
}
|
||||
}
|
||||
if (VerifyCodeSignatureForHap(infos, hapPathRecord.first, hapPathRecord.second) != ERR_OK) {
|
||||
LOG_E(BMS_TAG_INSTALLER, "enable code signature failed");
|
||||
|
Loading…
Reference in New Issue
Block a user