mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-02-24 16:31:13 +01:00
Mi Band 3: Support flashing latest Japanese-Korean font file
This increases the supported file size to 2.0MB. Somehow it is confusing that the new file is version 1 and the old version 2. Also according to firmare.json both are version 1....
This commit is contained in:
parent
0399bc048c
commit
f7fe3a836f
@ -51,7 +51,7 @@ public abstract class AbstractMiBandFWHelper {
|
||||
}
|
||||
|
||||
try (InputStream in = new BufferedInputStream(uriHelper.openInputStream())) {
|
||||
this.fw = FileUtils.readAll(in, 1024 * 1536); // 1.5 MB
|
||||
this.fw = FileUtils.readAll(in, 1024 * 2048); // 2.0 MB
|
||||
determineFirmwareInfo(fw);
|
||||
} catch (IOException ex) {
|
||||
throw ex; // pass through
|
||||
|
@ -70,6 +70,8 @@ public class MiBand3FirmwareInfo extends HuamiFirmwareInfo {
|
||||
|
||||
// font
|
||||
crcToVersion.put(19775, "1");
|
||||
crcToVersion.put(42959, "2 (old Jap/Kor)");
|
||||
crcToVersion.put(12052, "1 (Jap/Kor)");
|
||||
}
|
||||
|
||||
public MiBand3FirmwareInfo(byte[] bytes) {
|
||||
@ -79,7 +81,7 @@ public class MiBand3FirmwareInfo extends HuamiFirmwareInfo {
|
||||
@Override
|
||||
protected HuamiFirmwareType determineFirmwareType(byte[] bytes) {
|
||||
if (ArrayUtils.startsWith(bytes, FT_HEADER)) {
|
||||
if (bytes[FONT_TYPE_OFFSET] == 0x03 || bytes[FONT_TYPE_OFFSET] == 0x04) {
|
||||
if (bytes[FONT_TYPE_OFFSET] >= 0x03 && bytes[FONT_TYPE_OFFSET] <= 0x05) {
|
||||
return HuamiFirmwareType.FONT;
|
||||
}
|
||||
return HuamiFirmwareType.INVALID;
|
||||
|
Loading…
x
Reference in New Issue
Block a user