mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-06-25 06:21:04 +02:00
Mi Watch Lite: Attempt to fix plaintext support
This commit is contained in:
parent
d953fd5b5b
commit
1920968fba
|
@ -242,11 +242,13 @@ public class XiaomiCharacteristic {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldWriteChunked(currentSending)) {
|
if (shouldWriteChunked(currentSending)) {
|
||||||
// Prepend encrypted index
|
if (isEncrypted) {
|
||||||
currentSending = ByteBuffer.allocate(2 + currentSending.length).order(ByteOrder.LITTLE_ENDIAN)
|
// Prepend encrypted index for the nonce
|
||||||
.putShort(encryptedIndex++)
|
currentSending = ByteBuffer.allocate(2 + currentSending.length).order(ByteOrder.LITTLE_ENDIAN)
|
||||||
.put(currentSending)
|
.putShort(encryptedIndex++)
|
||||||
.array();
|
.put(currentSending)
|
||||||
|
.array();
|
||||||
|
}
|
||||||
|
|
||||||
LOG.debug("Sending next - chunked");
|
LOG.debug("Sending next - chunked");
|
||||||
|
|
||||||
|
@ -255,7 +257,7 @@ public class XiaomiCharacteristic {
|
||||||
final ByteBuffer buf = ByteBuffer.allocate(6).order(ByteOrder.LITTLE_ENDIAN);
|
final ByteBuffer buf = ByteBuffer.allocate(6).order(ByteOrder.LITTLE_ENDIAN);
|
||||||
buf.putShort((short) 0);
|
buf.putShort((short) 0);
|
||||||
buf.put((byte) 0);
|
buf.put((byte) 0);
|
||||||
buf.put((byte) 1);
|
buf.put((byte) (isEncrypted ? 1 : 0));
|
||||||
buf.putShort((short) Math.round(currentSending.length / 247.0));
|
buf.putShort((short) Math.round(currentSending.length / 247.0));
|
||||||
|
|
||||||
final TransactionBuilder builder = mSupport.createTransactionBuilder("send chunked start");
|
final TransactionBuilder builder = mSupport.createTransactionBuilder("send chunked start");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user