From b86840f1bf68fcb81746135c568a02c9e3c93e28 Mon Sep 17 00:00:00 2001 From: BrainL Date: Sun, 27 Apr 2025 10:08:21 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=83=A8=E4=BB=B6=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: BrainL --- interfaces/api/js/napi/backup_ext/BUILD.gn | 2 +- interfaces/api/js/napi/backup_ext_context/BUILD.gn | 2 +- test/fuzztest/fileshare_fuzzer/BUILD.gn | 1 + test/fuzztest/svcrestoredepsmanager_fuzzer/BUILD.gn | 2 ++ tests/unittests/backup_api/backup_impl/BUILD.gn | 1 + tests/unittests/backup_sa/module_external/BUILD.gn | 1 + tests/unittests/backup_sa/module_ipc/BUILD.gn | 1 + tests/unittests/backup_utils/BUILD.gn | 5 ++++- tests/utils/BUILD.gn | 1 + 9 files changed, 13 insertions(+), 3 deletions(-) diff --git a/interfaces/api/js/napi/backup_ext/BUILD.gn b/interfaces/api/js/napi/backup_ext/BUILD.gn index 04ca0cb37..f3ab4f82e 100644 --- a/interfaces/api/js/napi/backup_ext/BUILD.gn +++ b/interfaces/api/js/napi/backup_ext/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni") +import("//build/config/components/ets_frontend/es2abc_config.gni") import("//build/ohos.gni") import("//foundation/filemanagement/app_file_service/backup.gni") diff --git a/interfaces/api/js/napi/backup_ext_context/BUILD.gn b/interfaces/api/js/napi/backup_ext_context/BUILD.gn index fbcecb500..1d6fff540 100644 --- a/interfaces/api/js/napi/backup_ext_context/BUILD.gn +++ b/interfaces/api/js/napi/backup_ext_context/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni") +import("//build/config/components/ets_frontend/es2abc_config.gni") import("//build/ohos.gni") import("//foundation/filemanagement/app_file_service/backup.gni") diff --git a/test/fuzztest/fileshare_fuzzer/BUILD.gn b/test/fuzztest/fileshare_fuzzer/BUILD.gn index d9f20cbec..f2a854d5b 100644 --- a/test/fuzztest/fileshare_fuzzer/BUILD.gn +++ b/test/fuzztest/fileshare_fuzzer/BUILD.gn @@ -44,6 +44,7 @@ ohos_fuzztest("FileShareFuzzTest") { external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libnativetoken", + "access_token:libnativetoken_shared", "access_token:libtoken_setproc", ] } diff --git a/test/fuzztest/svcrestoredepsmanager_fuzzer/BUILD.gn b/test/fuzztest/svcrestoredepsmanager_fuzzer/BUILD.gn index 749cdcc05..15294692a 100644 --- a/test/fuzztest/svcrestoredepsmanager_fuzzer/BUILD.gn +++ b/test/fuzztest/svcrestoredepsmanager_fuzzer/BUILD.gn @@ -43,7 +43,9 @@ ohos_fuzztest("SvcRestoreDepsManagerFuzzTest") { external_deps = [ "bounds_checking_function:libsec_shared", + "c_utils:utils", "hilog:libhilog", + "ipc:ipc_core", "jsoncpp:jsoncpp", ] diff --git a/tests/unittests/backup_api/backup_impl/BUILD.gn b/tests/unittests/backup_api/backup_impl/BUILD.gn index f0ca34c4e..4e786fa21 100644 --- a/tests/unittests/backup_api/backup_impl/BUILD.gn +++ b/tests/unittests/backup_api/backup_impl/BUILD.gn @@ -80,6 +80,7 @@ ohos_unittest("backup_sa_impl_test") { "hitrace:hitrace_meter", "init:libbegetutil", "ipc:ipc_core", + "samgr:dynamic_cache", "samgr:samgr_proxy", ] diff --git a/tests/unittests/backup_sa/module_external/BUILD.gn b/tests/unittests/backup_sa/module_external/BUILD.gn index 8ada8a2a2..a161cb536 100644 --- a/tests/unittests/backup_sa/module_external/BUILD.gn +++ b/tests/unittests/backup_sa/module_external/BUILD.gn @@ -54,6 +54,7 @@ ohos_unittest("bms_adapter_test") { "ipc:ipc_core", "jsoncpp:jsoncpp", "safwk:system_ability_fwk", + "samgr:dynamic_cache", "samgr:samgr_proxy", "storage_service:storage_manager_sa_proxy", ] diff --git a/tests/unittests/backup_sa/module_ipc/BUILD.gn b/tests/unittests/backup_sa/module_ipc/BUILD.gn index 9fec3e011..c5d413791 100644 --- a/tests/unittests/backup_sa/module_ipc/BUILD.gn +++ b/tests/unittests/backup_sa/module_ipc/BUILD.gn @@ -281,6 +281,7 @@ ohos_unittest("backup_service_session_test") { "ipc:ipc_core", "jsoncpp:jsoncpp", "safwk:system_ability_fwk", + "samgr:dynamic_cache", "samgr:samgr_proxy", "storage_service:storage_manager_sa_proxy", ] diff --git a/tests/unittests/backup_utils/BUILD.gn b/tests/unittests/backup_utils/BUILD.gn index 79370309e..9a1d70671 100644 --- a/tests/unittests/backup_utils/BUILD.gn +++ b/tests/unittests/backup_utils/BUILD.gn @@ -57,7 +57,10 @@ ohos_unittest("b_error_test") { "${path_backup}/utils/:backup_utils", ] - external_deps = [ "hilog:libhilog" ] + external_deps = [ + "c_utils:utils", + "hilog:libhilog", + ] defines = [ "private = public" ] diff --git a/tests/utils/BUILD.gn b/tests/utils/BUILD.gn index ca63cd1ca..999fea459 100644 --- a/tests/utils/BUILD.gn +++ b/tests/utils/BUILD.gn @@ -38,6 +38,7 @@ ohos_static_library("backup_test_utils") { deps = [ "${path_backup}/utils:backup_utils" ] external_deps = [ + "c_utils:utils", "googletest:gmock_main", "googletest:gtest_main", "hilog:libhilog", -- Gitee From 572f182544d03d8ad3a7aaabdc87c4e99c2f33ee Mon Sep 17 00:00:00 2001 From: BrainL Date: Fri, 9 May 2025 15:34:15 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: BrainL --- bundle.json | 1 + interfaces/common/src/common_func.cpp | 1 + interfaces/kits/js/file_share/grant_permissions.h | 2 ++ test/unittest/file_permission_native/BUILD.gn | 2 ++ .../file_share_ndk_test/file_share_permission_sup_test/BUILD.gn | 2 ++ .../file_share_ndk_test/file_share_permission_test/BUILD.gn | 2 ++ tools/backup_tool/src/tools_op_backup.cpp | 2 +- tools/backup_tool/src/tools_op_incremental_backup.cpp | 2 +- tools/backup_tool/src/tools_op_incremental_restore.cpp | 2 +- tools/backup_tool/src/tools_op_restore.cpp | 2 +- 10 files changed, 14 insertions(+), 4 deletions(-) diff --git a/bundle.json b/bundle.json index 22df2ad06..9d65cca9e 100644 --- a/bundle.json +++ b/bundle.json @@ -45,6 +45,7 @@ "samgr", "storage_service", "sandbox_manager", + "selinux_adapter", "zlib" ], "third_party": [ diff --git a/interfaces/common/src/common_func.cpp b/interfaces/common/src/common_func.cpp index 8850178f6..3a5697463 100644 --- a/interfaces/common/src/common_func.cpp +++ b/interfaces/common/src/common_func.cpp @@ -120,6 +120,7 @@ string CommonFunc::GetUriFromPath(const string &path) string realPath = path; NormalizePath(realPath); if (realPath.find(MEDIA_FUSE_PATH_HEAD) == 0) { + realPath = SandboxHelper::Encode(realPath); return realPath.replace(realPath.find(MEDIA_FUSE_PATH_HEAD), MEDIA_FUSE_PATH_HEAD.length(), MEDIA_AUTHORITY); } { diff --git a/interfaces/kits/js/file_share/grant_permissions.h b/interfaces/kits/js/file_share/grant_permissions.h index c42c040f3..9e3b690c7 100644 --- a/interfaces/kits/js/file_share/grant_permissions.h +++ b/interfaces/kits/js/file_share/grant_permissions.h @@ -17,6 +17,7 @@ #define GRANT_PERMISSIONS_H #include +#include #include "file_permission.h" #include "filemgmt_libn.h" @@ -24,6 +25,7 @@ namespace OHOS { namespace AppFileService { namespace ModuleFileShare { +using ErrParam = std::function()>; napi_value PersistPermission(napi_env env, napi_callback_info info); napi_value RevokePermission(napi_env env, napi_callback_info info); napi_value ActivatePermission(napi_env env, napi_callback_info info); diff --git a/test/unittest/file_permission_native/BUILD.gn b/test/unittest/file_permission_native/BUILD.gn index 0d3bfbd06..d04e27e98 100644 --- a/test/unittest/file_permission_native/BUILD.gn +++ b/test/unittest/file_permission_native/BUILD.gn @@ -44,6 +44,7 @@ ohos_unittest("file_permission_test") { "access_token:libnativetoken", "access_token:libtoken_setproc", "app_file_service:fileshare_native", + "cJSON:cjson_static", "c_utils:utils", "common_event_service:cesfwk_innerkits", "googletest:gmock_main", @@ -52,6 +53,7 @@ ohos_unittest("file_permission_test") { "init:libbegetutil", "ipc:ipc_core", "samgr:samgr_proxy", + "selinux_adapter:librestorecon", ] defines = [ "private = public" ] if (sandbox_manarer) { diff --git a/test/unittest/file_share_ndk_test/file_share_permission_sup_test/BUILD.gn b/test/unittest/file_share_ndk_test/file_share_permission_sup_test/BUILD.gn index 145bd9f4f..21bb76932 100644 --- a/test/unittest/file_share_ndk_test/file_share_permission_sup_test/BUILD.gn +++ b/test/unittest/file_share_ndk_test/file_share_permission_sup_test/BUILD.gn @@ -45,6 +45,7 @@ ohos_unittest("file_share_permission_ndk_sup_test") { "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", + "cJSON:cjson_static", "c_utils:utils", "common_event_service:cesfwk_innerkits", "googletest:gmock_main", @@ -53,6 +54,7 @@ ohos_unittest("file_share_permission_ndk_sup_test") { "init:libbegetutil", "ipc:ipc_core", "samgr:samgr_proxy", + "selinux_adapter:librestorecon", ] deps = [ "${app_file_service_path}/interfaces/innerkits/native:fileshare_native", diff --git a/test/unittest/file_share_ndk_test/file_share_permission_test/BUILD.gn b/test/unittest/file_share_ndk_test/file_share_permission_test/BUILD.gn index 4ca8b25f1..5ac24ac6a 100644 --- a/test/unittest/file_share_ndk_test/file_share_permission_test/BUILD.gn +++ b/test/unittest/file_share_ndk_test/file_share_permission_test/BUILD.gn @@ -39,6 +39,7 @@ ohos_unittest("file_share_permission_ndk_test") { "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", + "cJSON:cjson_static", "c_utils:utils", "common_event_service:cesfwk_innerkits", "googletest:gmock_main", @@ -47,6 +48,7 @@ ohos_unittest("file_share_permission_ndk_test") { "init:libbegetutil", "ipc:ipc_core", "samgr:samgr_proxy", + "selinux_adapter:librestorecon", ] deps = [ "${app_file_service_path}/interfaces/innerkits/native:fileshare_native", diff --git a/tools/backup_tool/src/tools_op_backup.cpp b/tools/backup_tool/src/tools_op_backup.cpp index f11c1c08b..439760fd4 100644 --- a/tools/backup_tool/src/tools_op_backup.cpp +++ b/tools/backup_tool/src/tools_op_backup.cpp @@ -38,7 +38,7 @@ #include "b_json/b_json_entity_ext_manage.h" #include "b_resources/b_constants.h" #include "backup_kit_inner.h" -#include "base/hiviewdfx/hitrace/interfaces/native/innerkits/include/hitrace_meter/hitrace_meter.h" +#include "hitrace_meter.h" #include "service_client.h" #include "tools_op.h" #include "tools_op_backup.h" diff --git a/tools/backup_tool/src/tools_op_incremental_backup.cpp b/tools/backup_tool/src/tools_op_incremental_backup.cpp index b62616d02..2c8a95d36 100644 --- a/tools/backup_tool/src/tools_op_incremental_backup.cpp +++ b/tools/backup_tool/src/tools_op_incremental_backup.cpp @@ -41,7 +41,7 @@ #include "b_json/b_json_entity_ext_manage.h" #include "b_resources/b_constants.h" #include "backup_kit_inner.h" -#include "base/hiviewdfx/hitrace/interfaces/native/innerkits/include/hitrace_meter/hitrace_meter.h" +#include "hitrace_meter.h" #include "service_client.h" #include "tools_op.h" diff --git a/tools/backup_tool/src/tools_op_incremental_restore.cpp b/tools/backup_tool/src/tools_op_incremental_restore.cpp index 64619efc9..3fe368881 100644 --- a/tools/backup_tool/src/tools_op_incremental_restore.cpp +++ b/tools/backup_tool/src/tools_op_incremental_restore.cpp @@ -40,7 +40,7 @@ #include "b_json/b_json_entity_ext_manage.h" #include "b_resources/b_constants.h" #include "backup_kit_inner.h" -#include "base/hiviewdfx/hitrace/interfaces/native/innerkits/include/hitrace_meter/hitrace_meter.h" +#include "hitrace_meter.h" #include "errors.h" #include "service_proxy.h" #include "tools_op.h" diff --git a/tools/backup_tool/src/tools_op_restore.cpp b/tools/backup_tool/src/tools_op_restore.cpp index bcf4075e8..7649de29a 100644 --- a/tools/backup_tool/src/tools_op_restore.cpp +++ b/tools/backup_tool/src/tools_op_restore.cpp @@ -37,7 +37,7 @@ #include "b_json/b_json_entity_ext_manage.h" #include "b_resources/b_constants.h" #include "backup_kit_inner.h" -#include "base/hiviewdfx/hitrace/interfaces/native/innerkits/include/hitrace_meter/hitrace_meter.h" +#include "hitrace_meter.h" #include "errors.h" #include "service_proxy.h" #include "tools_op.h" -- Gitee From b09cdcfa4676a798e3803d312027e3eba0c0faef Mon Sep 17 00:00:00 2001 From: BrainL Date: Fri, 9 May 2025 15:40:34 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: BrainL --- interfaces/common/src/common_func.cpp | 1 - interfaces/kits/js/file_share/grant_permissions.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/interfaces/common/src/common_func.cpp b/interfaces/common/src/common_func.cpp index 3a5697463..8850178f6 100644 --- a/interfaces/common/src/common_func.cpp +++ b/interfaces/common/src/common_func.cpp @@ -120,7 +120,6 @@ string CommonFunc::GetUriFromPath(const string &path) string realPath = path; NormalizePath(realPath); if (realPath.find(MEDIA_FUSE_PATH_HEAD) == 0) { - realPath = SandboxHelper::Encode(realPath); return realPath.replace(realPath.find(MEDIA_FUSE_PATH_HEAD), MEDIA_FUSE_PATH_HEAD.length(), MEDIA_AUTHORITY); } { diff --git a/interfaces/kits/js/file_share/grant_permissions.h b/interfaces/kits/js/file_share/grant_permissions.h index 9e3b690c7..c42c040f3 100644 --- a/interfaces/kits/js/file_share/grant_permissions.h +++ b/interfaces/kits/js/file_share/grant_permissions.h @@ -17,7 +17,6 @@ #define GRANT_PERMISSIONS_H #include -#include #include "file_permission.h" #include "filemgmt_libn.h" @@ -25,7 +24,6 @@ namespace OHOS { namespace AppFileService { namespace ModuleFileShare { -using ErrParam = std::function()>; napi_value PersistPermission(napi_env env, napi_callback_info info); napi_value RevokePermission(napi_env env, napi_callback_info info); napi_value ActivatePermission(napi_env env, napi_callback_info info); -- Gitee