mirror of
https://gitee.com/openharmony/global_i18n
synced 2024-11-26 16:51:24 +00:00
!828 增加时区云推系统参数
Merge pull request !828 from sunyaozu/OpenHarmony-5.0-Release
This commit is contained in:
commit
8d598b5b01
@ -14,6 +14,7 @@ persist.global.language=zh-Hans
|
||||
persist.global.locale=zh-Hans-CN
|
||||
persist.global.is24Hour=
|
||||
persist.global.preferredLanguages=
|
||||
persist.global.tz_override=false
|
||||
const.global.language=zh-Hans
|
||||
const.global.locale=zh-Hans-CN
|
||||
const.global.region=CN
|
@ -15,6 +15,7 @@ persist.global.language = i18n:i18n:0775
|
||||
persist.global.locale = i18n:i18n:0775
|
||||
persist.global.is24Hour = i18n:i18n:0775
|
||||
persist.global.preferredLanguages = i18n:i18n:0775
|
||||
persist.global.tz_override = i18n:i18n:0775
|
||||
const.global.locale = i18n:i18n:0444
|
||||
const.global.language = i18n:i18n:0444
|
||||
const.global.region = i18n:i18n:0444
|
@ -104,6 +104,7 @@ ohos_executable("hmos_cust_timezone_mount") {
|
||||
deps = [ "../frameworks/intl:intl_util" ]
|
||||
external_deps = [
|
||||
"hilog:libhilog",
|
||||
"init:libbegetutil",
|
||||
"openssl:libcrypto_shared",
|
||||
"openssl:libssl_shared",
|
||||
]
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <string>
|
||||
#include <sys/mount.h>
|
||||
#include "i18n_hilog.h"
|
||||
#include "parameter.h"
|
||||
#include "signature_verifier.h"
|
||||
#include "utils.h"
|
||||
|
||||
@ -38,6 +39,7 @@ const std::string LOCALE_PATH = "/system/etc/TIMEZONE/generic/current/";
|
||||
const std::string SAFE_PATH = "/data/service/el1/public/i18n/timezone/";
|
||||
const std::string PUBKEY_PATH = "/system/etc/LIBPHONENUMBER/generic/";
|
||||
const std::string PUBKEY_NAME = "hota_i18n_upgrade_v1.pem";
|
||||
const std::string COTA_PARAM_TIMEZONE_KEY = "persist.global.tz_override";
|
||||
const int FILE_NAME_INDEX = 6;
|
||||
|
||||
std::vector<std::string> g_dataFiles = {};
|
||||
@ -213,26 +215,32 @@ bool CheckFileIntegrity()
|
||||
void UpdateTimeZone()
|
||||
{
|
||||
if (!Init()) {
|
||||
SetParameter(COTA_PARAM_TIMEZONE_KEY.c_str(), "false");
|
||||
HILOG_INFO_I18N("UpdateTimeZone: init error");
|
||||
return;
|
||||
}
|
||||
if (!Mount()) {
|
||||
SetParameter(COTA_PARAM_TIMEZONE_KEY.c_str(), "false");
|
||||
HILOG_INFO_I18N("UpdateTimeZone: mount error");
|
||||
return;
|
||||
}
|
||||
if (!CheckIfUpdateNecessary()) {
|
||||
SetParameter(COTA_PARAM_TIMEZONE_KEY.c_str(), "false");
|
||||
HILOG_INFO_I18N("UpdateTimeZone: CheckIfUpdateNecessary error, no need to update");
|
||||
return;
|
||||
}
|
||||
if (!CheckFileIntegrity()) {
|
||||
SetParameter(COTA_PARAM_TIMEZONE_KEY.c_str(), "false");
|
||||
HILOG_INFO_I18N("UpdateTimeZone: CheckFileIntegrity error, no need to update");
|
||||
return;
|
||||
}
|
||||
if (!CopyDataFile()) {
|
||||
SetParameter(COTA_PARAM_TIMEZONE_KEY.c_str(), "false");
|
||||
HILOG_INFO_I18N("UpdateTimeZone: CopyDataFile error");
|
||||
return;
|
||||
}
|
||||
|
||||
SetParameter(COTA_PARAM_TIMEZONE_KEY.c_str(), "true");
|
||||
HILOG_INFO_I18N("UpdateTimeZone: UpdateTimeZone");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user