1# Copyright (c) 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("//base/security/access_token/access_token.gni") 15import("//build/config/components/ets_frontend/ets2abc_config.gni") 16import("//build/ohos.gni") 17import("//build/ohos/ace/ace.gni") 18 19ohos_shared_library("accesstoken_ani") { 20 sanitize = { 21 cfi = true 22 cfi_cross_dso = true 23 debug = false 24 } 25 cflags_cc = [ "-DHILOG_ENABLE" ] 26 include_dirs = [ 27 "${access_token_path}/frameworks/common/include", 28 "${access_token_path}/interfaces/innerkits/accesstoken/include", 29 "./include", 30 "${access_token_path}/interfaces/innerkits/token_setproc/include", 31 "${access_token_path}/interfaces/innerkits/token_callback/include", 32 "${access_token_path}/frameworks/ets/ani/common/include", 33 ] 34 sources = [ 35 "src/ani_ability_access_ctrl.cpp", 36 "src/ani_common.cpp", 37 "src/ani_request_base.cpp", 38 "src/ani_request_global_switch_on_setting.cpp", 39 "src/ani_request_permission.cpp", 40 "src/ani_request_permission_on_setting.cpp", 41 ] 42 43 deps = [ 44 "${access_token_path}/frameworks/ets/ani/common:libani_common", 45 "${access_token_path}/interfaces/innerkits/accesstoken:libaccesstoken_sdk", 46 "${access_token_path}/interfaces/innerkits/token_callback:libtoken_callback_sdk", 47 "${access_token_path}/interfaces/innerkits/token_setproc:libtokensetproc_shared", 48 ] 49 50 external_deps = [ 51 "ability_base:want", 52 "ability_runtime:ability_context_native", 53 "ability_runtime:ability_manager", 54 "ability_runtime:abilitykit_native", 55 "ability_runtime:ani_base_context", 56 "ability_runtime:appkit_native", 57 "ability_runtime:ui_extension", 58 "ace_engine:ace_uicontent", 59 "c_utils:utils", 60 "hilog:libhilog", 61 "hisysevent:libhisysevent", 62 "init:libbegetutil", 63 "ipc:ipc_single", 64 "napi:ace_napi", 65 "runtime_core:ani", 66 "runtime_core:libarkruntime", 67 ] 68 69 if (eventhandler_enable == true) { 70 cflags_cc += [ "-DEVENTHANDLER_ENABLE" ] 71 external_deps += [ "eventhandler:libeventhandler" ] 72 } 73 74 part_name = "access_token" 75 subsystem_name = "security" 76} 77 78generate_static_abc("ability_access_ctrl") { 79 base_url = "./ets" 80 files = [ "./ets/@ohos.abilityAccessCtrl.ets" ] 81 82 is_boot_abc = "True" 83 device_dst_file = "/system/framework/ability_access_ctrl.abc" 84} 85 86ohos_prebuilt_etc("ability_access_ctrl_etc") { 87 source = "$target_out_dir/ability_access_ctrl.abc" 88 deps = [ ":ability_access_ctrl" ] 89 module_install_dir = "framework" 90 part_name = "access_token" 91 subsystem_name = "security" 92} 93 94group("accesstoken_ets") { 95 deps = [ 96 ":ability_access_ctrl_etc", 97 ":accesstoken_ani", 98 ] 99} 100