mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-06-19 11:30:44 +02:00
Mi Band 8: Fix chunked encryption
This commit is contained in:
parent
544909a970
commit
b5a1846e49
|
@ -244,12 +244,13 @@ public class XiaomiCharacteristic {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldWriteChunked(currentSending)) {
|
if (shouldWriteChunked(currentSending)) {
|
||||||
|
// Prepend encrypted index
|
||||||
|
currentSending = ByteBuffer.allocate(2 + currentSending.length).order(ByteOrder.LITTLE_ENDIAN)
|
||||||
|
.putShort(encryptedIndex++)
|
||||||
|
.put(currentSending)
|
||||||
|
.array();
|
||||||
|
|
||||||
LOG.debug("Sending next - chunked");
|
LOG.debug("Sending next - chunked");
|
||||||
// FIXME this is not efficient - re-encrypt with the correct key for chunked (assumes
|
|
||||||
// final encrypted size is the same - need to check)
|
|
||||||
if (isEncrypted) {
|
|
||||||
currentSending = authService.encrypt(payload, (short) 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
sendingChunked = true;
|
sendingChunked = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user