From bda2efdae0c4df2c2d64796dd3469bc53f53604f Mon Sep 17 00:00:00 2001
From: "beiling.xie" <xiekunxun@huawei.com>
Date: Thu, 10 Nov 2022 14:37:25 +0800
Subject: [PATCH] simplify dependency on third-party packages

Signed-off-by: beiling.xie <xiekunxun@huawei.com>
---
 frameworks/huks_standard/main/core/BUILD.gn               | 3 ++-
 .../huks_standard/main/crypto_engine/openssl/BUILD.gn     | 4 +++-
 frameworks/huks_standard/main/os_dependency/BUILD.gn      | 7 +++----
 .../huks_service/main/os_dependency/BUILD.gn              | 8 +++-----
 .../huks_service/main/os_dependency/idl/BUILD.gn          | 2 +-
 utils/crypto_adapter/BUILD.gn                             | 3 ++-
 6 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/frameworks/huks_standard/main/core/BUILD.gn b/frameworks/huks_standard/main/core/BUILD.gn
index b601eda..6ac01d4 100755
--- a/frameworks/huks_standard/main/core/BUILD.gn
+++ b/frameworks/huks_standard/main/core/BUILD.gn
@@ -40,7 +40,8 @@ ohos_static_library("libhuks_core_standard_static") {
   ]
   deps = [
     "//base/security/huks/frameworks/huks_standard/main/common:libhuks_common_standard_static",
-    "//third_party/openssl:libcrypto_static",
   ]
+
+  libs = [ "crypto" ]
   complete_static_lib = true
 }
diff --git a/frameworks/huks_standard/main/crypto_engine/openssl/BUILD.gn b/frameworks/huks_standard/main/crypto_engine/openssl/BUILD.gn
index ab4d1a2..f02b701 100755
--- a/frameworks/huks_standard/main/crypto_engine/openssl/BUILD.gn
+++ b/frameworks/huks_standard/main/crypto_engine/openssl/BUILD.gn
@@ -51,8 +51,10 @@ ohos_static_library("libhuks_openssl_standard_static") {
 
   deps = [
     "//base/security/huks/frameworks/huks_standard/main/common:libhuks_common_standard_static",
-    "//third_party/openssl:libcrypto_static",
   ]
+
+  libs = [ "crypto" ]
+
   cflags = [
     "-DHILOG_ENABLE",
     "-Wall",
diff --git a/frameworks/huks_standard/main/os_dependency/BUILD.gn b/frameworks/huks_standard/main/os_dependency/BUILD.gn
index 6da94a5..bfe2941 100755
--- a/frameworks/huks_standard/main/os_dependency/BUILD.gn
+++ b/frameworks/huks_standard/main/os_dependency/BUILD.gn
@@ -52,10 +52,9 @@ ohos_static_library("libhuks_os_dependency_standard_static") {
     "//utils/native/base:utils",
     "//third_party/bounds_checking_function:libsec_shared",
   ]
-  external_deps = [
-    "hiviewdfx_hilog_native:libhilog",
-    "ipc:ipc_core",
-    "samgr_standard:samgr_proxy",
+  deps += [
+    "//depend:libhilog",
+    "//depend/ipc:ipc_core",
   ]
   cflags_cc = [
     "-DHILOG_ENABLE",
diff --git a/services/huks_standard/huks_service/main/os_dependency/BUILD.gn b/services/huks_standard/huks_service/main/os_dependency/BUILD.gn
index 01078b7..dfa2c4f 100755
--- a/services/huks_standard/huks_service/main/os_dependency/BUILD.gn
+++ b/services/huks_standard/huks_service/main/os_dependency/BUILD.gn
@@ -43,11 +43,9 @@ ohos_static_library("libhuks_service_os_dependency_standard_static") {
   ]
   public_deps = [ "//base/security/huks/services/huks_standard/huks_service/main/os_dependency/idl:libhuks_service_idl_standard_static" ]
 
-  external_deps = [
-    "hiviewdfx_hilog_native:libhilog",
-    "ipc:ipc_core",
-    "safwk:system_ability_fwk",
-    "samgr_standard:samgr_proxy",
+  deps += [
+    "//depend:libhilog",
+    "//depend/ipc:ipc_core",
   ]
   if (support_jsapi) {
     sources += [ "sa/hks_event_observer.cpp" ]
diff --git a/services/huks_standard/huks_service/main/os_dependency/idl/BUILD.gn b/services/huks_standard/huks_service/main/os_dependency/idl/BUILD.gn
index 3ffcfa1..0650b2c 100755
--- a/services/huks_standard/huks_service/main/os_dependency/idl/BUILD.gn
+++ b/services/huks_standard/huks_service/main/os_dependency/idl/BUILD.gn
@@ -43,7 +43,7 @@ ohos_static_library("libhuks_service_idl_standard_static") {
     "//base/security/huks/services/huks_standard/huks_service/main/core:libhuks_service_core_standard_static",
     "//utils/native/base:utils",
   ]
-  external_deps = [ "ipc:ipc_core" ]
+  deps += [ "//depend/ipc:ipc_core" ]
   if (support_jsapi) {
     external_deps += [
       "access_token:libaccesstoken_sdk",
diff --git a/utils/crypto_adapter/BUILD.gn b/utils/crypto_adapter/BUILD.gn
index 0ca8f61..7d28eea 100755
--- a/utils/crypto_adapter/BUILD.gn
+++ b/utils/crypto_adapter/BUILD.gn
@@ -39,9 +39,10 @@ ohos_static_library("libhuks_utils_client_service_adapter_static") {
   deps = [
     "//base/security/huks/frameworks/huks_standard/main/common:libhuks_common_standard_static",
     "//base/security/huks/frameworks/huks_standard/main/os_dependency:libhuks_os_dependency_standard_static",
-    "//third_party/openssl:libcrypto_static",
     "//utils/native/base:utils",
   ]
 
+  libs = [ "crypto" ]
+
   complete_static_lib = true
 }
-- 
2.25.1

