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:
parent
ed3ce6fa9d
commit
eb7366c7e3
@ -106,7 +106,6 @@ public class Huami2021ChunkedDecoder {
|
|||||||
try {
|
try {
|
||||||
buf = CryptoUtils.decryptAES(buf, messagekey);
|
buf = CryptoUtils.decryptAES(buf, messagekey);
|
||||||
buf = ArrayUtils.subarray(buf, 0, currentLength);
|
buf = ArrayUtils.subarray(buf, 0, currentLength);
|
||||||
LOG.debug("decrypted data {}: {}", String.format("0x%04x", currentType), GB.hexdump(buf));
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.warn("error decrypting " + e);
|
LOG.warn("error decrypting " + e);
|
||||||
currentHandle = null;
|
currentHandle = null;
|
||||||
@ -114,6 +113,13 @@ public class Huami2021ChunkedDecoder {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LOG.debug(
|
||||||
|
"{} data {}: {}",
|
||||||
|
encrypted ? "Decrypted" : "Plaintext",
|
||||||
|
String.format("0x%04x", currentType),
|
||||||
|
GB.hexdump(buf)
|
||||||
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
huami2021Handler.handle2021Payload((short) currentType, buf);
|
huami2021Handler.handle2021Payload((short) currentType, buf);
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
|
@ -1195,8 +1195,6 @@ public abstract class Huami2021Support extends HuamiSupport {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.debug("Got 2021 payload for {}: {}", String.format("0x%04x", type), GB.hexdump(payload));
|
|
||||||
|
|
||||||
if (mServiceMap.containsKey(type)) {
|
if (mServiceMap.containsKey(type)) {
|
||||||
mServiceMap.get(type).handlePayload(payload);
|
mServiceMap.get(type).handlePayload(payload);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user