From 14f8929439f7e15f9061949c0e16e1692b604de1 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sun, 13 Dec 2015 23:59:26 +0100 Subject: [PATCH] Pebble: fix decoding strings in appmessages from the pebble This fixes sending SMS from "Dialer for Pebble" --- CHANGELOG.md | 3 ++- .../gadgetbridge/service/devices/pebble/PebbleProtocol.java | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4921ccb7a..356a7fe85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ ###Changelog ####Next Version -* Pebble: Allow installing apps compiled with SDK 2.x also on the balast platform (Time, Time Steel) +* Pebble: Allow installing apps compiled with SDK 2.x also on the basalt platform (Time, Time Steel) +* Pebble: Fix decoding strings in appmessages from the pebble (fixes sending SMS from "Dialer for Pebble") * Some new and updated icons ####Version 0.6.9 diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java index 471d25bbe..0b913c9e7 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java @@ -12,7 +12,6 @@ import org.slf4j.LoggerFactory; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.Random; @@ -1252,7 +1251,7 @@ public class PebbleProtocol extends GBDeviceProtocol { if (type == TYPE_BYTEARRAY) { dict.add(new Pair(key, bytes)); } else { - dict.add(new Pair(key, Arrays.toString(bytes))); + dict.add(new Pair(key, new String(bytes))); } break; default: @@ -1306,7 +1305,7 @@ public class PebbleProtocol extends GBDeviceProtocol { jsonObject.put("value", Base64.encode(bytes, Base64.NO_WRAP)); } else { jsonObject.put("type", "string"); - jsonObject.put("value", Arrays.toString(bytes)); + jsonObject.put("value", new String(bytes)); } break; default: