diff --git a/interfaces/inner_api/appexecfwk_base/include/plugin/plugin_module_info.h b/interfaces/inner_api/appexecfwk_base/include/plugin/plugin_module_info.h index 6046108144ad504ca45850408b23f4b698fa034d..25ecf275785fc7100b96a36bb9fbfd875e0eaf97 100644 --- a/interfaces/inner_api/appexecfwk_base/include/plugin/plugin_module_info.h +++ b/interfaces/inner_api/appexecfwk_base/include/plugin/plugin_module_info.h @@ -19,6 +19,7 @@ #include #include +#include "bundle_constants.h" #include "parcel.h" namespace OHOS { @@ -34,6 +35,7 @@ struct PluginModuleInfo : public Parcelable { std::string hapPath; std::string cpuAbi; std::string nativeLibraryPath; + std::string moduleArkTSMode = Constants::ARKTS_MODE_DYNAMIC; std::vector nativeLibraryFileNames; bool ReadFromParcel(Parcel &parcel); diff --git a/interfaces/inner_api/appexecfwk_base/include/shared/shared_module_info.h b/interfaces/inner_api/appexecfwk_base/include/shared/shared_module_info.h index 5647620653bc67f48ecf85b44a98ef819d3c3afa..17e0ca570f2ab7f1954f09ea98a040dd353ff952 100644 --- a/interfaces/inner_api/appexecfwk_base/include/shared/shared_module_info.h +++ b/interfaces/inner_api/appexecfwk_base/include/shared/shared_module_info.h @@ -19,6 +19,7 @@ #include #include +#include "bundle_constants.h" #include "parcel.h" namespace OHOS { @@ -33,6 +34,7 @@ struct SharedModuleInfo : public Parcelable { std::string hapPath; std::string cpuAbi; std::string nativeLibraryPath; + std::string moduleArkTSMode = Constants::ARKTS_MODE_DYNAMIC; std::vector nativeLibraryFileNames; bool ReadFromParcel(Parcel &parcel); diff --git a/interfaces/inner_api/appexecfwk_base/src/plugin/plugin_module_info.cpp b/interfaces/inner_api/appexecfwk_base/src/plugin/plugin_module_info.cpp index 3e3d979ec7d35178998e622dd25554ebd6fd2e51..376b8032265848688db174b18337ea08b43e8e95 100644 --- a/interfaces/inner_api/appexecfwk_base/src/plugin/plugin_module_info.cpp +++ b/interfaces/inner_api/appexecfwk_base/src/plugin/plugin_module_info.cpp @@ -48,6 +48,7 @@ bool PluginModuleInfo::ReadFromParcel(Parcel &parcel) cpuAbi = parcel.ReadString(); nativeLibraryPath = parcel.ReadString(); packageName = parcel.ReadString(); + moduleArkTSMode = parcel.ReadString(); int32_t nativeLibraryFileNamesSize; READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, parcel, nativeLibraryFileNamesSize); CONTAINER_SECURITY_VERIFY(parcel, nativeLibraryFileNamesSize, &nativeLibraryFileNames); @@ -68,6 +69,7 @@ bool PluginModuleInfo::Marshalling(Parcel &parcel) const WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, cpuAbi); WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, nativeLibraryPath); WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, packageName); + WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, moduleArkTSMode); WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, parcel, nativeLibraryFileNames.size()); for (auto &fileName : nativeLibraryFileNames) { WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, fileName); @@ -99,6 +101,7 @@ void to_json(nlohmann::json &jsonObject, const PluginModuleInfo &pluginModuleInf {PLUGIN_MODULE_INFO_COMPRESS_NATIVE_LIBS, pluginModuleInfo.compressNativeLibs}, {PLUGIN_MODULE_INFO_IS_LIB_ISOLATED, pluginModuleInfo.isLibIsolated}, {PLUGIN_MODULE_INFO_PACKAGE_NAME, pluginModuleInfo.packageName}, + {Constants::MODULE_ARKTS_MODE, pluginModuleInfo.moduleArkTSMode} }; } @@ -138,6 +141,9 @@ void from_json(const nlohmann::json &jsonObject, PluginModuleInfo &pluginModuleI BMSJsonUtil::GetStrValueIfFindKey(jsonObject, jsonObjectEnd, PLUGIN_MODULE_INFO_PACKAGE_NAME, pluginModuleInfo.packageName, false, parseResult); + BMSJsonUtil::GetStrValueIfFindKey(jsonObject, jsonObjectEnd, + Constants::MODULE_ARKTS_MODE, + pluginModuleInfo.moduleArkTSMode, false, parseResult); if (parseResult != ERR_OK) { APP_LOGE("read pluginModuleInfo error : %{public}d", parseResult); } diff --git a/interfaces/inner_api/appexecfwk_base/src/shared/shared_module_info.cpp b/interfaces/inner_api/appexecfwk_base/src/shared/shared_module_info.cpp index c6b2713d8d6fd267f9945a31628419eeec0b2463..7e96da0dc7496093e246f3c6c1a3d80e3a3356c0 100644 --- a/interfaces/inner_api/appexecfwk_base/src/shared/shared_module_info.cpp +++ b/interfaces/inner_api/appexecfwk_base/src/shared/shared_module_info.cpp @@ -47,6 +47,7 @@ bool SharedModuleInfo::ReadFromParcel(Parcel &parcel) hapPath = Str16ToStr8(parcel.ReadString16()); cpuAbi = Str16ToStr8(parcel.ReadString16()); nativeLibraryPath = Str16ToStr8(parcel.ReadString16()); + moduleArkTSMode = parcel.ReadString(); int32_t nativeLibraryFileNamesSize; READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, parcel, nativeLibraryFileNamesSize); CONTAINER_SECURITY_VERIFY(parcel, nativeLibraryFileNamesSize, &nativeLibraryFileNames); @@ -67,6 +68,7 @@ bool SharedModuleInfo::Marshalling(Parcel &parcel) const WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String16, parcel, Str8ToStr16(hapPath)); WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String16, parcel, Str8ToStr16(cpuAbi)); WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String16, parcel, Str8ToStr16(nativeLibraryPath)); + WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, moduleArkTSMode); WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, parcel, nativeLibraryFileNames.size()); for (auto &fileName : nativeLibraryFileNames) { WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String16, parcel, Str8ToStr16(fileName)); @@ -97,7 +99,8 @@ void to_json(nlohmann::json &jsonObject, const SharedModuleInfo &sharedModuleInf {SHARED_MODULE_INFO_HAP_PATH, sharedModuleInfo.hapPath}, {SHARED_MODULE_INFO_CPU_ABI, sharedModuleInfo.cpuAbi}, {SHARED_MODULE_INFO_NATIVE_LIBRARY_PATH, sharedModuleInfo.nativeLibraryPath}, - {SHARED_MODULE_INFO_NATIVE_LIBRARY_FILE_NAMES, sharedModuleInfo.nativeLibraryFileNames} + {SHARED_MODULE_INFO_NATIVE_LIBRARY_FILE_NAMES, sharedModuleInfo.nativeLibraryFileNames}, + {Constants::MODULE_ARKTS_MODE, sharedModuleInfo.moduleArkTSMode} }; } @@ -134,6 +137,9 @@ void from_json(const nlohmann::json &jsonObject, SharedModuleInfo &sharedModuleI BMSJsonUtil::GetStrValueIfFindKey(jsonObject, jsonObjectEnd, SHARED_MODULE_INFO_NATIVE_LIBRARY_PATH, sharedModuleInfo.nativeLibraryPath, false, parseResult); + BMSJsonUtil::GetStrValueIfFindKey(jsonObject, jsonObjectEnd, + Constants::MODULE_ARKTS_MODE, + sharedModuleInfo.moduleArkTSMode, false, parseResult); GetValueIfFindKey>(jsonObject, jsonObjectEnd, SHARED_MODULE_INFO_NATIVE_LIBRARY_FILE_NAMES, sharedModuleInfo.nativeLibraryFileNames, JsonType::ARRAY, false, parseResult, diff --git a/services/bundlemgr/src/inner_bundle_info.cpp b/services/bundlemgr/src/inner_bundle_info.cpp index 021f345b77fa74ad1d1f25b68324ee9291b4714e..97fe95013ea9d2f87de3f7a989c2d9a71e057dcf 100644 --- a/services/bundlemgr/src/inner_bundle_info.cpp +++ b/services/bundlemgr/src/inner_bundle_info.cpp @@ -2182,6 +2182,7 @@ bool InnerBundleInfo::GetSharedBundleInfo(SharedBundleInfo &sharedBundleInfo) co sharedModuleInfo.hapPath = info.hapPath; sharedModuleInfo.cpuAbi = info.cpuAbi; sharedModuleInfo.nativeLibraryPath = info.nativeLibraryPath; + sharedModuleInfo.moduleArkTSMode = info.moduleArkTSMode; sharedModuleInfo.nativeLibraryFileNames = info.nativeLibraryFileNames; sharedModuleInfos.emplace_back(sharedModuleInfo); } @@ -5057,6 +5058,7 @@ bool InnerBundleInfo::ConvertPluginBundleInfo(const std::string &bundleName, pluginModuleInfo.compressNativeLibs = info.second.compressNativeLibs; pluginModuleInfo.isLibIsolated = info.second.isLibIsolated; pluginModuleInfo.packageName = info.second.packageName; + pluginModuleInfo.moduleArkTSMode = info.second.moduleArkTSMode; pluginBundleInfo.pluginModuleInfos.emplace_back(pluginModuleInfo); } return true;