mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Pebble: fix nasty crash when appmessage id is > 127
This is a regression since Gadgetbridge 0.22.0 Potentially fixes the following: - #868 - #876 - #884 NOTE: Java has no unisgned, java has no unsigned, java has no unsigned. Java has no unisgned, java has no unsigned, java has no unsigned. Java has no unisgned, java has no unsigned, java has no unsigned.
This commit is contained in:
+3
-3
@@ -1986,7 +1986,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
idLookup[last_id] = ext_id;
|
||||
idLookup[last_id & 0xff] = ext_id;
|
||||
|
||||
return buf.array();
|
||||
}
|
||||
@@ -2633,14 +2633,14 @@ public class PebbleProtocol extends GBDeviceProtocol {
|
||||
LOG.info("got APPLICATIONMESSAGE/LAUNCHER (EP " + endpoint + ") NACK");
|
||||
}
|
||||
GBDeviceEventAppMessage evtAppMessage = null;
|
||||
if (endpoint == ENDPOINT_APPLICATIONMESSAGE && idLookup[last_id] != null) {
|
||||
if (endpoint == ENDPOINT_APPLICATIONMESSAGE && idLookup[last_id & 0xff] != null) {
|
||||
evtAppMessage = new GBDeviceEventAppMessage();
|
||||
if (pebbleCmd == APPLICATIONMESSAGE_ACK) {
|
||||
evtAppMessage.type = GBDeviceEventAppMessage.TYPE_ACK;
|
||||
} else {
|
||||
evtAppMessage.type = GBDeviceEventAppMessage.TYPE_NACK;
|
||||
}
|
||||
evtAppMessage.id = idLookup[last_id];
|
||||
evtAppMessage.id = idLookup[last_id & 0xff];
|
||||
evtAppMessage.appUUID = currentRunningApp;
|
||||
}
|
||||
devEvts = new GBDeviceEvent[]{evtAppMessage};
|
||||
|
||||
Reference in New Issue
Block a user