From b1569b789eef12cf5d4252620ca7e7d2d9c8b93a Mon Sep 17 00:00:00 2001 From: panlili2024 <14743743+panlili2024@user.noreply.gitee.com> Date: 星期四, 14 十一月 2024 14:26:03 +0800 Subject: [PATCH] sdk重连优化 --- HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/protocol/LinkMessageDecoder.java | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/protocol/LinkMessageDecoder.java b/HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/protocol/LinkMessageDecoder.java index 243d81e..1cf5c5c 100644 --- a/HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/protocol/LinkMessageDecoder.java +++ b/HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/protocol/LinkMessageDecoder.java @@ -314,13 +314,15 @@ if (encrypt(body)) { //闇�瑕佽В瀵� - byte[] bodyBytes = AesUtil.aesDecrypt(body, HDLLinkConfig.getInstance().getLocalSecret()); - if (bodyBytes != null) { - response.setData(new String(bodyBytes, StandardCharsets.UTF_8)); - } else { - LogUtils.e("瑙e瘑澶辫触\r\n" + topic); - response.setData(new String(body, "utf-8")); - continue; + if (!TextUtils.isEmpty(HDLLinkConfig.getInstance().getLocalSecret())) { + byte[] bodyBytes = AesUtil.aesDecrypt(body, HDLLinkConfig.getInstance().getLocalSecret()); + if (bodyBytes != null) { + response.setData(new String(bodyBytes, StandardCharsets.UTF_8)); + } else { + LogUtils.e("瑙e瘑澶辫触\r\n" + topic); + response.setData(new String(body, "utf-8")); + continue; + } } } else { response.setData(new String(body, "utf-8")); -- Gitblit v1.8.0