diff --git a/frameworks/native/appkit/app/main_thread.cpp b/frameworks/native/appkit/app/main_thread.cpp index 92b6cf8f75..8cb8f21eb3 100644 --- a/frameworks/native/appkit/app/main_thread.cpp +++ b/frameworks/native/appkit/app/main_thread.cpp @@ -1674,7 +1674,7 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData, con AbilityRuntime::JsRuntime::InheritPluginNamespace(pluginModuleNames); } auto lddictionaries = ParsePluginDefaultNamespaceLdDictionary(); - if (lddictionaries.size() > 0) { + if (!lddictionaries.empty()) { AbilityRuntime::JsRuntime::CreatePluginDefaultNamespace(lddictionaries); } } @@ -4230,13 +4230,11 @@ bool MainThread::IsPluginNamespaceInherited() return isPluginNamespaceInherited_; } -std::vector MainThread::ParsePluginDefaultNamespaceLdDictionary() +std::string MainThread::ParsePluginDefaultNamespaceLdDictionary() { - auto pluginDefaultNamespaceLdDictionary_ = system::GetParameter(PLUGIN_DEFAULT_NAMESPACE_LDDICTIONARY, ""); + pluginDefaultNamespaceLdDictionary_ = system:: (PLUGIN_DEFAULT_NAMESPACE_LDDICTIONARY, ""); TAG_LOGD(AAFwkTag::APPKIT, "plugin_default_namespace_lddictionary: %{public}s", pluginDefaultNamespaceLdDictionary_.c_str()); - std::vector result; - SplitStr(pluginDefaultNamespaceLdDictionary_, ":", result); - return result; + return pluginDefaultNamespaceLdDictionary_; } void MainThread::SleepCleanKill() diff --git a/frameworks/native/runtime/js_runtime.cpp b/frameworks/native/runtime/js_runtime.cpp index 75774216d6..832e3c72b9 100644 --- a/frameworks/native/runtime/js_runtime.cpp +++ b/frameworks/native/runtime/js_runtime.cpp @@ -101,7 +101,6 @@ const std::string NAMESPACE = "namespace"; const std::string TARGET_OHM = "targetohm"; const std::string SINCE_VERSION = "sinceVersion"; const std::string DEFAULT_PLUGIN = "defaultPlugin"; -const constexpr char DEVELOPER_MODE_STATE[] = "const.security.developermode.state"; const std::string MERGE_SOURCE_MAP_PATH = "ets/sourceMaps.map"; @@ -949,7 +948,7 @@ void JsRuntime::InheritPluginNamespace(const std::vector &moduleNam } } -void JsRuntime::CreatePluginDefaultNamespace(const std::vector &lddictionaries) +void JsRuntime::CreatePluginDefaultNamespace(const std::string &lddictionaries) { Security::AccessToken::AccessTokenID selfToken = IPCSkeleton::GetSelfTokenID(); int result = Security::AccessToken::AccessTokenKit::VerifyAccessToken(selfToken, PERMISSION_LOAD_INDEPENDENT_LIBRARY); diff --git a/interfaces/inner_api/runtime/include/js_runtime.h b/interfaces/inner_api/runtime/include/js_runtime.h index 91254a5204..a8d12a7801 100644 --- a/interfaces/inner_api/runtime/include/js_runtime.h +++ b/interfaces/inner_api/runtime/include/js_runtime.h @@ -75,7 +75,7 @@ public: static void SetAppLibPath(const AppLibPathMap& appLibPaths, const bool& isSystemApp = false); static void InheritPluginNamespace(const std::vector &moduleNames); - static void CreatePluginDefaultNamespace(const std::vector &lddictorys); + static void CreatePluginDefaultNamespace(const std::string &lddictorys); static bool ReadSourceMapData(const std::string& hapPath, const std::string& sourceMapPath, std::string& content); JsRuntime(); diff --git a/interfaces/kits/native/appkit/app/main_thread.h b/interfaces/kits/native/appkit/app/main_thread.h index fe2834948f..22b16e79ad 100644 --- a/interfaces/kits/native/appkit/app/main_thread.h +++ b/interfaces/kits/native/appkit/app/main_thread.h @@ -687,7 +687,7 @@ private: bool IsPluginNamespaceInherited(); - std::vector ParsePluginDefaultNamespaceLdDictionary(); + std::string ParsePluginDefaultNamespaceLdDictionary(); /** * @brief parse app configuration params