mirror of
https://gitee.com/openharmony/startup_appspawn
synced 2024-11-23 15:10:44 +00:00
code_signature组件自适应加载
Signed-off-by: limerence <shituanhui@huawei.com>
This commit is contained in:
parent
8261c550dd
commit
f2b356b6b9
7
BUILD.gn
7
BUILD.gn
@ -142,7 +142,6 @@ if (!defined(ohos_lite)) {
|
||||
"access_token:libtoken_setproc",
|
||||
"access_token:libtokenid_sdk",
|
||||
"c_utils:utils",
|
||||
"code_signature:libcode_sign_attr_utils",
|
||||
"config_policy:configpolicy_util",
|
||||
"hilog:libhilog",
|
||||
"init:libbegetutil",
|
||||
@ -157,6 +156,12 @@ if (!defined(ohos_lite)) {
|
||||
[ "security_component_manager:libsecurity_component_enhance_sdk" ]
|
||||
}
|
||||
|
||||
if (!defined(global_parts_info) ||
|
||||
defined(global_parts_info.security_code_signature)) {
|
||||
defines += [ "CODE_SIGNATURE_ENABLE" ]
|
||||
external_deps += [ "code_signature:libcode_sign_attr_utils" ]
|
||||
}
|
||||
|
||||
if (build_selinux) {
|
||||
external_deps += [ "selinux_adapter:libhap_restorecon" ]
|
||||
}
|
||||
|
@ -36,7 +36,9 @@
|
||||
#include "limits.h"
|
||||
#include "string.h"
|
||||
#include "init_param.h"
|
||||
#ifdef CODE_SIGNATURE_ENABLE
|
||||
#include "code_sign_attr_utils.h"
|
||||
#endif
|
||||
|
||||
#define DEVICE_NULL_STR "/dev/null"
|
||||
|
||||
@ -199,6 +201,7 @@ static void ClearEnvironment(AppSpawnContent *content, AppSpawnClient *client)
|
||||
|
||||
int SetXpmConfig(struct AppSpawnContent_ *content, AppSpawnClient *client)
|
||||
{
|
||||
#ifdef CODE_SIGNATURE_ENABLE
|
||||
int ret = InitXpmRegion();
|
||||
APPSPAWN_CHECK(ret == 0, return ret, "init xpm region failed: %{public}d", ret);
|
||||
|
||||
@ -211,6 +214,7 @@ int SetXpmConfig(struct AppSpawnContent_ *content, AppSpawnClient *client)
|
||||
ret = SetXpmOwnerId(PROCESS_OWNERID_APP, appProperty->property.ownerId);
|
||||
}
|
||||
APPSPAWN_CHECK(ret == 0, return ret, "set xpm region failed: %{public}d", ret);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user