66 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
		
		
			
		
	
	
			66 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
|  | # Copyright (c) 2023 Huawei Device Co., Ltd. | ||
|  | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
|  | # you may not use this file except in compliance with the License. | ||
|  | # You may obtain a copy of the License at | ||
|  | # | ||
|  | #     http://www.apache.org/licenses/LICENSE-2.0 | ||
|  | # | ||
|  | # Unless required by applicable law or agreed to in writing, software | ||
|  | # distributed under the License is distributed on an "AS IS" BASIS, | ||
|  | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
|  | # See the License for the specific language governing permissions and | ||
|  | # limitations under the License. | ||
|  | 
 | ||
|  | import("//build/ohos.gni") | ||
|  | import("../../code_signature.gni") | ||
|  | 
 | ||
|  | ohos_rust_executable("key_enable") { | ||
|  |   sources = [ "src/main.rs" ] | ||
|  |   deps = [ | ||
|  |     "utils:libkey_enable_utils", | ||
|  |     "${rust_openssl_dir}/openssl:lib" | ||
|  |   ] | ||
|  |   external_deps = [ | ||
|  |     "hisysevent:hisysevent_rust", | ||
|  |     "hilog:hilog_rust", | ||
|  |   ] | ||
|  |   if (build_variant == "root") { | ||
|  |     rustenv = [ "code_signature_debuggable=on" ] | ||
|  |   } else { | ||
|  |     rustenv = [ "code_signature_debuggable=off" ] | ||
|  |   } | ||
|  |   crate_name = "key_enable" | ||
|  |   crate_type = "bin" | ||
|  |   subsystem_name = "security" | ||
|  |   part_name = "code_signature" | ||
|  | } | ||
|  | 
 | ||
|  | ohos_prebuilt_etc("trusted_code_signature_certs") { | ||
|  |   source = "config/trusted_code_signature_certs.cer" | ||
|  |   part_name = "code_signature" | ||
|  |   subsystem_name = "security" | ||
|  |   relative_install_dir = "security" | ||
|  | } | ||
|  | 
 | ||
|  | ohos_prebuilt_etc("trusted_code_signature_test_certs") { | ||
|  |   source = "config/trusted_code_signature_test_certs.cer" | ||
|  |   part_name = "code_signature" | ||
|  |   subsystem_name = "security" | ||
|  |   relative_install_dir = "security" | ||
|  | } | ||
|  | 
 | ||
|  | ohos_prebuilt_etc("key_enable.cfg") { | ||
|  |   source = "key_enable.cfg" | ||
|  |   relative_install_dir = "init" | ||
|  |   subsystem_name = "security" | ||
|  |   part_name = "code_signature" | ||
|  | } | ||
|  | 
 | ||
|  | group("key_enable_targets") { | ||
|  |   deps = [ | ||
|  |     ":key_enable", | ||
|  |     ":key_enable.cfg", | ||
|  |     ":trusted_code_signature_certs", | ||
|  |     ":trusted_code_signature_test_certs" | ||
|  |   ] | ||
|  | } |