1# Copyright (c) 2022-2024 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/ohos.gni") 15import("//foundation/ability/ability_runtime/ability_runtime.gni") 16 17config("upms_config") { 18 visibility = [ ":*" ] 19 visibility += [ "${ability_runtime_test_path}/unittest/*" ] 20 include_dirs = [ 21 "include", 22 "${ability_runtime_utils_path}/global/constant", 23 ] 24 cflags = [] 25 if (target_cpu == "arm") { 26 cflags += [ "-DBINDER_IPC_32BIT" ] 27 } 28} 29 30libupms_sources = [ 31 "src/batch_uri.cpp", 32 "src/file_permission_manager.cpp", 33 "src/tokenid_permission.cpp", 34 "src/uri_permission_manager_service.cpp", 35 "src/uri_permission_manager_stub_impl.cpp", 36 "src/uri_permission_utils.cpp", 37 "src/upms_udmf_utils.cpp", 38] 39 40#build so 41ohos_shared_library("libupms") { 42 sanitize = { 43 cfi = true 44 cfi_cross_dso = true 45 debug = false 46 } 47 branch_protector_ret = "pac_ret" 48 shlib_type = "sa" 49 configs = [ 50 "${ability_runtime_innerkits_path}/app_manager:appmgr_sdk_config", 51 "${ability_runtime_services_path}/common:common_config", 52 "${ability_runtime_services_path}/abilitymgr:abilityms_config", 53 ] 54 public_configs = [ ":upms_config" ] 55 56 include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper" ] 57 58 sources = libupms_sources 59 60 deps = [ 61 "${ability_runtime_innerkits_path}/ability_manager:ability_manager", 62 "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", 63 "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", 64 "${ability_runtime_native_path}/appkit:appkit_manager_helper", 65 "${ability_runtime_services_path}/common:app_util", 66 "${ability_runtime_services_path}/common:event_report", 67 "${ability_runtime_services_path}/common:perm_verification", 68 ] 69 70 external_deps = [ 71 "ability_base:configuration", 72 "ability_base:want", 73 "ability_base:zuri", 74 "access_token:libaccesstoken_sdk", 75 "access_token:libtokenid_sdk", 76 "app_file_service:fileuri_native", 77 "background_task_mgr:bgtaskmgr_innerkits", 78 "bundle_framework:appexecfwk_base", 79 "bundle_framework:appexecfwk_core", 80 "c_utils:utils", 81 "common_event_service:cesfwk_core", 82 "common_event_service:cesfwk_innerkits", 83 "data_share:datashare_consumer", 84 "eventhandler:libeventhandler", 85 "graphic_2d:color_manager", 86 "hilog:libhilog", 87 "hisysevent:libhisysevent", 88 "hitrace:hitrace_meter", 89 "init:libbeget_proxy", 90 "init:libbegetutil", 91 "ipc:ipc_core", 92 "relational_store:native_dataability", 93 "relational_store:native_rdb", 94 "safwk:system_ability_fwk", 95 "samgr:samgr_proxy", 96 "storage_service:storage_manager_sa_proxy", 97 "udmf:udmf_client", 98 ] 99 100 defines = [] 101 if (ability_runtime_feature_sandboxmanager) { 102 external_deps += [ "sandbox_manager:libsandbox_manager_sdk" ] 103 defines += [ "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER" ] 104 } 105 if (ability_runtime_graphics) { 106 external_deps += [ "i18n:intl_util" ] 107 } 108 109 if (ability_runtime_media_library_enable) { 110 sources += [ "src/media_permission_manager.cpp" ] 111 external_deps += [ "media_library:media_library_extend_manager" ] 112 defines += [ "ABILITY_RUNTIME_MEDIA_LIBRARY_ENABLE" ] 113 } 114 115 subsystem_name = "ability" 116 part_name = "ability_runtime" 117} 118 119# Note: Just for test 120ohos_static_library("libupms_static") { 121 sanitize = { 122 cfi = true 123 cfi_cross_dso = true 124 debug = false 125 blocklist = "../../test/cfi_blocklist.txt" 126 } 127 branch_protector_ret = "pac_ret" 128 configs = [ 129 "${ability_runtime_innerkits_path}/app_manager:appmgr_sdk_config", 130 "${ability_runtime_services_path}/common:common_config", 131 ] 132 public_configs = [ ":upms_config" ] 133 134 include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper" ] 135 136 sources = libupms_sources 137 138 deps = [ 139 "${ability_runtime_innerkits_path}/ability_manager:ability_manager", 140 "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", 141 "${ability_runtime_services_path}/common:app_util", 142 "${ability_runtime_services_path}/common:perm_verification", 143 ] 144 145 external_deps = [ 146 "ability_base:configuration", 147 "ability_base:want", 148 "ability_base:zuri", 149 "access_token:libaccesstoken_sdk", 150 "app_file_service:fileuri_native", 151 "bundle_framework:appexecfwk_base", 152 "bundle_framework:appexecfwk_core", 153 "c_utils:utils", 154 "common_event_service:cesfwk_core", 155 "common_event_service:cesfwk_innerkits", 156 "data_share:datashare_consumer", 157 "hilog:libhilog", 158 "hisysevent:libhisysevent", 159 "hitrace:hitrace_meter", 160 "init:libbeget_proxy", 161 "init:libbegetutil", 162 "ipc:ipc_core", 163 "safwk:system_ability_fwk", 164 "samgr:samgr_proxy", 165 "storage_service:storage_manager_sa_proxy", 166 "udmf:udmf_client", 167 ] 168 if (ability_runtime_upms) { 169 deps += [ 170 "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", 171 ] 172 } 173 174 defines = [] 175 176 if (ability_runtime_feature_sandboxmanager) { 177 external_deps += [ "sandbox_manager:libsandbox_manager_sdk" ] 178 defines += [ "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER" ] 179 } 180 181 if (ability_runtime_media_library_enable) { 182 sources += [ "src/media_permission_manager.cpp" ] 183 external_deps += [ "media_library:media_library_extend_manager" ] 184 defines += [ "ABILITY_RUNTIME_MEDIA_LIBRARY_ENABLE" ] 185 } 186 187 subsystem_name = "ability" 188 part_name = "ability_runtime" 189} 190