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 29 version_script = "sg_classify_service.map" 30 31 configs = [ "${sg_root_dir}/resource/config/build:coverage_flags" ] 32 33 include_dirs = [ 34 "${sg_root_dir}/services/bigdata/include", 35 "${sg_root_dir}/interfaces/inner_api/classify/include", 36 "${sg_root_dir}/services/config_manager/include", 37 "${sg_root_dir}/services/risk_classify/include", 38 "${sg_root_dir}/services/risk_classify/model_manager/include", 39 "${sg_root_dir}/services/data_collect/store/include", 40 "${sg_root_dir}/frameworks/common/database/include", 41 "${sg_root_dir}/frameworks/common/log/include", 42 "${sg_root_dir}/frameworks/common/constants/include", 43 "${sg_root_dir}/frameworks/common/task_handler/include", 44 "${sg_root_dir}/frameworks/common/utils/include", 45 "${sg_root_dir}/frameworks/common/json/include", 46 "${sg_root_dir}/interfaces/inner_api/common/include", 47 ] 48 49 sources = [ 50 "${sg_root_dir}/frameworks/common/utils/src/security_guard_utils.cpp", 51 "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_callback_proxy.cpp", 52 "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_service.cpp", 53 "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_stub.cpp", 54 ] 55 56 sanitize = { 57 integer_overflow = true 58 ubsan = true 59 boundary_sanitize = true 60 cfi = true 61 cfi_cross_dso = true 62 debug = false 63 } 64 branch_protector_ret = "pac_ret" 65 66 deps = [ 67 "${sg_root_dir}/services/bigdata:sg_bigdata_stamp", 68 "${sg_root_dir}/services/config_manager:sg_config_manager", 69 "${sg_root_dir}/services/data_collect:sg_collect_service", 70 "${sg_root_dir}/services/risk_classify/model_manager:sg_model_manager_stamp", 71 ] 72 73 external_deps = [ 74 "access_token:libaccesstoken_sdk", 75 "access_token:libtokenid_sdk", 76 "c_utils:utils", 77 "ffrt:libffrt", 78 "hilog:libhilog", 79 "ipc:ipc_core", 80 "json:nlohmann_json_static", 81 "relational_store:native_rdb", 82 "safwk:system_ability_fwk", 83 "samgr:samgr_proxy", 84 ] 85} 86