mirror of
https://gitee.com/openharmony/security_code_signature
synced 2024-11-27 16:30:30 +00:00
get xpm mode status
Signed-off-by: yeyuning <yeyuning2@huawei.com> Change-Id: Ibcd7e3cade882062494edebdd9102ae6e2faef83
This commit is contained in:
parent
3a65f69755
commit
e6b64ceb4e
@ -25,6 +25,8 @@ namespace Constants {
|
||||
const std::string FSV_SIG_SUFFIX = ".fsv-sig";
|
||||
const std::string ENABLE_SIGNATURE_FILE_BASE_PATH = "/data/service/el1/public/bms/bundle_manager_service";
|
||||
const std::string ENABLE_APP_BASE_PATH = "/data/app/el1/bundle/public";
|
||||
const std::string XPM_DEBUG_FS_MODE_PATH = "/proc/sys/kernel/xpm/xpm_mode";
|
||||
const std::string SUPPORT_OH_SDK_CODE_SIGN = "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,8 @@
|
||||
*/
|
||||
|
||||
#include "code_sign_utils.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <asm/unistd.h>
|
||||
#include <cstdlib>
|
||||
#include <cstdint>
|
||||
@ -321,7 +322,19 @@ int32_t CodeSignUtils::RemoveKeyInProfile(const std::string &bundleName)
|
||||
bool CodeSignUtils::isSupportOHCodeSign()
|
||||
{
|
||||
#ifdef SUPPORT_OH_CODE_SIGN
|
||||
return true;
|
||||
std::ifstream file(Constants::XPM_DEBUG_FS_MODE_PATH);
|
||||
if (!file.is_open()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string content;
|
||||
file >> content;
|
||||
file.close();
|
||||
|
||||
if (content == Constants::SUPPORT_OH_SDK_CODE_SIGN) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
@ -71,6 +71,13 @@
|
||||
"subject":"",
|
||||
"issuer":"",
|
||||
"max-certs-path":3
|
||||
},
|
||||
{
|
||||
"mode":"Dev",
|
||||
"type":"Authed",
|
||||
"subject":"C=CN, O=Organization, OU=Unit, CN=ide_demo_app",
|
||||
"issuer":"C=CN, O=OpenHarmony, OU=OpenHarmony Team, CN=OpenHarmony Application CA",
|
||||
"max-certs-path":3
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user