1# Copyright (c) 2022-2025 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/config/components/idl_tool/idl.gni") 15import("//foundation/ability/ability_runtime/ability_runtime.gni") 16 17config("uripermkit_public_config") { 18 visibility = [ ":*" ] 19 visibility += [ "${ability_runtime_test_path}/unittest/*" ] 20 include_dirs = [ 21 "include", 22 "${ability_runtime_services_path}/uripermmgr/include", 23 "${target_gen_dir}", 24 ] 25 cflags = [] 26 if (target_cpu == "arm") { 27 cflags += [ "-DBINDER_IPC_32BIT" ] 28 } 29} 30 31idl_gen_interface("uri_permission_manager_interface") { 32 sources = [ "IUriPermissionManager.idl" ] 33 log_domainid = "0xD001315" 34 log_tag = "UriPermMgr" 35 subsystem_name = "ability" 36 part_name = "ability_runtime" 37} 38 39#build so 40ohos_shared_library("uri_permission_mgr") { 41 sanitize = { 42 cfi = true 43 cfi_cross_dso = true 44 debug = false 45 } 46 branch_protector_ret = "pac_ret" 47 48 configs = [ "${ability_runtime_services_path}/common:common_config" ] 49 public_configs = [ ":uripermkit_public_config" ] 50 51 sources = [] 52 output_values = get_target_outputs(":uri_permission_manager_interface") 53 sources += filter_include(output_values, [ "*_proxy.cpp" ]) 54 sources += filter_include(output_values, [ "*_stub.cpp" ]) 55 56 deps = [ 57 ":uri_permission_manager_interface", 58 "${ability_runtime_services_path}/common:app_util", 59 ] 60 61 external_deps = [ 62 "ability_base:zuri", 63 "access_token:libaccesstoken_sdk", 64 "c_utils:utils", 65 "hilog:libhilog", 66 "ipc:ipc_core", 67 "samgr:samgr_proxy", 68 "storage_service:storage_manager_sa_proxy", 69 ] 70 71 sources += [ 72 "src/uri_permission_load_callback.cpp", 73 "src/uri_permission_manager_client.cpp", 74 "src/uri_permission_raw_data.cpp", 75 ] 76 77 if (ability_runtime_feature_sandboxmanager) { 78 external_deps += [ "sandbox_manager:libsandbox_manager_sdk" ] 79 defines = [ "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER" ] 80 } 81 82 innerapi_tags = [ "platformsdk" ] 83 subsystem_name = "ability" 84 part_name = "ability_runtime" 85} 86