change param type

Signed-off-by: 任国军 <renguojun1@h-partners.com>
This commit is contained in:
任国军
2025-11-01 15:46:12 +08:00
parent 7e5f40ef8a
commit 59d43958df
4 changed files with 7 additions and 10 deletions
+4 -6
View File
@@ -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<std::string> 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<std::string> result;
SplitStr(pluginDefaultNamespaceLdDictionary_, ":", result);
return result;
return pluginDefaultNamespaceLdDictionary_;
}
void MainThread::SleepCleanKill()
+1 -2
View File
@@ -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<std::string> &moduleNam
}
}
void JsRuntime::CreatePluginDefaultNamespace(const std::vector<std::string> &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);
@@ -75,7 +75,7 @@ public:
static void SetAppLibPath(const AppLibPathMap& appLibPaths, const bool& isSystemApp = false);
static void InheritPluginNamespace(const std::vector<std::string> &moduleNames);
static void CreatePluginDefaultNamespace(const std::vector<std::string> &lddictorys);
static void CreatePluginDefaultNamespace(const std::string &lddictorys);
static bool ReadSourceMapData(const std::string& hapPath, const std::string& sourceMapPath, std::string& content);
JsRuntime();
@@ -687,7 +687,7 @@ private:
bool IsPluginNamespaceInherited();
std::vector<std::string> ParsePluginDefaultNamespaceLdDictionary();
std::string ParsePluginDefaultNamespaceLdDictionary();
/**
* @brief parse app configuration params