From 1e2041e9e22379f0ad325423f19e8157cd8c281c Mon Sep 17 00:00:00 2001 From: huzhonghua Date: Wed, 30 Jun 2021 16:12:07 +0800 Subject: [PATCH] update getting 3516 board udid Signed-off-by: huzhonghua --- hals/BUILD.gn | 2 ++ hals/src/dev_info/3516/hc_dev_info.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hals/BUILD.gn b/hals/BUILD.gn index 127466d..116fb24 100644 --- a/hals/BUILD.gn +++ b/hals/BUILD.gn @@ -33,6 +33,7 @@ ohos_static_library("deviceauth_hal_linux") { "//utils/native/base/include", "//third_party/openssl/include/", "//base/security/huks/interfaces/innerkits/huks_standard/main/include", + "//base/startup/syspara_lite/interfaces/innerkits/native/syspara/include" ] sources = hal_common_files @@ -56,6 +57,7 @@ ohos_static_library("deviceauth_hal_linux") { "//third_party/cJSON:cjson_static", "//third_party/openssl:libcrypto_static", "//utils/native/base:utils", + "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara" ] external_deps = [ "hiviewdfx_hilog_native:libhilog" ] diff --git a/hals/src/dev_info/3516/hc_dev_info.c b/hals/src/dev_info/3516/hc_dev_info.c index c2da39c..67d3ecd 100755 --- a/hals/src/dev_info/3516/hc_dev_info.c +++ b/hals/src/dev_info/3516/hc_dev_info.c @@ -15,7 +15,9 @@ #include "hc_dev_info.h" #include "hc_error.h" +#include "hc_log.h" #include "securec.h" +#include "parameter.h" #ifdef __cplusplus extern "C" { @@ -26,6 +28,11 @@ int32_t HcGetUdid(uint8_t *udid, int32_t udidLen) if (udid == NULL || udidLen < INPUT_UDID_LEN || udidLen > MAX_INPUT_UDID_LEN) { return HAL_ERR_INVALID_PARAM; } + int32_t ret = GetDevUdid((char *)udid, udidLen); + if (ret == 0) { + return HAL_SUCCESS; + } + LOGW("using fake udid"); const char *udidTemp = "ABCDEF00ABCDEF00ABCDEF00ABCDEF00ABCDEF00ABCDEF00ABCDEF00ABCDEF00"; (void)memset_s(udid, udidLen, 0, udidLen); if (memcpy_s(udid, udidLen, udidTemp, strlen(udidTemp)) != EOK) { @@ -41,4 +48,4 @@ const char *GetStoragePath() #ifdef __cplusplus } -#endif \ No newline at end of file +#endif