diff --git a/interfaces/kits/BUILD.gn b/interfaces/kits/BUILD.gn index 531a7c58b6b34461b703d95755ead0fcd2a22b76..1056b7185b27c5881e852001eac3bef974210552 100755 --- a/interfaces/kits/BUILD.gn +++ b/interfaces/kits/BUILD.gn @@ -24,7 +24,7 @@ group("kitsgroup") { deps += [ "jskits:deviceinfo", "jskits:systemparameter", - "jskits:systemparameterv9", + "jskits:systemparameterenhance", ] } } diff --git a/interfaces/kits/jskits/BUILD.gn b/interfaces/kits/jskits/BUILD.gn index a9d0ccb3ad43b4fdb53c2ce858e3fa07b794305f..da2f6c8d35d743460d4bc1d8165c186aff33096c 100755 --- a/interfaces/kits/jskits/BUILD.gn +++ b/interfaces/kits/jskits/BUILD.gn @@ -50,19 +50,20 @@ ohos_shared_library("systemparameter") { part_name = "init" } -ohos_shared_library("systemparameterv9") { +ohos_shared_library("systemparameterenhance") { include_dirs = [ "src", "//third_party/libuv/include", ] - sources = [ "src_v9/native_parameters_js.cpp" ] + sources = [ "src_enhance/native_parameters_js.cpp" ] deps = [ "//base/startup/init/interfaces/innerkits:libbeget_proxy", "//base/startup/init/interfaces/innerkits:libbegetutil", ] + symlink_target_name = [ "libsystemparameterv9.z.so" ] external_deps = [ "napi:ace_napi" ] relative_install_dir = "module" subsystem_name = "startup" diff --git a/interfaces/kits/jskits/src_v9/native_parameters_js.cpp b/interfaces/kits/jskits/src_enhance/native_parameters_js.cpp similarity index 98% rename from interfaces/kits/jskits/src_v9/native_parameters_js.cpp rename to interfaces/kits/jskits/src_enhance/native_parameters_js.cpp index 7fb8ba3ff4d3e7dff6bb954d4208015dfca3e218..3d87883927593f5d6a234e199ec75e95c27c8c2e 100644 --- a/interfaces/kits/jskits/src_v9/native_parameters_js.cpp +++ b/interfaces/kits/jskits/src_enhance/native_parameters_js.cpp @@ -382,7 +382,7 @@ static napi_value Init(napi_env env, napi_value exports) /* * Attribute definition */ - napi_property_descriptor desc[] = { + const napi_property_descriptor desc[] = { DECLARE_NAPI_FUNCTION("set", Set), DECLARE_NAPI_FUNCTION("setSync", SetSync), DECLARE_NAPI_FUNCTION("get", Get), @@ -404,7 +404,7 @@ EXTERN_C_END /* * Module definition */ -static napi_module _module = { +static napi_module _module_old = { .nm_version = 1, .nm_flags = 0, .nm_filename = NULL, @@ -414,10 +414,21 @@ static napi_module _module = { .reserved = { 0 } }; +static napi_module _module = { + .nm_version = 1, + .nm_flags = 0, + .nm_filename = NULL, + .nm_register_func = Init, + .nm_modname = "systemParameterEnhance", + .nm_priv = ((void *)0), + .reserved = { 0 } +}; + /* * Module registration function */ extern "C" __attribute__((constructor)) void RegisterModule(void) { napi_module_register(&_module); + napi_module_register(&_module_old); }