From 1996184d6919a9ee76311c0fecc36acd31661c02 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 3 May 2018 23:31:18 +0200 Subject: [PATCH] Amazfit Bip: fix fetching logs from device via debug menu --- .../amazfitbip/operations/AmazfitBipFetchLogsOperation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/operations/AmazfitBipFetchLogsOperation.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/operations/AmazfitBipFetchLogsOperation.java index 61fcd0eca..878786f8a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/operations/AmazfitBipFetchLogsOperation.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/operations/AmazfitBipFetchLogsOperation.java @@ -61,7 +61,7 @@ public class AmazfitBipFetchLogsOperation extends AbstractFetchOperation { return; } - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd-hhmmss", Locale.US); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd-HHmmss", Locale.US); String filename = "amazfitbip_" + dateFormat.format(new Date()) + ".log"; File outputFile = new File(dir, filename ); @@ -121,7 +121,7 @@ public class AmazfitBipFetchLogsOperation extends AbstractFetchOperation { @Override protected void bufferActivityData(@NonNull byte[] value) { try { - logOutputStream.write(value, 1, value.length); + logOutputStream.write(value, 1, value.length - 1); } catch (IOException e) { LOG.warn("could not write to output stream", e); handleActivityFetchFinish(false);