1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-27 12:26:48 +01:00

Pebble: Support installing .pbl (language files) on firmware 3.x

This commit is contained in:
Andreas Shimokawa 2015-12-08 12:06:27 +01:00
parent 7f8ba83aab
commit 3ac00a004f
5 changed files with 7 additions and 6 deletions

View File

@ -1,8 +1,9 @@
###Changelog
####Next Version
* Pebble: store app details in pbw-cache and display them in app manager on firmware 3.x
* Pebble: Store app details in pbw-cache and display them in app manager on firmware 3.x
* Pebble: Increase maximum notification body length from 255 to 512 bytes on firmware 3.x
* Pebble: Support installing .pbl (language files) on firmware 3.x
####Version 0.6.8
* Mi Band support for Firmware upgrade/downgrade on Mi Band 1A (white LEDs, no heartrate sensor)

View File

@ -110,7 +110,7 @@ public class PBWInstallHandler implements InstallHandler {
@Override
public void onStartInstall(GBDevice device) {
if (mPBWReader.isFirmware()) {
if (mPBWReader.isFirmware() || mPBWReader.isLanguage()) {
return;
}

View File

@ -64,7 +64,7 @@ public class PBWReader {
InputStream fin = new BufferedInputStream(cr.openInputStream(uri));
if (uri.toString().endsWith(".pbl") && platform.equals("aplite")) {
if (uri.toString().endsWith(".pbl")) {
STM32CRC stm32crc = new STM32CRC();
try {
byte[] buf = new byte[2000];

View File

@ -581,7 +581,7 @@ public class PebbleIoThread extends GBDeviceIoThread {
writeInstallApp(mPebbleProtocol.encodeGetTime());
} else {
GBDeviceApp app = mPBWReader.getGBDeviceApp();
if (mPebbleProtocol.isFw3x) {
if (mPebbleProtocol.isFw3x && !mPBWReader.isLanguage()) {
if (appId == 0) {
// only install metadata - not the binaries
write(mPebbleProtocol.encodeInstallMetadata(app.getUUID(), app.getName(), mPBWReader.getAppVersion(), mPBWReader.getSdkVersion(), mPBWReader.getFlags(), mPBWReader.getIconId()));

View File

@ -1029,7 +1029,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
/* pebble specific install methods */
public byte[] encodeUploadStart(byte type, int app_id, int size, String filename) {
short length;
if (isFw3x) {
if (isFw3x && (type != PUTBYTES_TYPE_FILE)) {
length = LENGTH_UPLOADSTART_3X;
type |= 0b10000000;
} else {
@ -1048,7 +1048,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
buf.putInt(size);
buf.put(type);
if (isFw3x) {
if (isFw3x && (type != PUTBYTES_TYPE_FILE)) {
buf.putInt(app_id);
} else {
// slot