From 2a52ebfdc47714aa4d916d57148a79b63b7b3857 Mon Sep 17 00:00:00 2001 From: Lotol Date: Wed, 28 Jun 2023 10:13:44 +0000 Subject: [PATCH 01/15] update services/bundlemgr/include/shared/inner_shared_bundle_installer.h. Signed-off-by: Lotol --- .../bundlemgr/include/shared/inner_shared_bundle_installer.h | 1 - 1 file changed, 1 deletion(-) diff --git a/services/bundlemgr/include/shared/inner_shared_bundle_installer.h b/services/bundlemgr/include/shared/inner_shared_bundle_installer.h index e78584ca2d..8080e9375c 100644 --- a/services/bundlemgr/include/shared/inner_shared_bundle_installer.h +++ b/services/bundlemgr/include/shared/inner_shared_bundle_installer.h @@ -97,7 +97,6 @@ private: const std::string &moduleName, const std::string &realHspPath, const std::string &versionDir); std::string ObtainTempSoPath(const std::string &moduleName, const std::string &nativeLibPath); - // the real path or the parent directory of hsp files to be installed. std::string sharedBundlePath_; std::string bundleName_; -- Gitee From 49b59e4e0f23e474c8e8cbc427644e975ecd815b Mon Sep 17 00:00:00 2001 From: Lotol Date: Wed, 28 Jun 2023 10:18:45 +0000 Subject: [PATCH 02/15] update services/bundlemgr/src/base_bundle_installer.cpp. Signed-off-by: Lotol --- services/bundlemgr/src/base_bundle_installer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index fbc7886f2c..df0e0c5788 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -3726,8 +3726,8 @@ ErrCode BaseBundleInstaller::MoveFileToRealInstallationDir( .append(nativeLibraryPath_); std::string realSoDir; realSoDir.append(Constants::BUNDLE_CODE_DIR).append(Constants::PATH_SEPARATOR) - .append(info.second.GetBundleName()).append(Constants::PATH_SEPARATOR) - .append(nativeLibraryPath_); + .append(info.second.GetBundleName()).append(Constants::PATH_SEPARATOR) + .append(nativeLibraryPath_); APP_LOGD("move so file from path %{public}s to path %{public}s", tempSoDir.c_str(), realSoDir.c_str()); auto result = InstalldClient::GetInstance()->MoveFiles(tempSoDir, realSoDir); if (result != ERR_OK) { -- Gitee From 7ee9d840b5c835fcd322d1641d52a4e2d17f2477 Mon Sep 17 00:00:00 2001 From: Lotol Date: Thu, 29 Jun 2023 02:33:17 +0000 Subject: [PATCH 03/15] update services/bundlemgr/src/base_bundle_installer.cpp. Signed-off-by: Lotol --- .../bundlemgr/src/base_bundle_installer.cpp | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index df0e0c5788..bbb8af51a6 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -3523,23 +3523,21 @@ ErrCode BaseBundleInstaller::InnerProcessNativeLibs(InnerBundleInfo &info, const std::string cpuAbi; std::string nativeLibraryPath; bool isCompressNativeLibrary = info.IsCompressNativeLibs(info.GetCurModuleName()); - if (info.FetchNativeSoAttrs(modulePackage_, cpuAbi, nativeLibraryPath)) { + if (info.FetchNativeSoAttrs(modulePackage_, cpuAbi, nativeLibraryPath) && + isCompressNativeLibrary) { nativeLibraryPath_ = nativeLibraryPath; - if (isCompressNativeLibrary) { - bool isLibIsolated = info.IsLibIsolated(info.GetCurModuleName()); - if (BundleUtil::EndWith(modulePath, Constants::TMP_SUFFIX)) { - if (isLibIsolated) { - nativeLibraryPath = BuildTempNativeLibraryPath(nativeLibraryPath); - } else { - nativeLibraryPath = info.GetCurrentModulePackage() + Constants::TMP_SUFFIX + - Constants::PATH_SEPARATOR + nativeLibraryPath; - } - APP_LOGD("Need extract to temp dir: %{public}s", nativeLibraryPath.c_str()); - } - targetSoPath.append(Constants::BUNDLE_CODE_DIR).append(Constants::PATH_SEPARATOR) - .append(info.GetBundleName()).append(Constants::PATH_SEPARATOR).append(nativeLibraryPath) - .append(Constants::PATH_SEPARATOR); - } + bool isLibIsolated = info.IsLibIsolated(info.GetCurModuleName()); + bool isEndWith = BundleUtil::EndWith(modulePath, Constants::TMP_SUFFIX); + if (isEndWith && isLibIsolated) { + nativeLibraryPath = BuildTempNativeLibraryPath(nativeLibraryPath); + } else if(isEndWith) { + nativeLibraryPath = info.GetCurrentModulePackage() + Constants::TMP_SUFFIX + + Constants::PATH_SEPARATOR + nativeLibraryPath; + } + APP_LOGD("Need extract to temp dir: %{public}s", nativeLibraryPath.c_str()); + targetSoPath.append(Constants::BUNDLE_CODE_DIR).append(Constants::PATH_SEPARATOR) + .append(info.GetBundleName()).append(Constants::PATH_SEPARATOR).append(nativeLibraryPath) + .append(Constants::PATH_SEPARATOR); } APP_LOGD("begin to extract module files, modulePath : %{private}s, targetSoPath : %{private}s, cpuAbi : %{public}s", -- Gitee From 76d0d2dd4123f45a9fbe783f8706481224a9b32b Mon Sep 17 00:00:00 2001 From: Lotol Date: Thu, 29 Jun 2023 02:38:46 +0000 Subject: [PATCH 04/15] update services/bundlemgr/src/bundle_install_checker.cpp. Signed-off-by: Lotol --- services/bundlemgr/src/bundle_install_checker.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/services/bundlemgr/src/bundle_install_checker.cpp b/services/bundlemgr/src/bundle_install_checker.cpp index 789659f0f2..8fbf4db775 100644 --- a/services/bundlemgr/src/bundle_install_checker.cpp +++ b/services/bundlemgr/src/bundle_install_checker.cpp @@ -240,10 +240,10 @@ ErrCode BundleInstallChecker::CheckMultipleHapsSignInfo( bool BundleInstallChecker::VaildInstallPermission(const InstallParam &installParam, const std::vector &hapVerifyRes) { - PermissionStatus installBundlestatus = installParam.installBundlePermissionStatus; + PermissionStatus installBundleStatus = installParam.installBundlePermissionStatus; PermissionStatus installEnterpriseBundleStatus = installParam.installEnterpriseBundlePermissionStatus; bool isCallByShell = installParam.isCallByShell; - if (!isCallByShell && installBundlestatus == PermissionStatus::HAVE_PERMISSION_STATUS && + if (!isCallByShell && installBundleStatus == PermissionStatus::HAVE_PERMISSION_STATUS && installEnterpriseBundleStatus == PermissionStatus::HAVE_PERMISSION_STATUS) { return true; } @@ -258,7 +258,7 @@ bool BundleInstallChecker::VaildInstallPermission(const InstallParam &installPar APP_LOGE("install enterprise bundle permission denied"); return false; } - } else if (installBundlestatus != PermissionStatus::HAVE_PERMISSION_STATUS) { + } else if (installBundleStatus != PermissionStatus::HAVE_PERMISSION_STATUS) { APP_LOGE("install permission denied"); return false; } @@ -357,10 +357,10 @@ ErrCode BundleInstallChecker::ParseHapFiles( bool BundleInstallChecker::VaildInstallPermissionForShare(const InstallCheckParam &checkParam, const std::vector &hapVerifyRes) { - PermissionStatus installBundlestatus = checkParam.installBundlePermissionStatus; + PermissionStatus installBundleStatus = checkParam.installBundlePermissionStatus; PermissionStatus installEnterpriseBundleStatus = checkParam.installEnterpriseBundlePermissionStatus; bool isCallByShell = checkParam.isCallByShell; - if (!isCallByShell && installBundlestatus == PermissionStatus::HAVE_PERMISSION_STATUS && + if (!isCallByShell && installBundleStatus == PermissionStatus::HAVE_PERMISSION_STATUS && installEnterpriseBundleStatus == PermissionStatus::HAVE_PERMISSION_STATUS) { return true; } @@ -368,14 +368,14 @@ bool BundleInstallChecker::VaildInstallPermissionForShare(const InstallCheckPara Security::Verify::ProvisionInfo provisionInfo = hapVerifyRes[i].GetProvisionInfo(); if (provisionInfo.distributionType == Security::Verify::AppDistType::ENTERPRISE) { if (isCallByShell && provisionInfo.type != Security::Verify::ProvisionType::DEBUG) { - APP_LOGE("install enterprise bundle permission denied"); + APP_LOGE("bm install enterprise bundle permission denied"); return false; } if (!isCallByShell && installEnterpriseBundleStatus != PermissionStatus::HAVE_PERMISSION_STATUS) { APP_LOGE("install enterprise bundle permission denied"); return false; } - } else if (installBundlestatus != PermissionStatus::HAVE_PERMISSION_STATUS) { + } else if (installBundleStatus != PermissionStatus::HAVE_PERMISSION_STATUS) { APP_LOGE("install permission denied"); return false; } -- Gitee From e336ac31e4f3b32d99965db333b050dc14cf4d6e Mon Sep 17 00:00:00 2001 From: Lotol Date: Thu, 29 Jun 2023 02:40:32 +0000 Subject: [PATCH 05/15] update services/bundlemgr/src/base_bundle_installer.cpp. Signed-off-by: Lotol --- services/bundlemgr/src/base_bundle_installer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index bbb8af51a6..f7a42f4b02 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -3727,7 +3727,7 @@ ErrCode BaseBundleInstaller::MoveFileToRealInstallationDir( .append(info.second.GetBundleName()).append(Constants::PATH_SEPARATOR) .append(nativeLibraryPath_); APP_LOGD("move so file from path %{public}s to path %{public}s", tempSoDir.c_str(), realSoDir.c_str()); - auto result = InstalldClient::GetInstance()->MoveFiles(tempSoDir, realSoDir); + result = InstalldClient::GetInstance()->MoveFiles(tempSoDir, realSoDir); if (result != ERR_OK) { APP_LOGE("move file to real path failed %{public}d", result); return ERR_APPEXECFWK_INSTALLD_MOVE_FILE_FAILED; -- Gitee From 736b04db7a30e71d8078e28379e9d46e3150698a Mon Sep 17 00:00:00 2001 From: Lotol Date: Thu, 29 Jun 2023 02:45:06 +0000 Subject: [PATCH 06/15] update services/bundlemgr/src/bundle_install_checker.cpp. Signed-off-by: Lotol --- services/bundlemgr/src/bundle_install_checker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/bundlemgr/src/bundle_install_checker.cpp b/services/bundlemgr/src/bundle_install_checker.cpp index 8fbf4db775..44f9ef2580 100644 --- a/services/bundlemgr/src/bundle_install_checker.cpp +++ b/services/bundlemgr/src/bundle_install_checker.cpp @@ -251,7 +251,7 @@ bool BundleInstallChecker::VaildInstallPermission(const InstallParam &installPar Security::Verify::ProvisionInfo provisionInfo = hapVerifyRes[i].GetProvisionInfo(); if (provisionInfo.distributionType == Security::Verify::AppDistType::ENTERPRISE) { if (isCallByShell && provisionInfo.type != Security::Verify::ProvisionType::DEBUG) { - APP_LOGE("install enterprise bundle permission denied"); + APP_LOGE("bm install enterprise bundle permission denied"); return false; } if (!isCallByShell && installEnterpriseBundleStatus != PermissionStatus::HAVE_PERMISSION_STATUS) { -- Gitee From 503a62152e502585abe50a02916ebda3f45f143e Mon Sep 17 00:00:00 2001 From: Lotol Date: Fri, 30 Jun 2023 02:23:40 +0000 Subject: [PATCH 07/15] update services/bundlemgr/src/base_bundle_installer.cpp. Signed-off-by: Lotol --- .../bundlemgr/src/base_bundle_installer.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index f7a42f4b02..9855b392d0 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -3523,18 +3523,18 @@ ErrCode BaseBundleInstaller::InnerProcessNativeLibs(InnerBundleInfo &info, const std::string cpuAbi; std::string nativeLibraryPath; bool isCompressNativeLibrary = info.IsCompressNativeLibs(info.GetCurModuleName()); - if (info.FetchNativeSoAttrs(modulePackage_, cpuAbi, nativeLibraryPath) && - isCompressNativeLibrary) { + if (info.FetchNativeSoAttrs(modulePackage_, cpuAbi, nativeLibraryPath) && isCompressNativeLibrary) { nativeLibraryPath_ = nativeLibraryPath; bool isLibIsolated = info.IsLibIsolated(info.GetCurModuleName()); - bool isEndWith = BundleUtil::EndWith(modulePath, Constants::TMP_SUFFIX); - if (isEndWith && isLibIsolated) { - nativeLibraryPath = BuildTempNativeLibraryPath(nativeLibraryPath); - } else if(isEndWith) { - nativeLibraryPath = info.GetCurrentModulePackage() + Constants::TMP_SUFFIX + - Constants::PATH_SEPARATOR + nativeLibraryPath; - } - APP_LOGD("Need extract to temp dir: %{public}s", nativeLibraryPath.c_str()); + if (BundleUtil::EndWith(modulePath, Constants::TMP_SUFFIX)) { + if (isLibIsolated) { + nativeLibraryPath = BuildTempNativeLibraryPath(nativeLibraryPath); + } else { + nativeLibraryPath = info.GetCurrentModulePackage() + Constants::TMP_SUFFIX + + Constants::PATH_SEPARATOR + nativeLibraryPath; + } + APP_LOGD("Need extract to temp dir: %{public}s", nativeLibraryPath.c_str()); + } targetSoPath.append(Constants::BUNDLE_CODE_DIR).append(Constants::PATH_SEPARATOR) .append(info.GetBundleName()).append(Constants::PATH_SEPARATOR).append(nativeLibraryPath) .append(Constants::PATH_SEPARATOR); -- Gitee From e09591542c408e6e9da8aca71cdf844b79238619 Mon Sep 17 00:00:00 2001 From: Lotol Date: Fri, 30 Jun 2023 02:55:21 +0000 Subject: [PATCH 08/15] update services/bundlemgr/test/mock/src/accesstoken_kit.cpp. Signed-off-by: Lotol --- services/bundlemgr/test/mock/src/accesstoken_kit.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/bundlemgr/test/mock/src/accesstoken_kit.cpp b/services/bundlemgr/test/mock/src/accesstoken_kit.cpp index ef134050a0..7723b77846 100644 --- a/services/bundlemgr/test/mock/src/accesstoken_kit.cpp +++ b/services/bundlemgr/test/mock/src/accesstoken_kit.cpp @@ -18,6 +18,9 @@ namespace OHOS { namespace Security { namespace AccessToken { +namespace { +constexpr int GRANT_STATUS = 100; +} AccessTokenIDEx AccessTokenKit::AllocHapToken(const HapInfoParams& info, const HapPolicyParams& policy) { AccessTokenIDEx token; @@ -66,7 +69,7 @@ int AccessTokenKit::GetReqPermissions(AccessTokenID tokenID, std::vector Date: Fri, 30 Jun 2023 06:31:45 +0000 Subject: [PATCH 09/15] update services/bundlemgr/test/mock/src/accesstoken_kit.cpp. Signed-off-by: Lotol --- services/bundlemgr/test/mock/src/accesstoken_kit.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/bundlemgr/test/mock/src/accesstoken_kit.cpp b/services/bundlemgr/test/mock/src/accesstoken_kit.cpp index 7723b77846..212e23a946 100644 --- a/services/bundlemgr/test/mock/src/accesstoken_kit.cpp +++ b/services/bundlemgr/test/mock/src/accesstoken_kit.cpp @@ -18,9 +18,8 @@ namespace OHOS { namespace Security { namespace AccessToken { -namespace { constexpr int GRANT_STATUS = 100; -} + AccessTokenIDEx AccessTokenKit::AllocHapToken(const HapInfoParams& info, const HapPolicyParams& policy) { AccessTokenIDEx token; -- Gitee From 6ec700146d35b28e95d1800f3f089bbef5ac99fb Mon Sep 17 00:00:00 2001 From: Lotol Date: Fri, 30 Jun 2023 06:36:09 +0000 Subject: [PATCH 10/15] update services/bundlemgr/test/mock/src/accesstoken_kit.cpp. Signed-off-by: Lotol --- services/bundlemgr/test/mock/src/accesstoken_kit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/bundlemgr/test/mock/src/accesstoken_kit.cpp b/services/bundlemgr/test/mock/src/accesstoken_kit.cpp index 212e23a946..9f7be1854f 100644 --- a/services/bundlemgr/test/mock/src/accesstoken_kit.cpp +++ b/services/bundlemgr/test/mock/src/accesstoken_kit.cpp @@ -18,7 +18,7 @@ namespace OHOS { namespace Security { namespace AccessToken { -constexpr int GRANT_STATUS = 100; +static constexpr int GRANT_STATUS = 100; AccessTokenIDEx AccessTokenKit::AllocHapToken(const HapInfoParams& info, const HapPolicyParams& policy) { -- Gitee From f32545e1f1383dbcd9ba78a28147bfa747955f37 Mon Sep 17 00:00:00 2001 From: Lotol Date: Fri, 30 Jun 2023 08:02:12 +0000 Subject: [PATCH 11/15] update services/bundlemgr/test/mock/src/accesstoken_kit.cpp. Signed-off-by: Lotol --- services/bundlemgr/test/mock/src/accesstoken_kit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/bundlemgr/test/mock/src/accesstoken_kit.cpp b/services/bundlemgr/test/mock/src/accesstoken_kit.cpp index 9f7be1854f..e151acfe28 100644 --- a/services/bundlemgr/test/mock/src/accesstoken_kit.cpp +++ b/services/bundlemgr/test/mock/src/accesstoken_kit.cpp @@ -18,7 +18,7 @@ namespace OHOS { namespace Security { namespace AccessToken { -static constexpr int GRANT_STATUS = 100; +static const int GRANT_STATUS = 100; AccessTokenIDEx AccessTokenKit::AllocHapToken(const HapInfoParams& info, const HapPolicyParams& policy) { -- Gitee From ed05bc87c18ba50e7a1b7efb82c7dbcd0f94d0ca Mon Sep 17 00:00:00 2001 From: Lotol Date: Fri, 30 Jun 2023 08:06:47 +0000 Subject: [PATCH 12/15] update services/bundlemgr/src/base_bundle_installer.cpp. Signed-off-by: Lotol --- services/bundlemgr/src/base_bundle_installer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index 9855b392d0..8f28bec34f 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -3523,8 +3523,7 @@ ErrCode BaseBundleInstaller::InnerProcessNativeLibs(InnerBundleInfo &info, const std::string cpuAbi; std::string nativeLibraryPath; bool isCompressNativeLibrary = info.IsCompressNativeLibs(info.GetCurModuleName()); - if (info.FetchNativeSoAttrs(modulePackage_, cpuAbi, nativeLibraryPath) && isCompressNativeLibrary) { - nativeLibraryPath_ = nativeLibraryPath; + if (isCompressNativeLibrary) { bool isLibIsolated = info.IsLibIsolated(info.GetCurModuleName()); if (BundleUtil::EndWith(modulePath, Constants::TMP_SUFFIX)) { if (isLibIsolated) { -- Gitee From ca0a0e461453fb7f6ec33c462427e44deafd5a56 Mon Sep 17 00:00:00 2001 From: Lotol Date: Fri, 30 Jun 2023 08:09:36 +0000 Subject: [PATCH 13/15] update services/bundlemgr/src/base_bundle_installer.cpp. Signed-off-by: Lotol --- services/bundlemgr/src/base_bundle_installer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index 8f28bec34f..bc56ccd95f 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -3523,6 +3523,8 @@ ErrCode BaseBundleInstaller::InnerProcessNativeLibs(InnerBundleInfo &info, const std::string cpuAbi; std::string nativeLibraryPath; bool isCompressNativeLibrary = info.IsCompressNativeLibs(info.GetCurModuleName()); + if (info.FetchNativeSoAttrs(modulePackage_, cpuAbi, nativeLibraryPath)) { + nativeLibraryPath_ = nativeLibraryPath; if (isCompressNativeLibrary) { bool isLibIsolated = info.IsLibIsolated(info.GetCurModuleName()); if (BundleUtil::EndWith(modulePath, Constants::TMP_SUFFIX)) { -- Gitee From d4f6c94e7b735799b64002e822d2f9a301f172bf Mon Sep 17 00:00:00 2001 From: Lotol Date: Fri, 30 Jun 2023 08:13:11 +0000 Subject: [PATCH 14/15] update services/bundlemgr/src/base_bundle_installer.cpp. Signed-off-by: Lotol --- .../bundlemgr/src/base_bundle_installer.cpp | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index bc56ccd95f..422458d62c 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -3524,21 +3524,22 @@ ErrCode BaseBundleInstaller::InnerProcessNativeLibs(InnerBundleInfo &info, const std::string nativeLibraryPath; bool isCompressNativeLibrary = info.IsCompressNativeLibs(info.GetCurModuleName()); if (info.FetchNativeSoAttrs(modulePackage_, cpuAbi, nativeLibraryPath)) { - nativeLibraryPath_ = nativeLibraryPath; - if (isCompressNativeLibrary) { - bool isLibIsolated = info.IsLibIsolated(info.GetCurModuleName()); - if (BundleUtil::EndWith(modulePath, Constants::TMP_SUFFIX)) { - if (isLibIsolated) { - nativeLibraryPath = BuildTempNativeLibraryPath(nativeLibraryPath); - } else { - nativeLibraryPath = info.GetCurrentModulePackage() + Constants::TMP_SUFFIX + - Constants::PATH_SEPARATOR + nativeLibraryPath; + nativeLibraryPath_ = nativeLibraryPath; + if (isCompressNativeLibrary) { + bool isLibIsolated = info.IsLibIsolated(info.GetCurModuleName()); + if (BundleUtil::EndWith(modulePath, Constants::TMP_SUFFIX)) { + if (isLibIsolated) { + nativeLibraryPath = BuildTempNativeLibraryPath(nativeLibraryPath); + } else { + nativeLibraryPath = info.GetCurrentModulePackage() + Constants::TMP_SUFFIX + + Constants::PATH_SEPARATOR + nativeLibraryPath; + } + APP_LOGD("Need extract to temp dir: %{public}s", nativeLibraryPath.c_str()); } - APP_LOGD("Need extract to temp dir: %{public}s", nativeLibraryPath.c_str()); + targetSoPath.append(Constants::BUNDLE_CODE_DIR).append(Constants::PATH_SEPARATOR) + .append(info.GetBundleName()).append(Constants::PATH_SEPARATOR).append(nativeLibraryPath) + .append(Constants::PATH_SEPARATOR); } - targetSoPath.append(Constants::BUNDLE_CODE_DIR).append(Constants::PATH_SEPARATOR) - .append(info.GetBundleName()).append(Constants::PATH_SEPARATOR).append(nativeLibraryPath) - .append(Constants::PATH_SEPARATOR); } APP_LOGD("begin to extract module files, modulePath : %{private}s, targetSoPath : %{private}s, cpuAbi : %{public}s", -- Gitee From ea0b4bf241a8d2fde38d2daa8209b33a65ba0636 Mon Sep 17 00:00:00 2001 From: Lotol Date: Fri, 30 Jun 2023 09:14:59 +0000 Subject: [PATCH 15/15] update services/bundlemgr/test/mock/src/accesstoken_kit.cpp. Signed-off-by: Lotol --- services/bundlemgr/test/mock/src/accesstoken_kit.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/services/bundlemgr/test/mock/src/accesstoken_kit.cpp b/services/bundlemgr/test/mock/src/accesstoken_kit.cpp index e151acfe28..ef134050a0 100644 --- a/services/bundlemgr/test/mock/src/accesstoken_kit.cpp +++ b/services/bundlemgr/test/mock/src/accesstoken_kit.cpp @@ -18,8 +18,6 @@ namespace OHOS { namespace Security { namespace AccessToken { -static const int GRANT_STATUS = 100; - AccessTokenIDEx AccessTokenKit::AllocHapToken(const HapInfoParams& info, const HapPolicyParams& policy) { AccessTokenIDEx token; @@ -68,7 +66,7 @@ int AccessTokenKit::GetReqPermissions(AccessTokenID tokenID, std::vector