hxb
2024-08-20 0a8fd4aa92555875f58f67144c2c0c0a20a200af
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("解密失败\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("解密失败\r\n" + topic);
                            response.setData(new String(body, "utf-8"));
                            continue;
                        }
                    }
                } else {
                    response.setData(new String(body, "utf-8"));