From fa476295d1004b0ca3e13e9a549c0fd56cb27b25 Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Tue, 16 May 2023 16:57:40 +0800 Subject: [PATCH 1/5] IssueNo:#I73J5U Description:add compressNativeLibs Sig:SIG_ApplicaitonFramework Feature or Bugfix:Feature Binary Source:No Signed-off-by: wangtiantian --- .../appexecfwk_base/include/hap_module_info.h | 2 ++ .../appexecfwk_base/src/hap_module_info.cpp | 22 ++++++++++++++++- services/bundlemgr/include/common_profile.h | 1 + .../bundlemgr/include/inner_bundle_info.h | 2 ++ services/bundlemgr/src/bundle_profile.cpp | 12 ++++++++++ services/bundlemgr/src/inner_bundle_info.cpp | 24 ++++++++++++++++++- services/bundlemgr/src/module_profile.cpp | 22 +++++++++++++++++ 7 files changed, 83 insertions(+), 2 deletions(-) diff --git a/interfaces/inner_api/appexecfwk_base/include/hap_module_info.h b/interfaces/inner_api/appexecfwk_base/include/hap_module_info.h index 17b822bb0e..6d7db48fc1 100644 --- a/interfaces/inner_api/appexecfwk_base/include/hap_module_info.h +++ b/interfaces/inner_api/appexecfwk_base/include/hap_module_info.h @@ -102,6 +102,8 @@ struct HapModuleInfo : public Parcelable { bool isLibIsolated = false; std::string nativeLibraryPath; std::string cpuAbi; + bool compressNativeLibs = true; + std::vector nativeLibraryFileNames; // quick fix hqf info HqfInfo hqfInfo; diff --git a/interfaces/inner_api/appexecfwk_base/src/hap_module_info.cpp b/interfaces/inner_api/appexecfwk_base/src/hap_module_info.cpp index 95deeb1787..ad6779e0cb 100644 --- a/interfaces/inner_api/appexecfwk_base/src/hap_module_info.cpp +++ b/interfaces/inner_api/appexecfwk_base/src/hap_module_info.cpp @@ -78,6 +78,8 @@ const std::string PROXY_DATA_REQUIRED_WRITE_PERMISSION = "requiredWritePermissio const std::string PROXY_DATA_METADATA = "metadata"; const std::string HAP_MODULE_INFO_BUILD_HASH = "buildHash"; const std::string HAP_MODULE_INFO_ISOLATION_MODE = "isolationMode"; +const std::string HAP_MODULE_INFO_COMPRESS_NATIVE_LIBS = "compressNativeLibs"; +const std::string HAP_MODULE_INFO_NATIVE_LIBRARY_FILE_NAMES = "nativeLibraryFileNames"; const size_t MODULE_CAPACITY = 10240; // 10K } @@ -598,7 +600,9 @@ void to_json(nlohmann::json &jsonObject, const HapModuleInfo &hapModuleInfo) {HAP_MODULE_INFO_PRELOADS, hapModuleInfo.preloads}, {HAP_MODULE_INFO_PROXY_DATAS, hapModuleInfo.proxyDatas}, {HAP_MODULE_INFO_BUILD_HASH, hapModuleInfo.buildHash}, - {HAP_MODULE_INFO_ISOLATION_MODE, hapModuleInfo.isolationMode} + {HAP_MODULE_INFO_ISOLATION_MODE, hapModuleInfo.isolationMode}, + {HAP_MODULE_INFO_COMPRESS_NATIVE_LIBS, hapModuleInfo.compressNativeLibs}, + {HAP_MODULE_INFO_NATIVE_LIBRARY_FILE_NAMES, hapModuleInfo.nativeLibraryFileNames} }; } @@ -998,6 +1002,22 @@ void from_json(const nlohmann::json &jsonObject, HapModuleInfo &hapModuleInfo) false, parseResult, ArrayType::NOT_ARRAY); + GetValueIfFindKey(jsonObject, + jsonObjectEnd, + HAP_MODULE_INFO_COMPRESS_NATIVE_LIBS, + hapModuleInfo.compressNativeLibs, + JsonType::BOOLEAN, + false, + parseResult, + ArrayType::NOT_ARRAY); + GetValueIfFindKey>(jsonObject, + jsonObjectEnd, + HAP_MODULE_INFO_NATIVE_LIBRARY_FILE_NAMES, + hapModuleInfo.nativeLibraryFileNames, + JsonType::ARRAY, + false, + parseResult, + ArrayType::STRING); if (parseResult != ERR_OK) { APP_LOGW("HapModuleInfo from_json error, error code : %{public}d", parseResult); } diff --git a/services/bundlemgr/include/common_profile.h b/services/bundlemgr/include/common_profile.h index 3d84ee3ceb..63b6ce1988 100644 --- a/services/bundlemgr/include/common_profile.h +++ b/services/bundlemgr/include/common_profile.h @@ -363,6 +363,7 @@ constexpr const char* MODULE_ATOMIC_SERVICE = "atomicService"; constexpr const char* MODULE_PROXY_DATAS = "proxyDatas"; constexpr const char* MODULE_BUILD_HASH = "buildHash"; constexpr const char* MODULE_ISOLATION_MODE = "isolationMode"; +constexpr const char* MODULE_COMPRESS_NATIVE_LIBS = "compressNativeLibs"; // module type constexpr const char* MODULE_TYPE_ENTRY = "entry"; constexpr const char* MODULE_TYPE_FEATURE = "feature"; diff --git a/services/bundlemgr/include/inner_bundle_info.h b/services/bundlemgr/include/inner_bundle_info.h index f84d925441..876137b717 100644 --- a/services/bundlemgr/include/inner_bundle_info.h +++ b/services/bundlemgr/include/inner_bundle_info.h @@ -120,6 +120,8 @@ struct InnerModuleInfo { std::vector proxyDatas; std::string buildHash; std::string isolationMode; + bool compressNativeLibs = true; + std::vector nativeLibraryFileNames; }; struct SkillUri { diff --git a/services/bundlemgr/src/bundle_profile.cpp b/services/bundlemgr/src/bundle_profile.cpp index 52401a77f2..76fa22742c 100644 --- a/services/bundlemgr/src/bundle_profile.cpp +++ b/services/bundlemgr/src/bundle_profile.cpp @@ -2009,6 +2009,17 @@ void UpdateNativeSoAttrs( APP_LOGD("cpuAbi %{public}s, soRelativePath : %{public}s, isLibIsolated : %{public}d", cpuAbi.c_str(), soRelativePath.c_str(), isLibIsolated); innerBundleInfo.SetCpuAbi(cpuAbi); + auto hapModuleInfo = innerBundleInfo.GetInnerModuleInfoByModuleName(innerBundleInfo.GetCurModuleName()); + if (hapModuleInfo == std::nullopt) { + APP_LOGE("moduleName: %{public}s is not exist", innerBundleInfo.GetCurModuleName().c_str()); + return; + } + if (!hapModuleInfo->compressNativeLibs) { + APP_LOGD("UpdateNativeSoAttrs compressNativeLibs is false, no need to decompress so"); + innerBundleInfo.SetModuleNativeLibraryPath(soRelativePath); + innerBundleInfo.SetModuleCpuAbi(cpuAbi); + return; + } if (!isLibIsolated) { innerBundleInfo.SetNativeLibraryPath(soRelativePath); return; @@ -2277,6 +2288,7 @@ bool ToInnerModuleInfo(const ProfileReader::ConfigJson &configJson, InnerModuleI innerModuleInfo.isLibIsolated = configJson.module.isLibIsolated; innerModuleInfo.deviceTypes = configJson.module.deviceType; innerModuleInfo.buildHash = configJson.module.buildHash; + innerModuleInfo.compressNativeLibs = configJson.deveicConfig.defaultDevice.compressNativeLibs; return true; } diff --git a/services/bundlemgr/src/inner_bundle_info.cpp b/services/bundlemgr/src/inner_bundle_info.cpp index 9439e8707a..232a25d4d0 100644 --- a/services/bundlemgr/src/inner_bundle_info.cpp +++ b/services/bundlemgr/src/inner_bundle_info.cpp @@ -131,6 +131,8 @@ const std::string MODULE_VERSION_NAME = "versionName"; const std::string MODULE_PROXY_DATAS = "proxyDatas"; const std::string MODULE_BUILD_HASH = "buildHash"; const std::string MODULE_ISOLATION_MODE = "isolationMode"; +const std::string MODULE_COMPRESS_NATIVE_LIBS = "compressNativeLibs"; +const std::string MODULE_NATIVE_LIBRARY_FILE_NAMES = "nativeLibraryFileNames"; const int32_t SINGLE_HSP_VERSION = 1; const std::map ISOLATION_MODE_MAP = { {"isolationOnly", IsolationMode::ISOLATION_ONLY}, @@ -564,7 +566,9 @@ void to_json(nlohmann::json &jsonObject, const InnerModuleInfo &info) {MODULE_VERSION_NAME, info.versionName}, {MODULE_PROXY_DATAS, info.proxyDatas}, {MODULE_BUILD_HASH, info.buildHash}, - {MODULE_ISOLATION_MODE, info.isolationMode} + {MODULE_ISOLATION_MODE, info.isolationMode}, + {MODULE_COMPRESS_NATIVE_LIBS, info.compressNativeLibs}, + {MODULE_NATIVE_LIBRARY_FILE_NAMES, info.nativeLibraryFileNames} }; } @@ -1084,6 +1088,22 @@ void from_json(const nlohmann::json &jsonObject, InnerModuleInfo &info) false, parseResult, ArrayType::NOT_ARRAY); + GetValueIfFindKey(jsonObject, + jsonObjectEnd, + MODULE_COMPRESS_NATIVE_LIBS, + info.compressNativeLibs, + JsonType::BOOLEAN, + false, + parseResult, + ArrayType::NOT_ARRAY); + GetValueIfFindKey>(jsonObject, + jsonObjectEnd, + MODULE_NATIVE_LIBRARY_FILE_NAMES, + info.nativeLibraryFileNames, + JsonType::ARRAY, + false, + parseResult, + ArrayType::STRING); if (parseResult != ERR_OK) { APP_LOGE("read InnerModuleInfo from database error, error code : %{public}d", parseResult); } @@ -1753,6 +1773,8 @@ std::optional InnerBundleInfo::FindHapModuleInfo(const std::strin } hapInfo.buildHash = it->second.buildHash; hapInfo.isolationMode = GetIsolationMode(it->second.isolationMode); + hapInfo.compressNativeLibs = it->second.compressNativeLibs; + hapInfo.nativeLibraryFileNames = it->second.nativeLibraryFileNames; return hapInfo; } diff --git a/services/bundlemgr/src/module_profile.cpp b/services/bundlemgr/src/module_profile.cpp index f30af3d449..03e0f01380 100644 --- a/services/bundlemgr/src/module_profile.cpp +++ b/services/bundlemgr/src/module_profile.cpp @@ -250,6 +250,7 @@ struct Module { std::vector proxyDatas; std::string buildHash; std::string isolationMode; + bool compressNativeLibs = true; }; struct ModuleJson { @@ -1325,6 +1326,14 @@ void from_json(const nlohmann::json &jsonObject, Module &module) false, g_parseResult, ArrayType::NOT_ARRAY); + GetValueIfFindKey(jsonObject, + jsonObjectEnd, + MODULE_COMPRESS_NATIVE_LIBS, + module.compressNativeLibs, + JsonType::BOOLEAN, + false, + g_parseResult, + ArrayType::NOT_ARRAY); } void from_json(const nlohmann::json &jsonObject, ModuleJson &moduleJson) @@ -1413,6 +1422,18 @@ void UpdateNativeSoAttrs( APP_LOGD("cpuAbi %{public}s, soRelativePath : %{public}s, isLibIsolated : %{public}d", cpuAbi.c_str(), soRelativePath.c_str(), isLibIsolated); innerBundleInfo.SetCpuAbi(cpuAbi); + auto hapModuleInfo = innerBundleInfo.GetInnerModuleInfoByModuleName(innerBundleInfo.GetCurModuleName()); + if (hapModuleInfo == std::nullopt) { + APP_LOGE("moduleName: %{public}s is not exist", innerBundleInfo.GetCurModuleName().c_str()); + return; + } + if (!hapModuleInfo->compressNativeLibs) { + APP_LOGD("UpdateNativeSoAttrs compressNativeLibs is false, no need to decompress so"); + innerBundleInfo.SetModuleNativeLibraryPath(soRelativePath); + innerBundleInfo.SetSharedModuleNativeLibraryPath(soRelativePath); + innerBundleInfo.SetModuleCpuAbi(cpuAbi); + return; + } if (!isLibIsolated) { innerBundleInfo.SetNativeLibraryPath(soRelativePath); return; @@ -2005,6 +2026,7 @@ bool ToInnerModuleInfo( innerModuleInfo.proxyDatas = moduleJson.module.proxyDatas; innerModuleInfo.buildHash = moduleJson.module.buildHash; innerModuleInfo.isolationMode = moduleJson.module.isolationMode; + innerModuleInfo.compressNativeLibs = moduleJson.module.compressNativeLibs; // abilities and extensionAbilities store in InnerBundleInfo return true; } -- Gitee From 37e7de97aab770f958d4b5e876c78a159f655363 Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Tue, 16 May 2023 21:00:20 +0800 Subject: [PATCH 2/5] IssueNo:#I73J5U Description:add GetNativteLibraryFileNames Sig:SIG_ApplicaitonFramework Feature or Bugfix:Feature Binary Source:No Signed-off-by: wangtiantian --- .../include/installd/installd_host_impl.h | 3 +++ .../include/installd/installd_operator.h | 3 +++ .../bundlemgr/include/ipc/installd_host.h | 2 ++ .../include/ipc/installd_interface.h | 6 ++++- .../bundlemgr/include/ipc/installd_proxy.h | 3 +++ services/bundlemgr/src/inner_bundle_info.cpp | 6 +++++ .../src/installd/installd_host_impl.cpp | 12 ++++++++++ .../src/installd/installd_operator.cpp | 22 +++++++++++++++++++ services/bundlemgr/src/ipc/installd_host.cpp | 15 +++++++++++++ services/bundlemgr/src/ipc/installd_proxy.cpp | 22 +++++++++++++++++++ 10 files changed, 93 insertions(+), 1 deletion(-) diff --git a/services/bundlemgr/include/installd/installd_host_impl.h b/services/bundlemgr/include/installd/installd_host_impl.h index b1dd992908..f83bf75b5b 100644 --- a/services/bundlemgr/include/installd/installd_host_impl.h +++ b/services/bundlemgr/include/installd/installd_host_impl.h @@ -142,6 +142,9 @@ public: virtual ErrCode CopyFiles(const std::string &sourceDir, const std::string &destinationDir) override; + virtual ErrCode GetNativeLibraryFileNames(const std::string &filePath, const std::string &cpuAbi, + std::vector &fileNames) override; + private: std::string GetBundleDataDir(const std::string &el, const int userid) const; }; diff --git a/services/bundlemgr/include/installd/installd_operator.h b/services/bundlemgr/include/installd/installd_operator.h index 6e9e471ec7..8601a18670 100644 --- a/services/bundlemgr/include/installd/installd_operator.h +++ b/services/bundlemgr/include/installd/installd_operator.h @@ -190,6 +190,9 @@ public: static bool CopyFiles(const std::string &sourceDir, const std::string &destinationDir); + static bool GetNativeLibraryFileNames(const std::string &filePath, const std::string &cpuAbi, + std::vector &fileNames); + private: static bool OpenHandle(void **handle); diff --git a/services/bundlemgr/include/ipc/installd_host.h b/services/bundlemgr/include/ipc/installd_host.h index b15976117b..f829c5d400 100644 --- a/services/bundlemgr/include/ipc/installd_host.h +++ b/services/bundlemgr/include/ipc/installd_host.h @@ -146,6 +146,8 @@ private: bool HandCopyFiles(MessageParcel &data, MessageParcel &reply); + bool HandGetNativeLibraryFileNames(MessageParcel &data, MessageParcel &reply); + using InstalldFunc = bool (InstalldHost::*)(MessageParcel &, MessageParcel &); std::unordered_map funcMap_; }; diff --git a/services/bundlemgr/include/ipc/installd_interface.h b/services/bundlemgr/include/ipc/installd_interface.h index 71679aab23..8d34dde554 100644 --- a/services/bundlemgr/include/ipc/installd_interface.h +++ b/services/bundlemgr/include/ipc/installd_interface.h @@ -184,6 +184,9 @@ public: virtual ErrCode CopyFiles(const std::string &sourceDir, const std::string &destinationDir) = 0; + virtual ErrCode GetNativeLibraryFileNames(const std::string &filePath, const std::string &cpuAbi, + std::vector &fileNames) = 0; + protected: enum Message : uint32_t { CREATE_BUNDLE_DIR = 1, @@ -208,7 +211,8 @@ protected: IS_DIR_EMPTY, OBTAIN_QUICK_FIX_DIR, COPY_FILES, - EXTRACT_FILES + EXTRACT_FILES, + GET_NATIVE_LIBRARY_FILE_NAMES }; }; diff --git a/services/bundlemgr/include/ipc/installd_proxy.h b/services/bundlemgr/include/ipc/installd_proxy.h index 32a80cef53..c6794da997 100644 --- a/services/bundlemgr/include/ipc/installd_proxy.h +++ b/services/bundlemgr/include/ipc/installd_proxy.h @@ -143,6 +143,9 @@ public: virtual ErrCode CopyFiles(const std::string &sourceDir, const std::string &destinationDir) override; + virtual ErrCode GetNativeLibraryFileNames(const std::string &filePath, const std::string &cpuAbi, + std::vector &fileNames) override; + private: ErrCode TransactInstalldCmd(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option); diff --git a/services/bundlemgr/src/inner_bundle_info.cpp b/services/bundlemgr/src/inner_bundle_info.cpp index 232a25d4d0..bfed0933eb 100644 --- a/services/bundlemgr/src/inner_bundle_info.cpp +++ b/services/bundlemgr/src/inner_bundle_info.cpp @@ -3711,6 +3711,12 @@ bool InnerBundleInfo::FetchNativeSoAttrs( } auto &moduleInfo = moduleIter->second; + if (!moduleInfo.compressNativeLibs) { + cpuAbi = moduleInfo.cpuAbi; + nativeLibraryPath = moduleInfo.nativeLibraryPath; + return !nativeLibraryPath.empty(); + } + if (moduleInfo.isLibIsolated) { cpuAbi = moduleInfo.cpuAbi; nativeLibraryPath = moduleInfo.nativeLibraryPath; diff --git a/services/bundlemgr/src/installd/installd_host_impl.cpp b/services/bundlemgr/src/installd/installd_host_impl.cpp index ba050ad01a..d1c9c15063 100644 --- a/services/bundlemgr/src/installd/installd_host_impl.cpp +++ b/services/bundlemgr/src/installd/installd_host_impl.cpp @@ -637,5 +637,17 @@ ErrCode InstalldHostImpl::CopyFiles(const std::string &sourceDir, const std::str InstalldOperator::CopyFiles(sourceDir, destinationDir); return ERR_OK; } + +ErrCode InstalldHostImpl::GetNativeLibraryFileNames(const std::string &filePath, const std::string &cpuAbi, + std::vector &fileNames) +{ + if (!InstalldPermissionMgr::VerifyCallingPermission(Constants::FOUNDATION_UID)) { + APP_LOGE("installd permission denied, only used for foundation process"); + return ERR_APPEXECFWK_INSTALLD_PERMISSION_DENIED; + } + + InstalldOperator::GetNativeLibraryFileNames(filePath, cpuAbi, fileNames); + return ERR_OK; +} } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/src/installd/installd_operator.cpp b/services/bundlemgr/src/installd/installd_operator.cpp index a8cdce5b48..ca0da41cf2 100644 --- a/services/bundlemgr/src/installd/installd_operator.cpp +++ b/services/bundlemgr/src/installd/installd_operator.cpp @@ -912,5 +912,27 @@ bool InstalldOperator::CopyFiles(const std::string &sourceDir, const std::string closedir(directory); return true; } + +bool InstalldOperator::GetNativeLibraryFileNames(const std::string &filePath, const std::string &cpuAbi, + std::vector &fileNames) +{ + BundleExtractor extractor(filePath); + if (!extractor.Init()) { + return false; + } + std::vector entryNames; + if (!extractor.GetZipFileNames(entryNames)) { + return false; + } + std::string prefix = Constants::LIBS + cpuAbi + Constants::PATH_SEPARATOR; + for (const auto &entryName : entryNames) { + if ((entryName.find(prefix) == 0) && + (entryName.find(Constants::SO_SUFFIX) != std::string::npos)) { + fileNames.push_back(entryName.substr(prefix.length(), entryName.length())); + } + } + APP_LOGD("InstalldOperator::GetNativeLibraryFileNames end"); + return true; +} } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/services/bundlemgr/src/ipc/installd_host.cpp b/services/bundlemgr/src/ipc/installd_host.cpp index 122a593d00..590acb2b57 100644 --- a/services/bundlemgr/src/ipc/installd_host.cpp +++ b/services/bundlemgr/src/ipc/installd_host.cpp @@ -60,6 +60,7 @@ void InstalldHost::init() funcMap_.emplace(IInstalld::Message::OBTAIN_QUICK_FIX_DIR, &InstalldHost::HandObtainQuickFixFileDir); funcMap_.emplace(IInstalld::Message::COPY_FILES, &InstalldHost::HandCopyFiles); funcMap_.emplace(IInstalld::Message::EXTRACT_FILES, &InstalldHost::HandleExtractFiles); + funcMap_.emplace(IInstalld::Message::GET_NATIVE_LIBRARY_FILE_NAMES, &InstalldHost::HandGetNativeLibraryFileNames); } int InstalldHost::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) @@ -341,5 +342,19 @@ bool InstalldHost::HandCopyFiles(MessageParcel &data, MessageParcel &reply) WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, reply, result); return true; } + +bool InstalldHost::HandGetNativeLibraryFileNames(MessageParcel &data, MessageParcel &reply) +{ + std::string filePath = Str16ToStr8(data.ReadString16()); + std::string cupAbi = Str16ToStr8(data.ReadString16()); + std::vector fileNames; + ErrCode result = GetNativeLibraryFileNames(filePath, cupAbi, fileNames); + WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, reply, result); + if ((result == ERR_OK) && !reply.WriteStringVector(fileNames)) { + APP_LOGE("fail to obtain fileNames from reply"); + return false; + } + return true; +} } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/src/ipc/installd_proxy.cpp b/services/bundlemgr/src/ipc/installd_proxy.cpp index 5d041e2019..7ac2888300 100644 --- a/services/bundlemgr/src/ipc/installd_proxy.cpp +++ b/services/bundlemgr/src/ipc/installd_proxy.cpp @@ -388,6 +388,28 @@ ErrCode InstalldProxy::CopyFiles(const std::string &sourceDir, const std::string return ERR_OK; } +ErrCode InstalldProxy::GetNativeLibraryFileNames(const std::string &filePath, const std::string &cpuAbi, + std::vector &fileNames) +{ + MessageParcel data; + INSTALLD_PARCEL_WRITE_INTERFACE_TOKEN(data, (GetDescriptor())); + INSTALLD_PARCEL_WRITE(data, String16, Str8ToStr16(filePath)); + INSTALLD_PARCEL_WRITE(data, String16, Str8ToStr16(cpuAbi)); + + MessageParcel reply; + MessageOption option(MessageOption::TF_SYNC); + auto ret = TransactInstalldCmd(IInstalld::Message::GET_NATIVE_LIBRARY_FILE_NAMES, data, reply, option); + if (ret != ERR_OK) { + APP_LOGE("TransactInstalldCmd failed"); + return ret; + } + if (!reply.ReadStringVector(&fileNames)) { + APP_LOGE("ReadStringVector failed"); + return ERR_APPEXECFWK_PARCEL_ERROR; + } + return ERR_OK; +} + ErrCode InstalldProxy::TransactInstalldCmd(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { -- Gitee From 8df1662de7d9ead2d2497acd903e9bfce846e845 Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Wed, 17 May 2023 09:18:53 +0800 Subject: [PATCH 3/5] IssueNo:#I73J5U Description:adapt nativeLibraryPath Sig:SIG_ApplicaitonFramework Feature or Bugfix:Feature Binary Source:No Signed-off-by: wangtiantian --- .../appexecfwk_base/src/hap_module_info.cpp | 2 +- .../bundlemgr/include/base_bundle_installer.h | 1 + .../bundlemgr/include/inner_bundle_info.h | 15 +---- services/bundlemgr/include/installd_client.h | 3 + .../bundlemgr/src/base_bundle_installer.cpp | 63 +++++++++++++------ services/bundlemgr/src/bundle_profile.cpp | 8 +-- services/bundlemgr/src/inner_bundle_info.cpp | 42 ++++++++++++- services/bundlemgr/src/installd_client.cpp | 6 ++ services/bundlemgr/src/module_profile.cpp | 7 +-- .../test/mock/src/mock_installd_host_impl.cpp | 6 ++ 10 files changed, 107 insertions(+), 46 deletions(-) diff --git a/interfaces/inner_api/appexecfwk_base/src/hap_module_info.cpp b/interfaces/inner_api/appexecfwk_base/src/hap_module_info.cpp index ad6779e0cb..3034afe3b5 100644 --- a/interfaces/inner_api/appexecfwk_base/src/hap_module_info.cpp +++ b/interfaces/inner_api/appexecfwk_base/src/hap_module_info.cpp @@ -1010,7 +1010,7 @@ void from_json(const nlohmann::json &jsonObject, HapModuleInfo &hapModuleInfo) false, parseResult, ArrayType::NOT_ARRAY); - GetValueIfFindKey>(jsonObject, + GetValueIfFindKey>(jsonObject, jsonObjectEnd, HAP_MODULE_INFO_NATIVE_LIBRARY_FILE_NAMES, hapModuleInfo.nativeLibraryFileNames, diff --git a/services/bundlemgr/include/base_bundle_installer.h b/services/bundlemgr/include/base_bundle_installer.h index 94e91594cd..d3cbca3af8 100644 --- a/services/bundlemgr/include/base_bundle_installer.h +++ b/services/bundlemgr/include/base_bundle_installer.h @@ -575,6 +575,7 @@ private: bool CheckDuplicateProxyData(const std::unordered_map &newInfos); bool CheckDuplicateProxyData(const InnerBundleInfo &newInfo, const InnerBundleInfo &oldInfo); bool CheckDuplicateProxyData(const std::vector &proxyDatas); + ErrCode InnerProcessNativeLibs(InnerBundleInfo &info, const std::string &modulePath); InstallerState state_ = InstallerState::INSTALL_START; std::shared_ptr dataMgr_ = nullptr; // this pointer will get when public functions called std::string bundleName_; diff --git a/services/bundlemgr/include/inner_bundle_info.h b/services/bundlemgr/include/inner_bundle_info.h index 876137b717..409c184e56 100644 --- a/services/bundlemgr/include/inner_bundle_info.h +++ b/services/bundlemgr/include/inner_bundle_info.h @@ -874,18 +874,7 @@ public: } } - void SetModuleHapPath(const std::string &hapPath) - { - if (innerModuleInfos_.count(currentPackage_) == 1) { - innerModuleInfos_.at(currentPackage_).hapPath = hapPath; - for (auto &abilityInfo : baseAbilityInfos_) { - abilityInfo.second.hapPath = hapPath; - } - for (auto &extensionInfo : baseExtensionInfos_) { - extensionInfo.second.hapPath = hapPath; - } - } - } + void SetModuleHapPath(const std::string &hapPath); const std::string &GetModuleHapPath(const std::string &modulePackage) const { @@ -1977,6 +1966,8 @@ public: bool GetSharedBundleInfo(int32_t flags, BundleInfo &bundleInfo) const; ErrCode GetProxyDataInfos(const std::string &moduleName, std::vector &proxyDatas) const; void GetAllProxyDataInfos(std::vector &proxyDatas) const; + bool IsCompressNativeLibs(const std::string &moduleName) const; + void SetNativeLibraryFileNames(const std::string &moduleName, const std::vector &fileNames); private: bool IsExistLauncherAbility() const; diff --git a/services/bundlemgr/include/installd_client.h b/services/bundlemgr/include/installd_client.h index 569c20f914..362c312052 100644 --- a/services/bundlemgr/include/installd_client.h +++ b/services/bundlemgr/include/installd_client.h @@ -148,6 +148,9 @@ public: ErrCode ExtractFiles(const ExtractParam &extractParam); + ErrCode GetNativeLibraryFileNames(const std::string &filePath, const std::string &cpuAbi, + std::vector &fileNames); + private: /** * @brief Get the installd proxy object. diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index 33380b2bd9..0bff93a85d 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -871,7 +871,8 @@ ErrCode BaseBundleInstaller::ProcessBundleInstall(const std::vector // rename for all temp dirs for (const auto &info : newInfos) { - if (info.second.IsOnlyCreateBundleUser()) { + if (info.second.IsOnlyCreateBundleUser() || + !info.second.IsCompressNativeLibs(info.second.GetCurModuleName())) { continue; } if ((result = RenameModuleDir(info.second)) != ERR_OK) { @@ -2223,28 +2224,11 @@ ErrCode BaseBundleInstaller::DeleteArkProfile(const std::string &bundleName, int ErrCode BaseBundleInstaller::ExtractModule(InnerBundleInfo &info, const std::string &modulePath) { - std::string targetSoPath; - std::string cpuAbi; - std::string nativeLibraryPath; - if (info.FetchNativeSoAttrs(modulePackage_, cpuAbi, nativeLibraryPath)) { - bool isLibIsolated = info.IsLibIsolated(info.GetCurModuleName()); - if (isLibIsolated && BundleUtil::EndWith(modulePath, Constants::TMP_SUFFIX)) { - nativeLibraryPath = BuildTempNativeLibraryPath(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", - modulePath.c_str(), targetSoPath.c_str(), cpuAbi.c_str()); - auto result = ExtractModuleFiles(info, modulePath, targetSoPath, cpuAbi); + auto result = InnerProcessNativeLibs(info, modulePath); if (result != ERR_OK) { - APP_LOGE("fail to extrace module dir, error is %{public}d", result); + APP_LOGE("fail to InnerProcessNativeLibs, error is %{public}d", result); return result; } - result = ExtractArkNativeFile(info, modulePath); if (result != ERR_OK) { APP_LOGE("fail to extractArkNativeFile, error is %{public}d", result); @@ -3455,5 +3439,44 @@ void BaseBundleInstaller::AddAppProvisionInfo(const std::string &bundleName, } } } + +ErrCode BaseBundleInstaller::InnerProcessNativeLibs(InnerBundleInfo &info, const std::string &modulePath) +{ + std::string targetSoPath; + std::string cpuAbi; + std::string nativeLibraryPath; + bool IsCompressNativeLibrary = info.IsCompressNativeLibs(info.GetCurModuleName()); + if (info.FetchNativeSoAttrs(modulePackage_, cpuAbi, nativeLibraryPath)) { + if (IsCompressNativeLibrary) { + bool isLibIsolated = info.IsLibIsolated(info.GetCurModuleName()); + if (isLibIsolated && BundleUtil::EndWith(modulePath, Constants::TMP_SUFFIX)) { + nativeLibraryPath = BuildTempNativeLibraryPath(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", + modulePath.c_str(), targetSoPath.c_str(), cpuAbi.c_str()); + if (IsCompressNativeLibrary) { + auto result = ExtractModuleFiles(info, modulePath, targetSoPath, cpuAbi); + if (result != ERR_OK) { + APP_LOGE("fail to extract module dir, error is %{public}d", result); + return result; + } + } else { + std::vector fileNames; + auto result = InstalldClient::GetInstance()->GetNativeLibraryFileNames(modulePath_, cpuAbi, fileNames); + if (result != ERR_OK) { + APP_LOGE("fail to GetNativeLibraryFileNames, error is %{public}d", result); + return result; + } + info.SetNativeLibraryFileNames(info.GetCurModuleName(), fileNames); + } + return ERR_OK; +} } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/src/bundle_profile.cpp b/services/bundlemgr/src/bundle_profile.cpp index 76fa22742c..2deca02ca5 100644 --- a/services/bundlemgr/src/bundle_profile.cpp +++ b/services/bundlemgr/src/bundle_profile.cpp @@ -2009,14 +2009,10 @@ void UpdateNativeSoAttrs( APP_LOGD("cpuAbi %{public}s, soRelativePath : %{public}s, isLibIsolated : %{public}d", cpuAbi.c_str(), soRelativePath.c_str(), isLibIsolated); innerBundleInfo.SetCpuAbi(cpuAbi); - auto hapModuleInfo = innerBundleInfo.GetInnerModuleInfoByModuleName(innerBundleInfo.GetCurModuleName()); - if (hapModuleInfo == std::nullopt) { - APP_LOGE("moduleName: %{public}s is not exist", innerBundleInfo.GetCurModuleName().c_str()); - return; - } - if (!hapModuleInfo->compressNativeLibs) { + if (!innerBundleInfo.IsCompressNativeLibs(innerBundleInfo.GetCurModuleName())) { APP_LOGD("UpdateNativeSoAttrs compressNativeLibs is false, no need to decompress so"); innerBundleInfo.SetModuleNativeLibraryPath(soRelativePath); + innerBundleInfo.SetSharedModuleNativeLibraryPath(soRelativePath); innerBundleInfo.SetModuleCpuAbi(cpuAbi); return; } diff --git a/services/bundlemgr/src/inner_bundle_info.cpp b/services/bundlemgr/src/inner_bundle_info.cpp index bfed0933eb..d37b246fa0 100644 --- a/services/bundlemgr/src/inner_bundle_info.cpp +++ b/services/bundlemgr/src/inner_bundle_info.cpp @@ -139,6 +139,7 @@ const std::map ISOLATION_MODE_MAP = { {"nonisolationOnly", IsolationMode::NONISOLATION_ONLY}, {"isolationFirst", IsolationMode::ISOLATION_FIRST}, }; +const std::string NATIVE_LIBRARY_PATH_SYMBOL = "!/"; inline CompileMode ConvertCompileMode(const std::string& compileMode) { @@ -1096,7 +1097,7 @@ void from_json(const nlohmann::json &jsonObject, InnerModuleInfo &info) false, parseResult, ArrayType::NOT_ARRAY); - GetValueIfFindKey>(jsonObject, + GetValueIfFindKey>(jsonObject, jsonObjectEnd, MODULE_NATIVE_LIBRARY_FILE_NAMES, info.nativeLibraryFileNames, @@ -3834,5 +3835,44 @@ IsolationMode InnerBundleInfo::GetIsolationMode(const std::string &isolationMode return IsolationMode::NONISOLATION_FIRST; } } + +void InnerBundleInfo::SetModuleHapPath(const std::string &hapPath) +{ + if (innerModuleInfos_.count(currentPackage_) == 1) { + innerModuleInfos_.at(currentPackage_).hapPath = hapPath; + for (auto &abilityInfo : baseAbilityInfos_) { + abilityInfo.second.hapPath = hapPath; + } + for (auto &extensionInfo : baseExtensionInfos_) { + extensionInfo.second.hapPath = hapPath; + } + if (!innerModuleInfos_.at(currentPackage_).compressNativeLibs && + !innerModuleInfos_.at(currentPackage_).nativeLibraryPath.empty()) { + innerModuleInfos_.at(currentPackage_).nativeLibraryPath = + hapPath + NATIVE_LIBRARY_PATH_SYMBOL + innerModuleInfos_.at(currentPackage_).nativeLibraryPath; + } + } +} + +bool InnerBundleInfo::IsCompressNativeLibs(const std::string &moduleName) const +{ + auto moduleInfo = GetInnerModuleInfoByModuleName(moduleName); + if (!moduleInfo) { + APP_LOGE("Get moduleInfo(%{public}s) failed.", moduleName.c_str()); + return true; // compressNativeLibs default true + } + + return moduleInfo->compressNativeLibs; +} + +void InnerBundleInfo::SetNativeLibraryFileNames(const std::string &moduleName, + const std::vector &fileNames) +{ + if (innerModuleInfos_.find(moduleName) == innerModuleInfos_.end()) { + APP_LOGE("innerBundleInfo does not contain the module: %{public}s.", moduleName.c_str()); + return; + } + innerModuleInfos_.at(moduleName).nativeLibraryFileNames = fileNames; +} } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/src/installd_client.cpp b/services/bundlemgr/src/installd_client.cpp index 1f9065d8df..d9a28d7cdc 100644 --- a/services/bundlemgr/src/installd_client.cpp +++ b/services/bundlemgr/src/installd_client.cpp @@ -267,5 +267,11 @@ ErrCode InstalldClient::CopyFiles(const std::string &sourceDir, const std::strin { return CallService(&IInstalld::CopyFiles, sourceDir, destinationDir); } + +ErrCode InstalldClient::GetNativeLibraryFileNames(const std::string &filePath, const std::string &cpuAbi, + std::vector &fileNames) +{ + return CallService(&IInstalld::GetNativeLibraryFileNames, filePath, cpuAbi, fileNames); +} } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/src/module_profile.cpp b/services/bundlemgr/src/module_profile.cpp index 03e0f01380..2cbb1e161b 100644 --- a/services/bundlemgr/src/module_profile.cpp +++ b/services/bundlemgr/src/module_profile.cpp @@ -1422,12 +1422,7 @@ void UpdateNativeSoAttrs( APP_LOGD("cpuAbi %{public}s, soRelativePath : %{public}s, isLibIsolated : %{public}d", cpuAbi.c_str(), soRelativePath.c_str(), isLibIsolated); innerBundleInfo.SetCpuAbi(cpuAbi); - auto hapModuleInfo = innerBundleInfo.GetInnerModuleInfoByModuleName(innerBundleInfo.GetCurModuleName()); - if (hapModuleInfo == std::nullopt) { - APP_LOGE("moduleName: %{public}s is not exist", innerBundleInfo.GetCurModuleName().c_str()); - return; - } - if (!hapModuleInfo->compressNativeLibs) { + if (!innerBundleInfo.IsCompressNativeLibs(innerBundleInfo.GetCurModuleName())) { APP_LOGD("UpdateNativeSoAttrs compressNativeLibs is false, no need to decompress so"); innerBundleInfo.SetModuleNativeLibraryPath(soRelativePath); innerBundleInfo.SetSharedModuleNativeLibraryPath(soRelativePath); diff --git a/services/bundlemgr/test/mock/src/mock_installd_host_impl.cpp b/services/bundlemgr/test/mock/src/mock_installd_host_impl.cpp index 824d3cc677..73543a973f 100755 --- a/services/bundlemgr/test/mock/src/mock_installd_host_impl.cpp +++ b/services/bundlemgr/test/mock/src/mock_installd_host_impl.cpp @@ -155,5 +155,11 @@ ErrCode InstalldHostImpl::ExtractFiles(const ExtractParam &extractParam) { return ERR_OK; } + +ErrCode InstalldHostImpl::GetNativeLibraryFileNames(const std::string &filePath, const std::string &cpuAbi, + std::vector &fileNames) +{ + return ERR_OK; +} } // namespace AppExecFwk } // namespace OHOS -- Gitee From 40cee4db23019d97fb3ac2bcd01b20cd2e2fe5f9 Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Thu, 18 May 2023 10:52:30 +0800 Subject: [PATCH 4/5] IssueNo:#I73J5U Description:modify testcase Sig:SIG_ApplicaitonFramework Feature or Bugfix:Feature Binary Source:No Signed-off-by: wangtiantian --- services/bundlemgr/src/bundle_profile.cpp | 1 + services/bundlemgr/src/module_profile.cpp | 1 + .../test/mock/src/mock_install_client.cpp | 5 +++++ .../bms_bundle_data_storage_database_test.cpp | 16 ++++++++++++---- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/services/bundlemgr/src/bundle_profile.cpp b/services/bundlemgr/src/bundle_profile.cpp index 2deca02ca5..fef2e87d75 100644 --- a/services/bundlemgr/src/bundle_profile.cpp +++ b/services/bundlemgr/src/bundle_profile.cpp @@ -2011,6 +2011,7 @@ void UpdateNativeSoAttrs( innerBundleInfo.SetCpuAbi(cpuAbi); if (!innerBundleInfo.IsCompressNativeLibs(innerBundleInfo.GetCurModuleName())) { APP_LOGD("UpdateNativeSoAttrs compressNativeLibs is false, no need to decompress so"); + innerBundleInfo.SetNativeLibraryPath(soRelativePath); innerBundleInfo.SetModuleNativeLibraryPath(soRelativePath); innerBundleInfo.SetSharedModuleNativeLibraryPath(soRelativePath); innerBundleInfo.SetModuleCpuAbi(cpuAbi); diff --git a/services/bundlemgr/src/module_profile.cpp b/services/bundlemgr/src/module_profile.cpp index 2cbb1e161b..60ee32f75e 100644 --- a/services/bundlemgr/src/module_profile.cpp +++ b/services/bundlemgr/src/module_profile.cpp @@ -1424,6 +1424,7 @@ void UpdateNativeSoAttrs( innerBundleInfo.SetCpuAbi(cpuAbi); if (!innerBundleInfo.IsCompressNativeLibs(innerBundleInfo.GetCurModuleName())) { APP_LOGD("UpdateNativeSoAttrs compressNativeLibs is false, no need to decompress so"); + innerBundleInfo.SetNativeLibraryPath(soRelativePath); innerBundleInfo.SetModuleNativeLibraryPath(soRelativePath); innerBundleInfo.SetSharedModuleNativeLibraryPath(soRelativePath); innerBundleInfo.SetModuleCpuAbi(cpuAbi); diff --git a/services/bundlemgr/test/mock/src/mock_install_client.cpp b/services/bundlemgr/test/mock/src/mock_install_client.cpp index 69d6737f15..6458e22f58 100644 --- a/services/bundlemgr/test/mock/src/mock_install_client.cpp +++ b/services/bundlemgr/test/mock/src/mock_install_client.cpp @@ -154,5 +154,10 @@ ErrCode InstalldClient::CopyFiles(const std::string &sourceDir, const std::strin return 0; } +ErrCode InstalldClient::GetNativeLibraryFileNames(const std::string &filePath, const std::string &cpuAbi, + std::vector &fileNames) +{ + return 0; +} } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/test/unittest/bms_bundle_data_storage_test/bms_bundle_data_storage_database_test.cpp b/services/bundlemgr/test/unittest/bms_bundle_data_storage_test/bms_bundle_data_storage_database_test.cpp index 8e4d34bca2..cc4c5602ee 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_data_storage_test/bms_bundle_data_storage_database_test.cpp +++ b/services/bundlemgr/test/unittest/bms_bundle_data_storage_test/bms_bundle_data_storage_database_test.cpp @@ -682,7 +682,9 @@ const nlohmann::json INNER_BUNDLE_INFO_JSON_3_2 = R"( "srcPath":"", "uiSyntax":"hml", "upgradeFlag":0, - "virtualMachine":"ark" + "virtualMachine":"ark", + "compressNativeLibs": true, + "nativeLibraryFileNames": [] } }, "installMark":{ @@ -1303,7 +1305,9 @@ protected: "srcEntrance": "", "srcPath": "", "uiSyntax": "", - "virtualMachine": "" + "virtualMachine": "", + "compressNativeLibs": true, + "nativeLibraryFileNames": [] }, "com.ohos.launcher.recents": { "abilityKeys": [ @@ -1360,7 +1364,9 @@ protected: "srcEntrance": "", "srcPath": "", "uiSyntax": "", - "virtualMachine": "" + "virtualMachine": "", + "compressNativeLibs": true, + "nativeLibraryFileNames": [] }, "com.ohos.launcher.settings": { "abilityKeys": [ @@ -1417,7 +1423,9 @@ protected: "srcEntrance": "", "srcPath": "", "uiSyntax": "", - "virtualMachine": "" + "virtualMachine": "", + "compressNativeLibs": true, + "nativeLibraryFileNames": [] } }, "installMark": { -- Gitee From e614ace4862451eaa44616dfc242310dc896298d Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Thu, 18 May 2023 17:07:23 +0800 Subject: [PATCH 5/5] IssueNo:#I73J5U Description:fix codecheck Sig:SIG_ApplicaitonFramework Feature or Bugfix:Feature Binary Source:No Signed-off-by: wangtiantian --- services/bundlemgr/src/base_bundle_installer.cpp | 6 +++--- services/bundlemgr/src/bundle_profile.cpp | 1 - services/bundlemgr/src/module_profile.cpp | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/services/bundlemgr/src/base_bundle_installer.cpp b/services/bundlemgr/src/base_bundle_installer.cpp index 0bff93a85d..850fa2ef9e 100644 --- a/services/bundlemgr/src/base_bundle_installer.cpp +++ b/services/bundlemgr/src/base_bundle_installer.cpp @@ -3445,9 +3445,9 @@ ErrCode BaseBundleInstaller::InnerProcessNativeLibs(InnerBundleInfo &info, const std::string targetSoPath; std::string cpuAbi; std::string nativeLibraryPath; - bool IsCompressNativeLibrary = info.IsCompressNativeLibs(info.GetCurModuleName()); + bool isCompressNativeLibrary = info.IsCompressNativeLibs(info.GetCurModuleName()); if (info.FetchNativeSoAttrs(modulePackage_, cpuAbi, nativeLibraryPath)) { - if (IsCompressNativeLibrary) { + if (isCompressNativeLibrary) { bool isLibIsolated = info.IsLibIsolated(info.GetCurModuleName()); if (isLibIsolated && BundleUtil::EndWith(modulePath, Constants::TMP_SUFFIX)) { nativeLibraryPath = BuildTempNativeLibraryPath(nativeLibraryPath); @@ -3461,7 +3461,7 @@ ErrCode BaseBundleInstaller::InnerProcessNativeLibs(InnerBundleInfo &info, const APP_LOGD("begin to extract module files, modulePath : %{private}s, targetSoPath : %{private}s, cpuAbi : %{public}s", modulePath.c_str(), targetSoPath.c_str(), cpuAbi.c_str()); - if (IsCompressNativeLibrary) { + if (isCompressNativeLibrary) { auto result = ExtractModuleFiles(info, modulePath, targetSoPath, cpuAbi); if (result != ERR_OK) { APP_LOGE("fail to extract module dir, error is %{public}d", result); diff --git a/services/bundlemgr/src/bundle_profile.cpp b/services/bundlemgr/src/bundle_profile.cpp index fef2e87d75..3188c9e48e 100644 --- a/services/bundlemgr/src/bundle_profile.cpp +++ b/services/bundlemgr/src/bundle_profile.cpp @@ -2285,7 +2285,6 @@ bool ToInnerModuleInfo(const ProfileReader::ConfigJson &configJson, InnerModuleI innerModuleInfo.isLibIsolated = configJson.module.isLibIsolated; innerModuleInfo.deviceTypes = configJson.module.deviceType; innerModuleInfo.buildHash = configJson.module.buildHash; - innerModuleInfo.compressNativeLibs = configJson.deveicConfig.defaultDevice.compressNativeLibs; return true; } diff --git a/services/bundlemgr/src/module_profile.cpp b/services/bundlemgr/src/module_profile.cpp index 60ee32f75e..dffe80427a 100644 --- a/services/bundlemgr/src/module_profile.cpp +++ b/services/bundlemgr/src/module_profile.cpp @@ -2022,7 +2022,6 @@ bool ToInnerModuleInfo( innerModuleInfo.proxyDatas = moduleJson.module.proxyDatas; innerModuleInfo.buildHash = moduleJson.module.buildHash; innerModuleInfo.isolationMode = moduleJson.module.isolationMode; - innerModuleInfo.compressNativeLibs = moduleJson.module.compressNativeLibs; // abilities and extensionAbilities store in InnerBundleInfo return true; } -- Gitee