diff --git a/napi.gni b/napi.gni index 53990c9374dae87e23160ede55853ece1e016674..77b1e39f414dcddca77fbfaf14b672125be4eafa 100755 --- a/napi.gni +++ b/napi.gni @@ -13,8 +13,6 @@ napi_path = "//foundation//arkui/napi" ets_runtime_path = "//arkcompiler/ets_runtime" -# Set is enable data_protector -enabled_data_protector = false napi_sources = [ "callback_scope_manager/native_callback_scope_manager.cpp", @@ -62,9 +60,13 @@ declare_args() { # Set pgo profdata path napi_feature_pgo_path = "" + + # Set is enable data_protector + napi_enable_data_protector = false + enabled_data_protector = false } -if (defined(target_cpu) && target_cpu == "arm64" && +if (defined(target_cpu) && target_cpu == "arm64" && napi_enable_data_protector && !(defined(is_arkui_x) && is_arkui_x) && is_ohos && !is_emulator) { enabled_data_protector = true } diff --git a/utils/data_protector.cpp b/utils/data_protector.cpp index b5fb2570f8d72f18f2fd9fdc81c0918c36c8d27c..cc0ee653c25587d2d5a700dde0410b7d4624d0ab 100644 --- a/utils/data_protector.cpp +++ b/utils/data_protector.cpp @@ -15,7 +15,7 @@ #include "data_protector.h" -#if defined(NAPI_ENABLE_DATA_PROTECT) +#if defined(NAPI_ENABLE_DATA_PROTECT) && !defined(PREVIEW) && !defined(SIMULATOR) #include #include