From 94c0d6af9d7523ca962a0e7986592d0afe4f182d Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Sun, 11 Dec 2016 21:30:37 +0100 Subject: [PATCH] Mi2: Fix off-by-one in activity fetching --- .../devices/miband2/operations/FetchActivityOperation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/operations/FetchActivityOperation.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/operations/FetchActivityOperation.java index 768f9236a..85200a639 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/operations/FetchActivityOperation.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/operations/FetchActivityOperation.java @@ -218,7 +218,7 @@ public class FetchActivityOperation extends AbstractMiBand2Operation { private void handleActivityMetadata(byte[] value) { if (value.length == 15) { // first two bytes are whether our request was accepted - if (ArrayUtils.equals(MiBand2Service.RESPONSE_ACTIVITY_DATA_START_DATE_SUCCESS, value, 0, 2)) { + if (ArrayUtils.equals(MiBand2Service.RESPONSE_ACTIVITY_DATA_START_DATE_SUCCESS, value, 0, 3)) { // the third byte (0x01 on success) = ? // the 4th - 7th bytes probably somehow represent the number of bytes/packets to expect