1# Copyright (C) 2022 Huawei Technologies Co., Ltd. 2# Licensed under the Mulan PSL v2. 3# You can use this software according to the terms and conditions of the Mulan PSL v2. 4# You may obtain a copy of Mulan PSL v2 at: 5# http://license.coscl.org.cn/MulanPSL2 6# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 7# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 8# PURPOSE. 9# See the Mulan PSL v2 for more details. 10 11import("//base/tee/tee_client/tee_client.gni") 12import("//build/ohos.gni") 13import("//build/ohos_var.gni") 14 15component_type = "" 16if (defined(global_parts_info) && 17 defined(global_parts_info.bundlemanager_bundle_framework)) { 18 component_type = "system" 19} 20 21ohos_shared_library("libcadaemon") { 22 part_name = "tee_client" 23 subsystem_name = "tee" 24 defines = [] 25 26 if (component_type == "system") { 27 defines += [ "ENABLE_FDSAN_CHECK" ] 28 sources = [ 29 "../../../../frameworks/libteec_vendor/load_sec_file.c", 30 "../../../../frameworks/libteec_vendor/tee_client_api.c", 31 "../../../../frameworks/libteec_vendor/tee_client_app_load.c", 32 "../../../../frameworks/tee_file/tee_file.c", 33 "../../../authentication/tcu_authentication.c", 34 "../../../authentication/tee_auth_common.c", 35 "../../../authentication/tee_auth_system.cpp", 36 "../../../authentication/tee_get_native_cert.c", 37 "../../src/ca_daemon/cadaemon_service.cpp", 38 "../../src/ca_daemon/cadaemon_stub.cpp", 39 "../../src/tui_daemon/tee_tui_daemon_wrapper.cpp", 40 "../../src/tui_daemon/tui_file.cpp", 41 ] 42 43 include_dirs = [ 44 "../../../../interfaces/inner_api", 45 "../../../../frameworks/include/", 46 "../../../../frameworks/include/standard/", 47 "../../../../frameworks/include/standard/teec_system", 48 "../../../../frameworks/libteec_vendor/", 49 "../../../authentication", 50 "../../src/ca_daemon", 51 "../../../../services/cadaemon/src/tui_daemon", 52 ] 53 54 if (tee_client_features_tui) { 55 deps = [ "../../../../services/cadaemon/build/standard:libcadaemon_tui" ] 56 } 57 58 external_deps = [ 59 "access_token:libaccesstoken_sdk", 60 "bounds_checking_function:libsec_shared", 61 "bundle_framework:bundlemgr_mini", 62 "c_utils:utils", 63 "hilog:libhilog", 64 "ipc:ipc_single", 65 "openssl:libcrypto_shared", 66 "safwk:system_ability_fwk", 67 "samgr:samgr_proxy", 68 ] 69 70 sanitize = { 71 cfi = true 72 cfi_cross_dso = true 73 debug = false 74 } 75 } 76} 77 78if (component_type == "system") { 79 declare_args() { 80 hash_string = "" 81 } 82 ohos_shared_library("libcadaemon_tui") { 83 part_name = "tee_client" 84 subsystem_name = "tee" 85 output_extension = "so" 86 defines = [] 87 88 # ttf_calc_hash_script = rebase_path("../../../../services/cadaemon/build/standard/calc_hash.sh") 89 # hash_string = exec_script(ttf_calc_hash_script, [], "string") 90 hash_string = 91 "8978e05044e7089ad6a9de38c505c8148305607983487435a916d2610700a7ca" 92 93 # md5sum ttf_calc_hash_script 94 # print("get hash_string :" + hash_string + " and file path :" + ttf_calc_hash_script) 95 if (hash_string != "") { 96 defines += [ "FONT_HASH_VAL=\"$hash_string\"" ] 97 } else { 98 defines += [ "FONT_HASH_VAL=\"hash_string can not be set\"" ] 99 } 100 defines += [ "ENABLE_FDSAN_CHECK" ] 101 sources = [ 102 "../../../../frameworks/tee_file/tee_file.c", 103 "../../src/tui_daemon/tee_tui_daemon.cpp", 104 "../../src/tui_daemon/tui_event.cpp", 105 ] 106 107 include_dirs = [ 108 "../../../../interfaces/inner_api", 109 "../../../../frameworks/include/", 110 "../../../../frameworks/include/standard/", 111 "../../../../frameworks/include/standard/teec_system", 112 "../../../../frameworks/libteec_vendor/", 113 "../../../authentication", 114 "../../src/ca_daemon", 115 "../../src/tui_daemon", 116 ] 117 118 external_deps = [ 119 "ability_base:want", 120 "bounds_checking_function:libsec_shared", 121 "c_utils:utils", 122 "call_manager:tel_call_manager_api", 123 "hilog:libhilog", 124 "image_framework:image_native", 125 "ipc:ipc_single", 126 "power_manager:powermgr_client", 127 "safwk:system_ability_fwk", 128 "samgr:samgr_proxy", 129 ] 130 131 if (component_type == "system") { 132 # blue area use window_manager:libdm, yellow area use window_manager:libdm_lite 133 # libdm_lite that does not introduce graph dependency is used to reduce the memory 134 external_deps += [ "window_manager:libdm_lite" ] 135 defines += [ "SCENE_BOARD_ENABLE" ] 136 } 137 138 ldflags = [ 139 "-Wl,-z,max-page-size=4096", 140 "-Wl,-z,separate-code", 141 ] 142 sanitize = { 143 cfi = true 144 cfi_cross_dso = true 145 debug = false 146 } 147 } 148} 149