1# Copyright (c) 2022 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/security_guard/security_guard.gni") 15import("//build/ohos.gni") 16 17config("security_guard_model_configs") { 18 include_dirs = [ 19 "${sg_root_dir}/services/risk_classify/model_manager/include", 20 "${sg_root_dir}/services/config_manager/include", 21 "${sg_root_dir}/interfaces/inner_api/common/include", 22 ] 23} 24 25ohos_shared_library("sg_classify_service") { 26 subsystem_name = "security" 27 part_name = "security_guard" 28 version_script = "sg_classify_service.map" 29 30 configs = [ "${sg_root_dir}/resource/config/build:coverage_flags" ] 31 32 include_dirs = [ 33 "${target_gen_dir}", 34 "${sg_root_dir}/services/bigdata/include", 35 "${sg_root_dir}/interfaces/inner_api/classify/include", 36 "${sg_root_dir}/frameworks/common/classify/include", 37 "${sg_root_dir}/services/config_manager/include", 38 "${sg_root_dir}/services/risk_classify/include", 39 "${sg_root_dir}/services/risk_classify/model_manager/include", 40 "${sg_root_dir}/services/risk_classify/plugin_manager/include", 41 "${sg_root_dir}/services/data_collect/store/include", 42 "${sg_root_dir}/frameworks/common/database/include", 43 "${sg_root_dir}/frameworks/common/log/include", 44 "${sg_root_dir}/frameworks/common/constants/include", 45 "${sg_root_dir}/frameworks/common/task_handler/include", 46 "${sg_root_dir}/frameworks/common/utils/include", 47 "${sg_root_dir}/frameworks/common/json/include", 48 "${sg_root_dir}/interfaces/inner_api/common/include", 49 ] 50 51 sources = [ 52 "${sg_root_dir}/frameworks/common/utils/src/file_util.cpp", 53 "${sg_root_dir}/frameworks/common/utils/src/json_util.cpp", 54 "${sg_root_dir}/frameworks/common/utils/src/security_guard_utils.cpp", 55 "${sg_root_dir}/services/risk_classify/plugin_manager/src/detect_plugin_manager.cpp", 56 "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_callback_proxy.cpp", 57 "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_service.cpp", 58 ] 59 60 sanitize = { 61 integer_overflow = true 62 ubsan = true 63 boundary_sanitize = true 64 cfi = true 65 cfi_cross_dso = true 66 debug = false 67 } 68 branch_protector_ret = "pac_ret" 69 70 deps = [ 71 "${sg_root_dir}/frameworks/common/collect:libsg_collect_sdk", 72 "${sg_root_dir}/services/bigdata:sg_bigdata_stamp", 73 "${sg_root_dir}/services/config_manager:sg_config_manager", 74 "${sg_root_dir}/services/data_collect:sg_collect_service", 75 "${sg_root_dir}/services/risk_classify/idl:risk_analysis_manager_idl_sa_stub", 76 "${sg_root_dir}/services/risk_classify/model_manager:sg_model_manager_stamp", 77 ] 78 79 external_deps = [ 80 "access_token:libaccesstoken_sdk", 81 "access_token:libtokenid_sdk", 82 "cJSON:cjson", 83 "c_utils:utils", 84 "ffrt:libffrt", 85 "hilog:libhilog", 86 "ipc:ipc_core", 87 "json:nlohmann_json_static", 88 "safwk:system_ability_fwk", 89 "samgr:samgr_proxy", 90 ] 91} 92