1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-29 13:26:50 +01:00

Huami 2021: Prevent duplicated payload logging

This commit is contained in:
José Rebelo 2023-06-03 20:25:23 +01:00
parent ed3ce6fa9d
commit eb7366c7e3
2 changed files with 7 additions and 3 deletions

View File

@ -106,7 +106,6 @@ public class Huami2021ChunkedDecoder {
try {
buf = CryptoUtils.decryptAES(buf, messagekey);
buf = ArrayUtils.subarray(buf, 0, currentLength);
LOG.debug("decrypted data {}: {}", String.format("0x%04x", currentType), GB.hexdump(buf));
} catch (Exception e) {
LOG.warn("error decrypting " + e);
currentHandle = null;
@ -114,6 +113,13 @@ public class Huami2021ChunkedDecoder {
return;
}
}
LOG.debug(
"{} data {}: {}",
encrypted ? "Decrypted" : "Plaintext",
String.format("0x%04x", currentType),
GB.hexdump(buf)
);
try {
huami2021Handler.handle2021Payload((short) currentType, buf);
} catch (final Exception e) {

View File

@ -1195,8 +1195,6 @@ public abstract class Huami2021Support extends HuamiSupport {
return;
}
LOG.debug("Got 2021 payload for {}: {}", String.format("0x%04x", type), GB.hexdump(payload));
if (mServiceMap.containsKey(type)) {
mServiceMap.get(type).handlePayload(payload);
return;