mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-10-12 08:08:09 +02:00
Mi Watch Lite: more small fixes for non-encrypted path
This commit is contained in:
parent
b103b4f3e4
commit
a19318c5bd
@ -140,7 +140,7 @@ public class XiaomiCharacteristic {
|
||||
if (chunk == numChunks) {
|
||||
sendChunkEndAck();
|
||||
|
||||
if (authService != null) {
|
||||
if (isEncrypted) {
|
||||
// chunks are always encrypted if an auth service is available
|
||||
handler.handle(authService.decrypt(chunkBuffer.toByteArray()));
|
||||
} else {
|
||||
@ -157,9 +157,10 @@ public class XiaomiCharacteristic {
|
||||
switch (type) {
|
||||
case 0:
|
||||
// Chunked start request
|
||||
final byte one = buf.get(); // ?
|
||||
if (one != 1) {
|
||||
LOG.warn("Chunked start request: expected 1, got {}", one);
|
||||
final byte messageEncrypted = buf.get();
|
||||
byte expectedResult = (byte) (isEncrypted ? 1 : 0);
|
||||
if (messageEncrypted != expectedResult) {
|
||||
LOG.warn("Chunked start request: expected {}, got {}", expectedResult, messageEncrypted);
|
||||
return;
|
||||
}
|
||||
numChunks = buf.getShort();
|
||||
|
Loading…
Reference in New Issue
Block a user