1# Copyright (c) 2023-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") 15 16sec_comp_root_dir = "../../.." 17 18config("security_component_service_config") { 19 include_dirs = [ 20 "sa_main", 21 "${sec_comp_root_dir}/frameworks/common/include", 22 "${sec_comp_root_dir}/frameworks/enhance_adapter/include", 23 "${sec_comp_root_dir}/frameworks/security_component/include", 24 "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", 25 ] 26} 27 28ohos_prebuilt_etc("security_component_service.rc") { 29 source = "security_component_service.cfg" 30 relative_install_dir = "init" 31 subsystem_name = "security" 32 part_name = "security_component_manager" 33} 34 35ohos_source_set("security_component_service_src_set") { 36 subsystem_name = "security" 37 part_name = "security_component_manager" 38 sanitize = { 39 cfi = true 40 cfi_cross_dso = true 41 debug = false 42 } 43 branch_protector_ret = "pac_ret" 44 include_dirs = [ 45 "sa_main", 46 "${sec_comp_root_dir}/frameworks/common/include", 47 "${sec_comp_root_dir}/frameworks/enhance_adapter/include", 48 "${sec_comp_root_dir}/frameworks/security_component/include", 49 "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", 50 ] 51 52 sources = [ 53 "${sec_comp_root_dir}/interfaces/inner_api/security_component/src/sec_comp_dialog_callback_stub.cpp", 54 "sa_main/app_mgr_death_recipient.cpp", 55 "sa_main/app_state_observer.cpp", 56 "sa_main/delay_exit_task.cpp", 57 "sa_main/first_use_dialog.cpp", 58 "sa_main/sec_comp_dialog_callback_proxy.cpp", 59 "sa_main/sec_comp_entity.cpp", 60 "sa_main/sec_comp_info_helper.cpp", 61 "sa_main/sec_comp_malicious_apps.cpp", 62 "sa_main/sec_comp_manager.cpp", 63 "sa_main/sec_comp_perm_manager.cpp", 64 "sa_main/sec_comp_service.cpp", 65 "sa_main/sec_comp_stub.cpp", 66 "sa_main/sec_event_handler.cpp", 67 "sa_main/window_info_helper.cpp", 68 ] 69 70 cflags_cc = [ 71 "-DHILOG_ENABLE", 72 "-fvisibility=hidden", 73 ] 74 cflags = [ "-DHILOG_ENABLE" ] 75 76 deps = [ 77 ":security_component_service.rc", 78 "${sec_comp_root_dir}/frameworks:security_component_enhance_adapter_src_set", 79 "${sec_comp_root_dir}/frameworks:security_component_framework_src_set", 80 ] 81 82 configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] 83 public_configs = [ ":security_component_service_config" ] 84 85 external_deps = [ 86 "ability_base:base", 87 "ability_base:session_info", 88 "ability_base:want", 89 "ability_base:zuri", 90 "ability_runtime:ability_manager", 91 "ability_runtime:app_manager", 92 "ability_runtime:runtime", 93 "access_token:libaccesstoken_sdk", 94 "bundle_framework:appexecfwk_base", 95 "bundle_framework:appexecfwk_core", 96 "c_utils:utils", 97 "data_share:datashare_consumer", 98 "eventhandler:libeventhandler", 99 "graphic_2d:librender_service_client", 100 "hilog:libhilog", 101 "hisysevent:libhisysevent", 102 "hitrace:hitrace_meter", 103 "ipc:ipc_core", 104 "safwk:system_ability_fwk", 105 "samgr:samgr_proxy", 106 "window_manager:libdm", 107 "window_manager:libwm", 108 ] 109} 110 111ohos_shared_library("security_component_service") { 112 subsystem_name = "security" 113 part_name = "security_component_manager" 114 sanitize = { 115 cfi = true 116 cfi_cross_dso = true 117 debug = false 118 } 119 branch_protector_ret = "pac_ret" 120 121 deps = [ 122 ":security_component_service.rc", 123 ":security_component_service_src_set", 124 "${sec_comp_root_dir}/frameworks:security_component_enhance_adapter_src_set", 125 "${sec_comp_root_dir}/frameworks:security_component_framework_src_set", 126 ] 127 external_deps = [ "hilog:libhilog" ] 128 public_configs = [ ":security_component_service_config" ] 129 configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] 130} 131