调换移动so和hap顺序

Signed-off-by: Zhou Shihui <zhoushihui4@huawei.com>
This commit is contained in:
Zhou Shihui 2024-09-02 20:07:23 +08:00
parent 0f368bcd5b
commit b281b56606
2 changed files with 11 additions and 13 deletions

View File

@ -778,7 +778,6 @@ private:
bool isInternaltestingBundle_ = false;
std::string appIdentifier_ = "";
Security::Verify::HapVerifyResult verifyRes_;
std::map<std::string, std::string> targetSoPathMap_;
bool copyHapToInstallPath_ = false;
std::string appDistributionType_;
// indicates sandboxd dirs need to create by extension

View File

@ -1204,13 +1204,6 @@ ErrCode BaseBundleInstaller::ProcessBundleInstall(const std::vector<std::string>
CHECK_RESULT_WITH_ROLLBACK(result, "internal processing failed with result %{public}d", newInfos, oldInfo);
UpdateInstallerState(InstallerState::INSTALL_INFO_SAVED); // ---- 80%
// copy hap or hsp to real install dir
SaveHapPathToRecords(installParam.isPreInstallApp, newInfos);
if (installParam.copyHapToInstallPath) {
LOG_D(BMS_TAG_INSTALLER, "begin to copy hap to install path");
result = SaveHapToInstallPath(newInfos);
CHECK_RESULT_WITH_ROLLBACK(result, "copy hap to install path failed %{public}d", newInfos, oldInfo);
}
// delete old native library path
if (NeedDeleteOldNativeLib(newInfos, oldInfo)) {
LOG_I(BMS_TAG_INSTALLER, "Delete old library");
@ -1221,6 +1214,14 @@ ErrCode BaseBundleInstaller::ProcessBundleInstall(const std::vector<std::string>
result = MoveSoFileToRealInstallationDir(newInfos);
CHECK_RESULT_WITH_ROLLBACK(result, "move so file to install path failed %{public}d", newInfos, oldInfo);
// copy hap or hsp to real install dir
SaveHapPathToRecords(installParam.isPreInstallApp, newInfos);
if (installParam.copyHapToInstallPath) {
LOG_D(BMS_TAG_INSTALLER, "begin to copy hap to install path");
result = SaveHapToInstallPath(newInfos);
CHECK_RESULT_WITH_ROLLBACK(result, "copy hap to install path failed %{public}d", newInfos, oldInfo);
}
// attention pls, rename operation shoule be almost the last operation to guarantee the rollback operation
// when someone failure occurs in the installation flow
result = RenameAllTempDir(newInfos);
@ -4648,7 +4649,6 @@ void BaseBundleInstaller::ResetInstallProperties()
isEnterpriseBundle_ = false;
isInternaltestingBundle_ = false;
appIdentifier_.clear();
targetSoPathMap_.clear();
isAppService_ = false;
}
@ -4977,7 +4977,6 @@ ErrCode BaseBundleInstaller::InnerProcessNativeLibs(InnerBundleInfo &info, const
targetSoPath.append(Constants::BUNDLE_CODE_DIR).append(ServiceConstants::PATH_SEPARATOR)
.append(info.GetBundleName()).append(ServiceConstants::PATH_SEPARATOR).append(nativeLibraryPath)
.append(ServiceConstants::PATH_SEPARATOR);
targetSoPathMap_.emplace(info.GetCurModuleName(), targetSoPath);
}
}
@ -5048,10 +5047,10 @@ ErrCode BaseBundleInstaller::VerifyCodeSignatureForHap(const std::unordered_map<
if (ret != ERR_OK) {
return ret;
}
auto targetSoPath = targetSoPathMap_.find(moduleName);
CodeSignatureParam codeSignatureParam;
if (targetSoPath != targetSoPathMap_.end()) {
codeSignatureParam.targetSoPath = targetSoPath->second;
if (!nativeLibraryPath.empty()) {
codeSignatureParam.targetSoPath.append(Constants::BUNDLE_CODE_DIR).append(ServiceConstants::PATH_SEPARATOR)
.append(bundleName_).append(ServiceConstants::PATH_SEPARATOR).append(nativeLibraryPath);
}
codeSignatureParam.cpuAbi = cpuAbi;
codeSignatureParam.modulePath = realHapPath;