• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024-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("//build/ohos.gni")
15import("../../access_token.gni")
16
17ohos_prebuilt_etc("el5_filekey_manager_cfg") {
18  source = "el5_filekey_manager.cfg"
19  relative_install_dir = "init"
20  subsystem_name = "security"
21  part_name = "access_token"
22}
23
24group("el5filekeymanager") {
25  if (is_standard_system && ability_base_enable == true) {
26    deps = [
27      "${access_token_path}/services/el5filekeymanager:el5_filekey_manager_service",
28      "${access_token_path}/services/el5filekeymanager/sa_profile:efm_sa_profile",
29    ]
30  }
31}
32
33if (is_standard_system && ability_base_enable == true) {
34  ohos_shared_library("el5_filekey_manager_service") {
35    sanitize = {
36      integer_overflow = true
37      ubsan = true
38      boundary_sanitize = true
39      cfi = true
40      cfi_cross_dso = true
41      debug = false
42    }
43    branch_protector_ret = "pac_ret"
44
45    shlib_type = "sa"
46    cflags = []
47    cflags_cc = [
48      "-fdata-sections",
49      "-ffunction-sections",
50      "-fno-asynchronous-unwind-tables",
51      "-fno-unwind-tables",
52      "-Os",
53    ]
54    defines = []
55    sources = [
56      "src/el5_filekey_manager_service.cpp",
57      "src/el5_filekey_manager_service_ability.cpp",
58      "src/el5_memory_manager.cpp",
59    ]
60
61    configs = []
62
63    if (target_cpu == "arm") {
64      cflags += [ "-DBINDER_IPC_32BIT" ]
65    }
66
67    include_dirs = [ "${access_token_path}/services/el5filekeymanager/include" ]
68
69    deps = [
70      "${access_token_path}/interfaces/inner_api/el5filekeymanager:el5_filekey_manager_sdk",
71      "${access_token_path}/interfaces/inner_api/el5filekeymanager:el5_filekey_manager_stub",
72      "${access_token_path}/interfaces/innerkits/accesstoken:libaccesstoken_sdk",
73      "${access_token_path}/interfaces/innerkits/accesstoken:libtokenid_sdk",
74      "${access_token_path}/services/el5filekeymanager:el5_filekey_manager_cfg",
75    ]
76
77    external_deps = [
78      "ability_base:want",
79      "c_utils:utils",
80      "hilog:libhilog",
81      "ipc:ipc_single",
82      "safwk:system_ability_fwk",
83      "samgr:samgr_proxy",
84    ]
85
86    if (common_event_service_enable) {
87      cflags_cc += [ "-DCOMMON_EVENT_SERVICE_ENABLE" ]
88      external_deps += [ "common_event_service:cesfwk_innerkits" ]
89      sources += [ "src/el5_filekey_manager_subscriber.cpp" ]
90    }
91
92    if (eventhandler_enable == true) {
93      cflags_cc += [ "-DEVENTHANDLER_ENABLE" ]
94      external_deps += [ "eventhandler:libeventhandler" ]
95    }
96
97    if (theme_screenlock_mgr_enable) {
98      cflags_cc += [ "-DTHEME_SCREENLOCK_MGR_ENABLE" ]
99      external_deps += [ "screenlock_mgr:screenlock_client" ]
100    }
101
102    subsystem_name = "security"
103    part_name = "access_token"
104  }
105}
106