1# Copyright (c) 2023 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/filemanagement/app_file_service/app_file_service.gni") 16 17config("file_share_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "file_share/include", 21 "//third_party/json/include", 22 "../../common/include", 23 ] 24} 25 26config("file_uri_config") { 27 visibility = [ ":*" ] 28 include_dirs = [ 29 "file_uri/include", 30 "//third_party/json/include", 31 "../../common/include", 32 ] 33} 34 35ohos_shared_library("fileshare_native") { 36 branch_protector_ret = "pac_ret" 37 38 sanitize = { 39 integer_overflow = true 40 ubsan = true 41 boundary_sanitize = true 42 cfi = true 43 cfi_cross_dso = true 44 debug = false 45 } 46 47 sources = [ 48 "../../common/src/json_utils.cpp", 49 "../../common/src/sandbox_helper.cpp", 50 "file_share/src/file_permission.cpp", 51 "file_share/src/file_share.cpp", 52 ] 53 54 public_configs = [ ":file_share_config" ] 55 56 deps = 57 [ "${app_file_service_path}/interfaces/innerkits/native:fileuri_native" ] 58 59 external_deps = [ 60 "ability_base:base", 61 "ability_base:want", 62 "ability_base:zuri", 63 "access_token:libaccesstoken_sdk", 64 "bundle_framework:appexecfwk_base", 65 "c_utils:utils", 66 "file_api:filemgmt_libn", 67 "hilog:libhilog", 68 "init:libbegetutil", 69 "ipc:ipc_core", 70 "napi:ace_napi", 71 ] 72 defines = [] 73 if (sandbox_manarer) { 74 external_deps += [ 75 "ability_runtime:uri_permission_mgr", 76 "sandbox_manager:libsandbox_manager_sdk", 77 ] 78 defines += [ 79 "SANDBOX_MANAGER", 80 "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER", 81 ] 82 } 83 part_name = "app_file_service" 84 subsystem_name = "filemanagement" 85} 86 87ohos_shared_library("fileuri_native") { 88 branch_protector_ret = "pac_ret" 89 sanitize = { 90 integer_overflow = true 91 cfi = true 92 cfi_cross_dso = true 93 debug = false 94 } 95 96 sources = [ 97 "../../common/src/common_func.cpp", 98 "../../common/src/json_utils.cpp", 99 "../../common/src/sandbox_helper.cpp", 100 "file_uri/src/file_uri.cpp", 101 ] 102 103 public_configs = [ ":file_uri_config" ] 104 105 external_deps = [ 106 "ability_base:zuri", 107 "bundle_framework:appexecfwk_base", 108 "bundle_framework:appexecfwk_core", 109 "c_utils:utils", 110 "hilog:libhilog", 111 "init:libbegetutil", 112 "ipc:ipc_core", 113 "samgr:samgr_proxy", 114 ] 115 116 part_name = "app_file_service" 117 subsystem_name = "filemanagement" 118} 119 120ohos_prebuilt_etc("file_share_sandbox.json") { 121 source = "../../common/file_share_sandbox.json" 122 part_name = "app_file_service" 123 subsystem_name = "filemanagement" 124 module_install_dir = "etc/app_file_service" 125} 126 127ohos_prebuilt_etc("backup_sandbox.json") { 128 source = "../../common/backup_sandbox.json" 129 part_name = "app_file_service" 130 subsystem_name = "filemanagement" 131 module_install_dir = "etc/app_file_service" 132} 133 134config("remote_file_share_config") { 135 visibility = [ ":*" ] 136 include_dirs = [ 137 "include", 138 "${utils_system_safwk_path}/native/include", 139 "remote_file_share/include", 140 "//third_party/json/include", 141 "${path_base}/include", 142 "../../common/include", 143 ".", 144 ] 145} 146 147ohos_shared_library("remote_file_share_native") { 148 branch_protector_ret = "pac_ret" 149 sanitize = { 150 integer_overflow = true 151 cfi = true 152 cfi_cross_dso = true 153 debug = false 154 } 155 156 sources = [ 157 "../../common/src/json_utils.cpp", 158 "../../common/src/sandbox_helper.cpp", 159 "remote_file_share/src/remote_file_share.cpp", 160 ] 161 162 public_configs = [ ":remote_file_share_config" ] 163 164 external_deps = [ 165 "ability_base:zuri", 166 "c_utils:utils", 167 "hilog:libhilog", 168 ] 169 170 if (defined(global_parts_info) && 171 defined(global_parts_info.distributedhardware_device_manager)) { 172 external_deps += [ "device_manager:devicemanagersdk" ] 173 defines = [ "ENABLE_DEVICE_MANAGER" ] 174 } 175 176 innerapi_tags = [ "platformsdk_indirect" ] 177 part_name = "app_file_service" 178 subsystem_name = "filemanagement" 179} 180 181config("sandbox_helper_config") { 182 visibility = [ ":*" ] 183 include_dirs = [ 184 "include", 185 "${utils_system_safwk_path}/native/include", 186 "//third_party/json/include", 187 "${path_base}/include", 188 "../../common/include", 189 ".", 190 ] 191} 192 193ohos_shared_library("sandbox_helper_native") { 194 branch_protector_ret = "pac_ret" 195 sanitize = { 196 integer_overflow = true 197 cfi = true 198 cfi_cross_dso = true 199 debug = false 200 } 201 202 sources = [ 203 "../../common/src/json_utils.cpp", 204 "../../common/src/sandbox_helper.cpp", 205 ] 206 207 public_configs = [ ":sandbox_helper_config" ] 208 209 external_deps = [ 210 "ability_base:zuri", 211 "c_utils:utils", 212 "hilog:libhilog", 213 ] 214 215 innerapi_tags = [ "platformsdk_indirect" ] 216 part_name = "app_file_service" 217 subsystem_name = "filemanagement" 218} 219 220group("app_file_service_native") { 221 deps = [ 222 ":fileshare_native", 223 ":fileuri_native", 224 ":remote_file_share_native", 225 ":sandbox_helper_native", 226 ] 227} 228 229group("etc_files") { 230 deps = [ 231 ":backup_sandbox.json", 232 ":file_share_sandbox.json", 233 ] 234} 235