提交 f01dce92 编写于 作者: L laiguizhong

修改sn获取方式

Signed-off-by: Nlaiguizhong <laiguizhong@huawei.com>
上级 63c7cae8
......@@ -231,8 +231,13 @@ const char *GetBuildTime(void)
const char *GetSerial(void)
{
static const char *ohos_serial = NULL;
return GetProperty("ohos.boot.sn", &ohos_serial);
static const char ohos_serial[PARAM_VALUE_LEN_MAX] = {0};
uint32_t len = PARAM_VALUE_LEN_MAX;
int ret = SystemGetParameter("ohos.boot.sn", ohos_serial, &len);
if (ret != 0) {
return NULL;
}
return ohos_serial;
}
int GetDevUdid(char *udid, int size)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册