1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-29 03:55:49 +01:00

Zepp OS: Fix app and watchface install

Fix the regression introduced by 1c93ffc3e
This commit is contained in:
José Rebelo 2022-11-25 21:42:47 +00:00
parent 091fd07c7b
commit 5d78b778e3

View File

@ -100,18 +100,20 @@ public abstract class Huami2021FirmwareInfo extends AbstractHuamiFirmwareInfo {
private HuamiFirmwareType handleZipPackage(byte[] bytes) {
final ZipFile zipFile = new ZipFile(bytes);
final byte[] firmwareBin;
// Attempt to handle as a firmware
try {
firmwareBin = zipFile.getFileFromZip("META/firmware.bin");
final byte[] firmwareBin = zipFile.getFileFromZip("META/firmware.bin");
if (isCompatibleFirmwareBin(firmwareBin)) {
return HuamiFirmwareType.FIRMWARE;
} else {
return HuamiFirmwareType.INVALID;
}
} catch (final ZipFileException e) {
LOG.error("Failed to get firmware.bin from zip file", e);
return HuamiFirmwareType.FIRMWARE;
}
if (isCompatibleFirmwareBin(firmwareBin)) {
return HuamiFirmwareType.FIRMWARE;
LOG.warn("Failed to get firmware.bin from zip file", e);
}
// Attempt to handle as an app / watchface
final JSONObject appJson = getAppJson(zipFile);
if (appJson == null) {
return HuamiFirmwareType.INVALID;