diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pinetime/PineTimeInstallHandler.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pinetime/PineTimeInstallHandler.java index 88a0b2fc9..f60587d43 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pinetime/PineTimeInstallHandler.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pinetime/PineTimeInstallHandler.java @@ -75,8 +75,9 @@ public class PineTimeInstallHandler implements InstallHandler { final byte[] buffer = new byte[1024]; - while (zipInputStream.read(buffer, 0, buffer.length) != -1) { - json.append(new String(buffer)); + int read; + while ((read = zipInputStream.read(buffer, 0, buffer.length)) != -1) { + json.append(new String(buffer, 0, read)); } Gson gson = new Gson();