From 275839a7f4cbc2b016d67768fb730718fddd65e6 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Sun, 20 Mar 2016 23:55:48 +0100 Subject: [PATCH] last arg of copyOfRange() is index, not length! --- .../service/devices/miband/AbstractMiFirmwareInfo.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/AbstractMiFirmwareInfo.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/AbstractMiFirmwareInfo.java index e303e45f..f1d4d074 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/AbstractMiFirmwareInfo.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/AbstractMiFirmwareInfo.java @@ -60,10 +60,8 @@ public abstract class AbstractMiFirmwareInfo { public abstract boolean isGenerallyCompatibleWith(GBDevice device); - public - @NonNull - byte[] getFirmwareBytes() { - return Arrays.copyOfRange(wholeFirmwareBytes, getFirmwareOffset(), getFirmwareLength()); + public @NonNull byte[] getFirmwareBytes() { + return Arrays.copyOfRange(wholeFirmwareBytes, getFirmwareOffset(), getFirmwareOffset() + getFirmwareLength()); } public int getFirmwareVersionMajor() {