From f616e4f571e218870d9fc57f88ec3ae982645351 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 3 Mar 2016 17:46:58 +0100 Subject: [PATCH] Pebble: skip .js file if too large instead of breaking installation (Hotfix) --- .../gadgetbridge/devices/pebble/PBWReader.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PBWReader.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PBWReader.java index ee65b567..e287b328 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PBWReader.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PBWReader.java @@ -216,8 +216,10 @@ public class PBWReader { } else if (fileName.equals("pebble-js-app.js")) { LOG.info("Found JS file: app supports configuration."); long bytes = ze.getSize(); - if (bytes > 65536) // that should be too much - break; + if (bytes > 65536) { + LOG.info("size exceeding 64k, skipping"); + continue; + } ByteArrayOutputStream baos = new ByteArrayOutputStream(); while ((count = zis.read(buffer)) != -1) {