diff --git a/bundle.json b/bundle.json index 7e0d53f20070bf9c19c0a3e5e4d705c08ec1e3de..81e3d2e06f44c388e729f137407ba3e2c21b9b5a 100755 --- a/bundle.json +++ b/bundle.json @@ -7,7 +7,7 @@ "license":"Apache License 2.0", "publishAs":"code-segment", "segment":{ - "destPath":"foundation/distributedhardware/distributed_input/" + "destPath":"foundation/distributedhardware/distributed_input" }, "dirs":{}, "scripts":{}, @@ -36,12 +36,19 @@ "samgr", "dsoftbus", "c_utils", - "distributed_hardware_fwk" + "distributed_hardware_fwk", + "config_policy", + "hisysevent_native", + "hitrace_native", + "graphic_standard", + "window_manager" ], "third_party":[ "jsoncpp", "googletest", - "libcrypto_static" + "libcrypto_static", + "libevdev", + "openssl" ] }, "build":{ diff --git a/common/include/input_hub.cpp b/common/include/input_hub.cpp index 8d8f89a4dc0907aa01c1687b88977424df005515..2f85b25c9d0d8a096d9466dd8991a6e5c163cdba 100644 --- a/common/include/input_hub.cpp +++ b/common/include/input_hub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -28,13 +28,12 @@ #include #include -#include "anonymous_string.h" #include "constants_dinput.h" #include "dinput_context.h" #include "dinput_errcode.h" #include "dinput_log.h" -#include "dh_utils_tool.h" +#include "dinput_utils_tool.h" namespace OHOS { namespace DistributedHardware { diff --git a/common/include/test/whitelistunittest/BUILD.gn b/common/include/test/whitelistunittest/BUILD.gn index cf581984087907a18569481be300fc80e05840f6..3ec5d33e9b412f0ff974393d5006d29236d6d865 100755 --- a/common/include/test/whitelistunittest/BUILD.gn +++ b/common/include/test/whitelistunittest/BUILD.gn @@ -61,10 +61,7 @@ ohos_unittest("distributed_input_white_list_test") { "LOG_DOMAIN=0xD004100", ] - deps = [ - "${fwk_utils_path}:distributedhardwareutils", - "${utils_path}:libdinput_utils", - ] + deps = [ "${utils_path}:libdinput_utils" ] external_deps = [ "c_utils:utils", diff --git a/common/include/white_list_util.cpp b/common/include/white_list_util.cpp index 8b81788c441aa297128cf341377f62671fde7727..f44c4038981f71d7fd42da8d7c3be8f71b7ab4a9 100644 --- a/common/include/white_list_util.cpp +++ b/common/include/white_list_util.cpp @@ -20,7 +20,6 @@ #include #include -#include "anonymous_string.h" #include "config_policy_utils.h" #include "dinput_errcode.h" diff --git a/dfx_utils/BUILD.gn b/dfx_utils/BUILD.gn index bb20e18dad927bf4bedee79e7ab33acc862ec5e2..154432a220545d1dd59e3b7b5d5ca4dbfc47d4cc 100755 --- a/dfx_utils/BUILD.gn +++ b/dfx_utils/BUILD.gn @@ -42,7 +42,7 @@ ohos_shared_library("libdinput_dfx_utils") { ] deps = [ - "${fwk_utils_path}:distributedhardwareutils", + "${utils_path}:libdinput_utils", "//third_party/openssl:libcrypto_static", ] diff --git a/dfx_utils/src/hidumper.cpp b/dfx_utils/src/hidumper.cpp index a9555e76f17aa86750dc7f336534f2fa242f5cda..82a991817fcb34434855821cc64a20e59b2ca165 100644 --- a/dfx_utils/src/hidumper.cpp +++ b/dfx_utils/src/hidumper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,11 +15,10 @@ #include "hidumper.h" -#include "anonymous_string.h" - #include "dinput_errcode.h" #include "dinput_log.h" #include "dinput_softbus_define.h" +#include "dinput_utils_tool.h" namespace OHOS { namespace DistributedHardware { diff --git a/dfx_utils/src/hisysevent_util.cpp b/dfx_utils/src/hisysevent_util.cpp index f6cbafb14868910c29c74897ea4c3790f1731cbe..0604b061eac63a005518866f520c2dc9afea7fd5 100644 --- a/dfx_utils/src/hisysevent_util.cpp +++ b/dfx_utils/src/hisysevent_util.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,9 +15,9 @@ #include "hisysevent_util.h" -#include "anonymous_string.h" #include "dinput_errcode.h" #include "dinput_log.h" +#include "dinput_utils_tool.h" namespace OHOS { namespace DistributedHardware { diff --git a/dfx_utils/test/dfxtest/BUILD.gn b/dfx_utils/test/dfxtest/BUILD.gn index f35b58f0fddf6c7608fcc196caf62392ec4b999b..5e47184a1fef257d90ee99fb1eec5faeea05241f 100644 --- a/dfx_utils/test/dfxtest/BUILD.gn +++ b/dfx_utils/test/dfxtest/BUILD.gn @@ -62,7 +62,7 @@ ohos_unittest("distributed_input_dfx_test") { ] deps = [ - "${fwk_utils_path}:distributedhardwareutils", + "${utils_path}:libdinput_utils", "//third_party/openssl:libcrypto_static", ] diff --git a/inputdevicehandler/BUILD.gn b/inputdevicehandler/BUILD.gn index 16150c8ff523e384607d957fa0e1415d486c05ec..1db880acb0dfb3ce716df0bf836fdf17a37c1b71 100755 --- a/inputdevicehandler/BUILD.gn +++ b/inputdevicehandler/BUILD.gn @@ -43,7 +43,6 @@ ohos_shared_library("libdinput_handler") { ] deps = [ - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", "//third_party/openssl:libcrypto_static", diff --git a/inputdevicehandler/src/distributed_input_handler.cpp b/inputdevicehandler/src/distributed_input_handler.cpp index 412624661f7ed8252a779d73e791537f0d64ecd4..c20dc04d2a61086f722be9e8b52ae37703bbcb8f 100644 --- a/inputdevicehandler/src/distributed_input_handler.cpp +++ b/inputdevicehandler/src/distributed_input_handler.cpp @@ -28,13 +28,13 @@ #include #include -#include "anonymous_string.h" #include "nlohmann/json.hpp" #include "constants_dinput.h" #include "dinput_errcode.h" #include "dinput_log.h" #include "dinput_softbus_define.h" +#include "dinput_utils_tool.h" #include "softbus_bus_center.h" namespace OHOS { diff --git a/inputdevicehandler/test/inputhandlertest/BUILD.gn b/inputdevicehandler/test/inputhandlertest/BUILD.gn index 7fd3245d4c3af3001f47efbd394bf02346823da0..1c30d05f39a2c9fb6cedf3b30a99dcc96bddbbf0 100644 --- a/inputdevicehandler/test/inputhandlertest/BUILD.gn +++ b/inputdevicehandler/test/inputhandlertest/BUILD.gn @@ -63,7 +63,6 @@ ohos_unittest("distributed_input_handler_test") { ] deps = [ - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", "//third_party/openssl:libcrypto_static", diff --git a/interfaces/inner_kits/BUILD.gn b/interfaces/inner_kits/BUILD.gn index aca332391e7c6ba2a777f1051b5a744f303cc593..f8a5b05fde3fca86e07ea3118a34541998f2e8c9 100644 --- a/interfaces/inner_kits/BUILD.gn +++ b/interfaces/inner_kits/BUILD.gn @@ -77,7 +77,6 @@ ohos_shared_library("libdinput_sdk") { ] deps = [ - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", ] diff --git a/interfaces/inner_kits/test/unittest/BUILD.gn b/interfaces/inner_kits/test/unittest/BUILD.gn index 094fe41b0b4c01ad40574e37792ce56f2db2988f..d7efc1db4ee73ba93c4ec1006eab7df49e590eab 100644 --- a/interfaces/inner_kits/test/unittest/BUILD.gn +++ b/interfaces/inner_kits/test/unittest/BUILD.gn @@ -96,10 +96,7 @@ ohos_unittest("distributed_input_inner_test") { "LOG_DOMAIN=0xD004100", ] - deps = [ - "${fwk_utils_path}:distributedhardwareutils", - "${utils_path}:libdinput_utils", - ] + deps = [ "${utils_path}:libdinput_utils" ] external_deps = [ "c_utils:utils", diff --git a/interfaces/ipc/src/distributed_input_client.cpp b/interfaces/ipc/src/distributed_input_client.cpp index 4f7c912f706cd4ab69ebbbc283b637324ed6334b..9b09a7adae07bec6098ae1c205752a7574d83325 100644 --- a/interfaces/ipc/src/distributed_input_client.cpp +++ b/interfaces/ipc/src/distributed_input_client.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,7 +15,6 @@ #include "distributed_input_client.h" -#include "anonymous_string.h" #include "iservice_registry.h" #include "nlohmann/json.hpp" #include "system_ability_definition.h" diff --git a/interfaces/ipc/src/distributed_input_sink_proxy.cpp b/interfaces/ipc/src/distributed_input_sink_proxy.cpp index 4d4cce9eb61db5302efed66d52561b2e83e786dc..e8962deaf702b73a1943473d2edf2a9fe14e4f34 100644 --- a/interfaces/ipc/src/distributed_input_sink_proxy.cpp +++ b/interfaces/ipc/src/distributed_input_sink_proxy.cpp @@ -15,8 +15,6 @@ #include "distributed_input_sink_proxy.h" -#include "anonymous_string.h" - #include "dinput_errcode.h" #include "dinput_ipc_interface_code.h" #include "dinput_log.h" diff --git a/interfaces/ipc/src/distributed_input_sink_stub.cpp b/interfaces/ipc/src/distributed_input_sink_stub.cpp index 7dfca9610aaa447f14a0ec81e1176962a05863e2..306f6e4a1ce8fea2eb0f14da0658fe61f3d98ba6 100644 --- a/interfaces/ipc/src/distributed_input_sink_stub.cpp +++ b/interfaces/ipc/src/distributed_input_sink_stub.cpp @@ -15,12 +15,11 @@ #include "distributed_input_sink_stub.h" -#include "anonymous_string.h" - #include "constants_dinput.h" #include "dinput_errcode.h" #include "dinput_ipc_interface_code.h" #include "dinput_log.h" +#include "dinput_utils_tool.h" #include "i_sharing_dhid_listener.h" namespace OHOS { diff --git a/interfaces/ipc/test/addwhitelistinfoscallbackunittest/BUILD.gn b/interfaces/ipc/test/addwhitelistinfoscallbackunittest/BUILD.gn index 67a144f7f3857a592a8065a07f43c07a76a5df1b..45c68bcd0f68cf3d5ae22964489290dc448580a1 100644 --- a/interfaces/ipc/test/addwhitelistinfoscallbackunittest/BUILD.gn +++ b/interfaces/ipc/test/addwhitelistinfoscallbackunittest/BUILD.gn @@ -90,13 +90,12 @@ ohos_unittest("add_white_list_infos_callbackl_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", ] external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "ipc:ipc_core", diff --git a/interfaces/ipc/test/clientunittest/BUILD.gn b/interfaces/ipc/test/clientunittest/BUILD.gn index 5c54f44bc3147494f6ea2daf3eb0d7795380c6e8..9b16674a96d5dfa4e0e27b094d99499f36a11df5 100644 --- a/interfaces/ipc/test/clientunittest/BUILD.gn +++ b/interfaces/ipc/test/clientunittest/BUILD.gn @@ -108,8 +108,6 @@ ohos_unittest("distributed_input_client_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${services_sink_path}/sinkmanager:libdinput_sink", "${services_source_path}/inputinject:libdinput_inject", "${services_source_path}/sourcemanager:libdinput_source", @@ -120,6 +118,7 @@ ohos_unittest("distributed_input_client_test") { external_deps = [ "c_utils:utils", "config_policy:configpolicy_util", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "graphic_standard:surface", diff --git a/interfaces/ipc/test/delwhitelistinfoscallbackunittest/BUILD.gn b/interfaces/ipc/test/delwhitelistinfoscallbackunittest/BUILD.gn index 2c8d80337fbbaf286d43523ca976d6d99a4ba168..8d748b0819ecc69fa530a2a495ac5a2094ad0726 100644 --- a/interfaces/ipc/test/delwhitelistinfoscallbackunittest/BUILD.gn +++ b/interfaces/ipc/test/delwhitelistinfoscallbackunittest/BUILD.gn @@ -66,13 +66,12 @@ ohos_unittest("del_white_list_infos_callbackl_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", ] external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "ipc:ipc_core", diff --git a/interfaces/ipc/test/dinputsourcecallbackunittest/BUILD.gn b/interfaces/ipc/test/dinputsourcecallbackunittest/BUILD.gn index 8c85b496a7555891884ab7ad94cb0f9d8f0c589f..b063b3be88731a428579f32e89d1d7f257ad4c67 100644 --- a/interfaces/ipc/test/dinputsourcecallbackunittest/BUILD.gn +++ b/interfaces/ipc/test/dinputsourcecallbackunittest/BUILD.gn @@ -90,13 +90,12 @@ ohos_unittest("dinput_source_callback_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", ] external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "ipc:ipc_core", diff --git a/interfaces/ipc/test/ipcunittest/BUILD.gn b/interfaces/ipc/test/ipcunittest/BUILD.gn index 7574038a0d651c4c72aa184dc0c1927b4eb19637..98cec895502eaee4a63ebd689ae749f04df2cf9e 100644 --- a/interfaces/ipc/test/ipcunittest/BUILD.gn +++ b/interfaces/ipc/test/ipcunittest/BUILD.gn @@ -100,14 +100,13 @@ ohos_unittest("distributed_input_ipc_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", ] external_deps = [ "c_utils:utils", "config_policy:configpolicy_util", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "ipc:ipc_core", diff --git a/interfaces/ipc/test/unpreparedinputcallbackunittest/BUILD.gn b/interfaces/ipc/test/unpreparedinputcallbackunittest/BUILD.gn index 5bd989940a6e7fe900e1ce2c4b2f69fbc8aabf2f..d127cb9785f40e0123d9c8f38846fb4f0c8c8931 100644 --- a/interfaces/ipc/test/unpreparedinputcallbackunittest/BUILD.gn +++ b/interfaces/ipc/test/unpreparedinputcallbackunittest/BUILD.gn @@ -66,13 +66,12 @@ ohos_unittest("unprepare_d_input_call_back_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", ] external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "ipc:ipc_core", diff --git a/interfaces/ipc/test/unregisterdinputcallbackunittest/BUILD.gn b/interfaces/ipc/test/unregisterdinputcallbackunittest/BUILD.gn index 287f8d8ce2b5a91dfb4071b437d2a28180e93154..80d707690ba9a57c70c5e04496c078e2967ea550 100644 --- a/interfaces/ipc/test/unregisterdinputcallbackunittest/BUILD.gn +++ b/interfaces/ipc/test/unregisterdinputcallbackunittest/BUILD.gn @@ -66,13 +66,12 @@ ohos_unittest("unregister_d_input_call_back_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", ] external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "ipc:ipc_core", diff --git a/services/sink/inputcollector/BUILD.gn b/services/sink/inputcollector/BUILD.gn index cc14b4b0220a323142e5a7c549f1206c1376d89d..dfbadab200a6a335d912cc8b17eccbbc9535f09f 100755 --- a/services/sink/inputcollector/BUILD.gn +++ b/services/sink/inputcollector/BUILD.gn @@ -42,11 +42,9 @@ ohos_shared_library("libdinput_collector") { ] deps = [ - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", "//third_party/openssl:libcrypto_static", - "//third_party/openssl:libcrypto_static", ] external_deps = [ diff --git a/services/sink/inputcollector/src/distributed_input_collector.cpp b/services/sink/inputcollector/src/distributed_input_collector.cpp index 31c72d7b5d00beb32a448de9a13b4a03d5910517..0f664f4d9b6d1ae3b95205c99a89b4c44627c858 100644 --- a/services/sink/inputcollector/src/distributed_input_collector.cpp +++ b/services/sink/inputcollector/src/distributed_input_collector.cpp @@ -27,11 +27,11 @@ #include #include -#include "anonymous_string.h" #include "nlohmann/json.hpp" #include "dinput_errcode.h" #include "dinput_log.h" +#include "dinput_utils_tool.h" namespace OHOS { namespace DistributedHardware { diff --git a/services/sink/inputcollector/test/sinkcollectorunittest/BUILD.gn b/services/sink/inputcollector/test/sinkcollectorunittest/BUILD.gn index ed77bd31a8d68701a0cffe3c8f689bb03adab866..3325325d9304de47f7ef11f0b4c9a828749cdaa2 100644 --- a/services/sink/inputcollector/test/sinkcollectorunittest/BUILD.gn +++ b/services/sink/inputcollector/test/sinkcollectorunittest/BUILD.gn @@ -62,7 +62,6 @@ ohos_unittest("distributed_input_inner_sinkcollector_test") { ] deps = [ - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", "//third_party/openssl:libcrypto_static", diff --git a/services/sink/sinkmanager/BUILD.gn b/services/sink/sinkmanager/BUILD.gn index be58a5f92d7e0f179027449cbeb7b9d58a1d4da9..2f4b1fec313881b08f7848b747f347d9357a22ec 100644 --- a/services/sink/sinkmanager/BUILD.gn +++ b/services/sink/sinkmanager/BUILD.gn @@ -53,8 +53,6 @@ ohos_shared_library("libdinput_sink") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}:libdinput_sdk", "${services_sink_path}/inputcollector:libdinput_collector", "${services_sink_path}/transport:libdinput_sink_trans", @@ -65,6 +63,7 @@ ohos_shared_library("libdinput_sink") { external_deps = [ "c_utils:utils", "config_policy:configpolicy_util", + "distributed_hardware_fwk:libdhfwk_sdk", "eventhandler:libeventhandler", "graphic_standard:surface", "hisysevent_native:libhisysevent", diff --git a/services/sink/sinkmanager/src/distributed_input_sink_manager.cpp b/services/sink/sinkmanager/src/distributed_input_sink_manager.cpp index fdba0852dee980d25eaf3753715e925d7a2d5085..60466c797d5fa19a2a1a29546d7d5baaccf36f36 100644 --- a/services/sink/sinkmanager/src/distributed_input_sink_manager.cpp +++ b/services/sink/sinkmanager/src/distributed_input_sink_manager.cpp @@ -21,7 +21,6 @@ #include #include -#include "anonymous_string.h" #include "dinput_softbus_define.h" #include "distributed_hardware_fwk_kit.h" #include "if_system_ability_manager.h" diff --git a/services/sink/sinkmanager/test/sinkmanagerunittest/BUILD.gn b/services/sink/sinkmanager/test/sinkmanagerunittest/BUILD.gn index f031feb54772ff7629a69f9bbb9fc1c444c3418f..a89e8473dac1afc802baffc8ee4355ee4e93a5c8 100755 --- a/services/sink/sinkmanager/test/sinkmanagerunittest/BUILD.gn +++ b/services/sink/sinkmanager/test/sinkmanagerunittest/BUILD.gn @@ -86,8 +86,6 @@ ohos_unittest("distributed_input_sinkmanager_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", "${distributedinput_path}/services/transportbase:libdinput_trans_base", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${services_sink_path}/transport:libdinput_sink_trans", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", @@ -100,6 +98,7 @@ ohos_unittest("distributed_input_sinkmanager_test") { "access_token:libtoken_setproc", "c_utils:utils", "config_policy:configpolicy_util", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "graphic_standard:surface", diff --git a/services/sink/transport/BUILD.gn b/services/sink/transport/BUILD.gn index a4152585ab20f22a38f37237fae3b82ff3efd1e2..7eeaa14a4460f85f68c0c7b90026393f7a4fad2f 100644 --- a/services/sink/transport/BUILD.gn +++ b/services/sink/transport/BUILD.gn @@ -48,14 +48,13 @@ ohos_shared_library("libdinput_sink_trans") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", "${distributedinput_path}/services/transportbase:libdinput_trans_base", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", ] external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "hitrace_native:hitrace_meter", diff --git a/services/sink/transport/src/distributed_input_sink_switch.cpp b/services/sink/transport/src/distributed_input_sink_switch.cpp index c19923047237d4c9ea0abf1475e8f37c0f935d81..b1b654c9ed756a7aa08a824d67bf294e67e972ec 100644 --- a/services/sink/transport/src/distributed_input_sink_switch.cpp +++ b/services/sink/transport/src/distributed_input_sink_switch.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,11 +15,10 @@ #include "distributed_input_sink_switch.h" -#include "anonymous_string.h" - #include "constants_dinput.h" #include "dinput_errcode.h" #include "dinput_log.h" +#include "dinput_utils_tool.h" namespace OHOS { namespace DistributedHardware { diff --git a/services/sink/transport/src/distributed_input_sink_transport.cpp b/services/sink/transport/src/distributed_input_sink_transport.cpp index 0cce5f2f397491c9e15ee60f9f4dfdadf8c38d73..bbe6ffb09e4d8285ed46b0fde478cba8ba2a985d 100644 --- a/services/sink/transport/src/distributed_input_sink_transport.cpp +++ b/services/sink/transport/src/distributed_input_sink_transport.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -19,7 +19,6 @@ #include "linux/input.h" -#include "anonymous_string.h" #include "distributed_hardware_fwk_kit.h" #include "securec.h" diff --git a/services/sink/transport/test/sinktransunittest/BUILD.gn b/services/sink/transport/test/sinktransunittest/BUILD.gn index 7508c6c1e771b062aca291ed232ac71ab72a7faa..0d525594dd8015d0002ab559538407229f64aa62 100755 --- a/services/sink/transport/test/sinktransunittest/BUILD.gn +++ b/services/sink/transport/test/sinktransunittest/BUILD.gn @@ -80,8 +80,6 @@ ohos_unittest("distributed_input_sinktrans_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${services_sink_path}/inputcollector:libdinput_collector", "${services_sink_path}/sinkmanager:libdinput_sink", "${utils_path}:libdinput_utils", @@ -90,6 +88,7 @@ ohos_unittest("distributed_input_sinktrans_test") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "eventhandler:libeventhandler", "graphic_standard:surface", "hisysevent_native:libhisysevent", diff --git a/services/source/inputinject/BUILD.gn b/services/source/inputinject/BUILD.gn index b874d458c556901c2d01a9612e8c1d5eabf1a428..c5b0df2ea435bf740d5e15b18e4ea32c8932f146 100644 --- a/services/source/inputinject/BUILD.gn +++ b/services/source/inputinject/BUILD.gn @@ -48,7 +48,6 @@ ohos_shared_library("libdinput_inject") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", "//third_party/openssl:libcrypto_static", diff --git a/services/source/inputinject/src/distributed_input_inject.cpp b/services/source/inputinject/src/distributed_input_inject.cpp index bea0f0cdae4c5b6cf6d249a6986333cc59ef8053..323265df66bb9c62b43e30ef1cc3a93f05596ad1 100644 --- a/services/source/inputinject/src/distributed_input_inject.cpp +++ b/services/source/inputinject/src/distributed_input_inject.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -17,7 +17,6 @@ #include -#include "anonymous_string.h" #include "dh_utils_tool.h" #include "nlohmann/json.hpp" diff --git a/services/source/inputinject/src/distributed_input_node_manager.cpp b/services/source/inputinject/src/distributed_input_node_manager.cpp index 55b9559d62d081f454723a453364beddd445fd91..6c4838bc01bd14c09c4fee7c1c3f4ce0e21f3be7 100644 --- a/services/source/inputinject/src/distributed_input_node_manager.cpp +++ b/services/source/inputinject/src/distributed_input_node_manager.cpp @@ -22,7 +22,6 @@ #include #include -#include "anonymous_string.h" #include "softbus_bus_center.h" #include "dinput_context.h" diff --git a/services/source/inputinject/src/virtual_device.cpp b/services/source/inputinject/src/virtual_device.cpp index fd1d0212efaf1fc4ce7a18a706ee1af91a217ba6..232bfeb01e2b36f728aaeeb2400cf46673251f68 100644 --- a/services/source/inputinject/src/virtual_device.cpp +++ b/services/source/inputinject/src/virtual_device.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -17,11 +17,10 @@ #include -#include "anonymous_string.h" - #include "constants_dinput.h" #include "dinput_log.h" #include "hidumper.h" +#include "dinput_utils_tool.h" namespace OHOS { namespace DistributedHardware { diff --git a/services/source/inputinject/test/sourceinjectunittest/BUILD.gn b/services/source/inputinject/test/sourceinjectunittest/BUILD.gn index 5b20676fae7ffeca08480526cdcec369a8c8061b..a07d32bfca1ab3f3c9abeca924a59abe20d4f926 100755 --- a/services/source/inputinject/test/sourceinjectunittest/BUILD.gn +++ b/services/source/inputinject/test/sourceinjectunittest/BUILD.gn @@ -74,7 +74,6 @@ ohos_unittest("distributed_input_inner_sourceinject_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}:libdinput_sdk", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", diff --git a/services/source/sourcemanager/BUILD.gn b/services/source/sourcemanager/BUILD.gn index 48394f5900e90cfac4ff2dba26bdc76161443283..8b88b244b557546a2fde902415c1ef74a1e4138a 100644 --- a/services/source/sourcemanager/BUILD.gn +++ b/services/source/sourcemanager/BUILD.gn @@ -88,8 +88,6 @@ ohos_shared_library("libdinput_source") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}:libdinput_sdk", "${services_source_path}/inputinject:libdinput_inject", "${services_source_path}/transport:libdinput_source_trans", @@ -100,6 +98,7 @@ ohos_shared_library("libdinput_source") { external_deps = [ "c_utils:utils", "config_policy:configpolicy_util", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "hisysevent_native:libhisysevent", diff --git a/services/source/sourcemanager/src/distributed_input_source_manager.cpp b/services/source/sourcemanager/src/distributed_input_source_manager.cpp index 2bca502913c33e5eb9cbca0e50759fd8ccfcb771..39a78ef6d2ecf36550b166cf868d5700c6817319 100644 --- a/services/source/sourcemanager/src/distributed_input_source_manager.cpp +++ b/services/source/sourcemanager/src/distributed_input_source_manager.cpp @@ -20,7 +20,6 @@ #include #include -#include "anonymous_string.h" #include "dinput_softbus_define.h" #include "if_system_ability_manager.h" #include "iservice_registry.h" diff --git a/services/source/sourcemanager/src/distributed_input_source_sa_cli_mgr.cpp b/services/source/sourcemanager/src/distributed_input_source_sa_cli_mgr.cpp index ea2b9b6e9addb8eb9348611f08ba46da206b1518..118c19b99584c2bef085f361943233a7279f43db 100644 --- a/services/source/sourcemanager/src/distributed_input_source_sa_cli_mgr.cpp +++ b/services/source/sourcemanager/src/distributed_input_source_sa_cli_mgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -19,9 +19,8 @@ #include "iservice_registry.h" #include "system_ability_definition.h" -#include "anonymous_string.h" - #include "dinput_log.h" +#include "dinput_utils_tool.h" namespace OHOS { namespace DistributedHardware { diff --git a/services/source/sourcemanager/test/sourcemanagerunittest/BUILD.gn b/services/source/sourcemanager/test/sourcemanagerunittest/BUILD.gn index bf60260b814946d2529a763215cfb0c61ce9ca44..c58f5586237e8881e4486bc867a99dcdb52545dd 100755 --- a/services/source/sourcemanager/test/sourcemanagerunittest/BUILD.gn +++ b/services/source/sourcemanager/test/sourcemanagerunittest/BUILD.gn @@ -110,8 +110,6 @@ ohos_unittest("distributed_input_sourcemanager_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}:libdinput_sdk", "${services_source_path}/transport:libdinput_source_trans", "//third_party/libevdev:libevdev", @@ -123,6 +121,7 @@ ohos_unittest("distributed_input_sourcemanager_test") { "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "eventhandler:libeventhandler", "hisysevent_native:libhisysevent", "hitrace_native:hitrace_meter", diff --git a/services/source/transport/BUILD.gn b/services/source/transport/BUILD.gn index 8e4e56aa3b7e66a88c69d544c213ddc8591f101e..964daa31de21a03bc33812da9d52c947e0801f35 100755 --- a/services/source/transport/BUILD.gn +++ b/services/source/transport/BUILD.gn @@ -45,8 +45,6 @@ ohos_shared_library("libdinput_source_trans") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", "${distributedinput_path}/services/transportbase:libdinput_trans_base", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${services_source_path}/inputinject:libdinput_inject", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", @@ -54,6 +52,7 @@ ohos_shared_library("libdinput_source_trans") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "eventhandler:libeventhandler", "hitrace_native:hitrace_meter", "samgr:samgr_proxy", diff --git a/services/source/transport/src/distributed_input_source_transport.cpp b/services/source/transport/src/distributed_input_source_transport.cpp index eed4934e053a3c1ee49217625dd6e4b81482d0d7..841b8cb370325d493edb2084ead5e525739a666d 100644 --- a/services/source/transport/src/distributed_input_source_transport.cpp +++ b/services/source/transport/src/distributed_input_source_transport.cpp @@ -19,7 +19,6 @@ #include #include -#include "anonymous_string.h" #include "distributed_hardware_fwk_kit.h" #include "ipc_skeleton.h" #include "iservice_registry.h" diff --git a/services/source/transport/test/sourcetransunittest/BUILD.gn b/services/source/transport/test/sourcetransunittest/BUILD.gn index 403547e6cb9374c920c4577c335c5f33abb9d89c..0559dcfe80decd3e3de8ee420304924760c9f7ca 100755 --- a/services/source/transport/test/sourcetransunittest/BUILD.gn +++ b/services/source/transport/test/sourcetransunittest/BUILD.gn @@ -77,8 +77,6 @@ ohos_unittest("distributed_input_sourcetrans_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${services_source_path}/inputinject:libdinput_inject", "${services_source_path}/sourcemanager:libdinput_source", "${utils_path}:libdinput_utils", @@ -87,6 +85,7 @@ ohos_unittest("distributed_input_sourcetrans_test") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "eventhandler:libeventhandler", "hitrace_native:hitrace_meter", ] diff --git a/services/transportbase/BUILD.gn b/services/transportbase/BUILD.gn index 8dbeea476046718668147e78b15e60f69cec0a6c..55a37813be0c5316c9f4d9eafb110d9b4ab9f1aa 100644 --- a/services/transportbase/BUILD.gn +++ b/services/transportbase/BUILD.gn @@ -45,8 +45,6 @@ ohos_shared_library("libdinput_trans_base") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${services_source_path}/inputinject:libdinput_inject", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", @@ -54,6 +52,7 @@ ohos_shared_library("libdinput_trans_base") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "hitrace_native:hitrace_meter", diff --git a/services/transportbase/src/distributed_input_transport_base.cpp b/services/transportbase/src/distributed_input_transport_base.cpp index e39b2ff479081c558748a0a78a4bba371ddcbbc4..f667a55dbabb02c235c923d0039a43831c218e3c 100644 --- a/services/transportbase/src/distributed_input_transport_base.cpp +++ b/services/transportbase/src/distributed_input_transport_base.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -18,7 +18,6 @@ #include #include -#include "anonymous_string.h" #include "distributed_hardware_fwk_kit.h" #include "ipc_skeleton.h" #include "iservice_registry.h" diff --git a/services/transportbase/test/transbaseunittest/BUILD.gn b/services/transportbase/test/transbaseunittest/BUILD.gn index e59e1e0838264e8bc4914ea8caa17ee91984e5b0..f2e57d2434815cd363e36f6dab9a9aa71ca8a592 100644 --- a/services/transportbase/test/transbaseunittest/BUILD.gn +++ b/services/transportbase/test/transbaseunittest/BUILD.gn @@ -74,8 +74,6 @@ ohos_unittest("distributed_input_transbase_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${services_source_path}/inputinject:libdinput_inject", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", @@ -83,6 +81,7 @@ ohos_unittest("distributed_input_transbase_test") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "eventhandler:libeventhandler", "hitrace_native:hitrace_meter", ] diff --git a/sinkhandler/BUILD.gn b/sinkhandler/BUILD.gn index 4398b17e8cdbf48cdd7692a345039390d198860b..71fb58cd3ed03fc8ce12a4e247e04b137b64df93 100644 --- a/sinkhandler/BUILD.gn +++ b/sinkhandler/BUILD.gn @@ -49,8 +49,8 @@ ohos_shared_library("libdinput_sink_handler") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}:libdinput_sdk", + "${utils_path}:libdinput_utils", ] external_deps = [ diff --git a/sinkhandler/test/unittest/BUILD.gn b/sinkhandler/test/unittest/BUILD.gn index 3de701744d94743ad070396bb5ff1860e59f7d98..8f1ece9baa158097f8e6804e8fac0cc23d04d0ae 100755 --- a/sinkhandler/test/unittest/BUILD.gn +++ b/sinkhandler/test/unittest/BUILD.gn @@ -72,8 +72,8 @@ ohos_unittest("distributed_input_sink_handler_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}:libdinput_sdk", + "${utils_path}:libdinput_utils", ] external_deps = [ diff --git a/sourcehandler/BUILD.gn b/sourcehandler/BUILD.gn index 883c692ca2c56d2ab3e60ad89b8cc800e6a8ce3a..1194bac3cc9c78fdbe963601c226f12597f5d88c 100644 --- a/sourcehandler/BUILD.gn +++ b/sourcehandler/BUILD.gn @@ -50,8 +50,8 @@ ohos_shared_library("libdinput_source_handler") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}:libdinput_sdk", + "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", ] diff --git a/sourcehandler/test/unittest/BUILD.gn b/sourcehandler/test/unittest/BUILD.gn index c37b072c7c82c92de2c074e3cfe9be246879c979..9defe8ecbe98a48b29ac7015027b72a02b52d55c 100755 --- a/sourcehandler/test/unittest/BUILD.gn +++ b/sourcehandler/test/unittest/BUILD.gn @@ -72,8 +72,8 @@ ohos_unittest("distributed_input_source_handler_test") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}:libdinput_sdk", + "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", ] diff --git a/test/fuzztest/distributedinputsinktransport_fuzzer/BUILD.gn b/test/fuzztest/distributedinputsinktransport_fuzzer/BUILD.gn index 40f6d40dbc64a9afa88d708d71d3426c9f8dfd52..997a006e026938e334b98c491a4ac7bc4f113d54 100755 --- a/test/fuzztest/distributedinputsinktransport_fuzzer/BUILD.gn +++ b/test/fuzztest/distributedinputsinktransport_fuzzer/BUILD.gn @@ -54,14 +54,13 @@ ohos_fuzztest("DistributedInputSinkTransportFuzzTest") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", "${distributedinput_path}/services/transportbase:libdinput_trans_base", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", ] external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "ipc:ipc_core", diff --git a/test/fuzztest/distributedinputsourcetransport_fuzzer/BUILD.gn b/test/fuzztest/distributedinputsourcetransport_fuzzer/BUILD.gn index d9ef3ac3e986766d7a9b95a0d8cd12ef9fcd6dd7..8921013ba18e68499bc72ed4375a0fc381c5bfa5 100755 --- a/test/fuzztest/distributedinputsourcetransport_fuzzer/BUILD.gn +++ b/test/fuzztest/distributedinputsourcetransport_fuzzer/BUILD.gn @@ -57,8 +57,6 @@ ohos_fuzztest("DistributedInputSourceTransportFuzzTest") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", "${distributedinput_path}/services/transportbase:libdinput_trans_base", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${services_source_path}/inputinject:libdinput_inject", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", @@ -66,6 +64,7 @@ ohos_fuzztest("DistributedInputSourceTransportFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "hitrace_native:hitrace_meter", diff --git a/test/fuzztest/distributedinputtransportbase_fuzzer/BUILD.gn b/test/fuzztest/distributedinputtransportbase_fuzzer/BUILD.gn index 025cdf98f604cdec7552e9e926f464056fbed20e..e4c754fb2b9ab9051a076962cfa89940e4a3cec1 100644 --- a/test/fuzztest/distributedinputtransportbase_fuzzer/BUILD.gn +++ b/test/fuzztest/distributedinputtransportbase_fuzzer/BUILD.gn @@ -57,8 +57,6 @@ ohos_fuzztest("DistributedInputTransportBaseFuzzTest") { deps = [ "${dfx_utils_path}:libdinput_dfx_utils", "${distributedinput_path}/services/transportbase:libdinput_trans_base", - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", "${services_source_path}/inputinject:libdinput_inject", "${utils_path}:libdinput_utils", "//third_party/libevdev:libevdev", @@ -66,6 +64,7 @@ ohos_fuzztest("DistributedInputTransportBaseFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "eventhandler:libeventhandler", "hitrace_native:hitrace_meter", diff --git a/utils/BUILD.gn b/utils/BUILD.gn index 7f471fe8160cada42de6286d95ff6b18c51fb270..e37b53c1c5246a255bc53d013f06f9b4e4489490 100644 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -44,14 +44,11 @@ ohos_shared_library("libdinput_utils") { "LOG_DOMAIN=0xD004100", ] - deps = [ - "${fwk_interfaces_path}:libdhfwk_sdk", - "${fwk_utils_path}:distributedhardwareutils", - "//third_party/openssl:libcrypto_static", - ] + deps = [ "//third_party/openssl:libcrypto_static" ] external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "dsoftbus:softbus_client", "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", diff --git a/utils/include/dinput_utils_tool.h b/utils/include/dinput_utils_tool.h index eb5ea708ce685c5344a3f6fb7bed316408ce69c0..dba9054c0e6fe5963acef26975f9b950399fc5fd 100644 --- a/utils/include/dinput_utils_tool.h +++ b/utils/include/dinput_utils_tool.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -47,6 +47,9 @@ bool IsUInt32(const nlohmann::json& jsonObj, const std::string& key); bool IsUInt64(const nlohmann::json& jsonObj, const std::string& key); bool IsArray(const nlohmann::json& jsonObj, const std::string& key); std::string GetNodeDesc(std::string parameters); +std::string GetAnonyString(const std::string &value); +std::string GetAnonyInt32(const int32_t value); +std::string Sha256(const std::string& string); } // namespace DistributedInput } // namespace DistributedHardware } // namespace OHOS diff --git a/utils/src/dinput_context.cpp b/utils/src/dinput_context.cpp index 22bf0d58e7fe3241a5aae2672a8566ff8d3371b3..2635d97f040d73733eef684f99dc9dddf5be74e6 100644 --- a/utils/src/dinput_context.cpp +++ b/utils/src/dinput_context.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,10 +15,10 @@ #include "dinput_context.h" -#include "anonymous_string.h" #include "constants.h" #include "dinput_errcode.h" +#include "dinput_utils_tool.h" namespace OHOS { namespace DistributedHardware { diff --git a/utils/src/dinput_utils_tool.cpp b/utils/src/dinput_utils_tool.cpp index 4121ec842e49d87d94d75d691c156efbafa708e1..b3888817a83366ac64fc57c67515e6b45b02b40a 100644 --- a/utils/src/dinput_utils_tool.cpp +++ b/utils/src/dinput_utils_tool.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,8 +21,8 @@ #include -#include "anonymous_string.h" #include "nlohmann/json.hpp" +#include "securec.h" #ifndef COMPILE_TEST_MODE #include "softbus_bus_center.h" @@ -214,6 +214,74 @@ std::string GetNodeDesc(std::string parameters) return "{ nodeName: " + nodeName + ", physicalPath: " + physicalPath + ", classes: " + std::to_string(classes) + " }"; } + +std::string GetAnonyString(const std::string &value) +{ + constexpr size_t INT32_SHORT_ID_LENGTH = 20; + constexpr size_t INT32_PLAINTEXT_LENGTH = 4; + constexpr size_t INT32_MIN_ID_LENGTH = 3; + std::string res; + std::string tmpStr("******"); + size_t strLen = value.length(); + if (strLen < INT32_MIN_ID_LENGTH) { + return tmpStr; + } + + if (strLen <= INT32_SHORT_ID_LENGTH) { + res += value[0]; + res += tmpStr; + res += value[strLen - 1]; + } else { + res.append(value, 0, INT32_PLAINTEXT_LENGTH); + res += tmpStr; + res.append(value, strLen - INT32_PLAINTEXT_LENGTH, INT32_PLAINTEXT_LENGTH); + } + + return res; +} + +std::string GetAnonyInt32(const int32_t value) +{ + constexpr int32_t INT32_STRING_LENGTH = 40; + char tempBuffer[INT32_STRING_LENGTH] = ""; + int32_t secRet = sprintf_s(tempBuffer, INT32_STRING_LENGTH, "%d", value); + if (secRet <= 0) { + std::string nullString(""); + return nullString; + } + size_t length = strlen(tempBuffer); + for (size_t i = 1; i <= length - 1; i++) { + tempBuffer[i] = '*'; + } + if (length == 0x01) { + tempBuffer[0] = '*'; + } + + std::string tempString(tempBuffer); + return tempString; +} + +std::string Sha256(const std::string& in) +{ + unsigned char out[SHA256_DIGEST_LENGTH * 2 + 1] = {0}; + SHA256_CTX ctx; + SHA256_Init(&ctx); + SHA256_Update(&ctx, in.data(), in.size()); + SHA256_Final(&out[SHA256_DIGEST_LENGTH], &ctx); + // here we translate sha256 hash to hexadecimal. each 8-bit char will be presented by two characters([0-9a-f]) + constexpr int32_t WIDTH = 4; + constexpr unsigned char MASK = 0x0F; + const char* hexCode = "0123456789abcdef"; + constexpr int32_t DOUBLE_TIMES = 2; + for (int32_t i = 0; i < SHA256_DIGEST_LENGTH; ++i) { + unsigned char value = out[SHA256_DIGEST_LENGTH + i]; + // uint8_t is 2 digits in hexadecimal. + out[i * DOUBLE_TIMES] = hexCode[(value >> WIDTH) & MASK]; + out[i * DOUBLE_TIMES + 1] = hexCode[value & MASK]; + } + out[SHA256_DIGEST_LENGTH * DOUBLE_TIMES] = 0; + return reinterpret_cast(out); +} } // namespace DistributedInput } // namespace DistributedHardware } // namespace OHOS \ No newline at end of file diff --git a/utils/test/unittest/BUILD.gn b/utils/test/unittest/BUILD.gn index eba48ae6a43bdec488c816f28db58c65069946d5..4077590c3d11692613a70ed0f36ee1bdcfe223c3 100644 --- a/utils/test/unittest/BUILD.gn +++ b/utils/test/unittest/BUILD.gn @@ -67,12 +67,13 @@ ohos_unittest("distributed_input_utils_test") { ] deps = [ - "${fwk_utils_path}:distributedhardwareutils", + "${utils_path}:libdinput_utils", "//third_party/openssl:libcrypto_static", ] external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:libdhfwk_sdk", "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core",