1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-07 02:37:01 +01:00

Amazfit Bip: Allow watchface flashing and whitelist Firmware 0.0.9.40

This commit is contained in:
Andreas Shimokawa 2017-11-09 21:59:41 +01:00
parent 9764e8e54e
commit e3ca3872e1
3 changed files with 11 additions and 4 deletions

View File

@ -62,12 +62,14 @@ public class AmazfitBipFirmwareInfo extends HuamiFirmwareInfo {
crcToVersion.put(3462, "0.0.8.98");
crcToVersion.put(55420, "0.0.9.14");
crcToVersion.put(39465, "0.0.9.26");
crcToVersion.put(27394, "0.0.9.40");
// resources
crcToVersion.put(12586, "RES 0.0.8.74");
crcToVersion.put(34068, "RES 0.0.8.88");
crcToVersion.put(59839, "RES 0.0.8.96-98");
crcToVersion.put(50401, "RES 0.0.9.14-26");
crcToVersion.put(22051, "RES 0.0.9.40");
// gps
crcToVersion.put(61520, "GPS 9367,8f79a91,0,0,");
@ -99,6 +101,9 @@ public class AmazfitBipFirmwareInfo extends HuamiFirmwareInfo {
// TODO: this is certainly not a correct validation, but it works for now
return HuamiFirmwareType.FIRMWARE;
}
if (ArrayUtils.startsWith(bytes, WATCHFACE_HEADER)) {
return HuamiFirmwareType.WATCHFACE;
}
return HuamiFirmwareType.INVALID;
}

View File

@ -30,11 +30,12 @@ public abstract class HuamiFirmwareInfo {
0x48, 0x4d, 0x52, 0x45, 0x53
};
protected static final byte[] WATCHFACE_HEADER = new byte[]{
0x48, 0x4d, 0x44, 0x49, 0x41, 0x4c
};
protected static final byte[] FT_HEADER = new byte[]{ // HMZK font file (*.ft, *.ft.xx)
0x48,
0x4d,
0x5a,
0x4b
0x48, 0x4d, 0x5a, 0x4b
};
private HuamiFirmwareType firmwareType = HuamiFirmwareType.FIRMWARE;

View File

@ -24,6 +24,7 @@ public enum HuamiFirmwareType {
GPS((byte) 3),
GPS_CEP((byte) 4),
GPS_ALMANAC((byte)5),
WATCHFACE((byte)8),
INVALID(Byte.MIN_VALUE);
private final byte value;