| | |
| | |
|
| | | 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"));
|