piggz / harbour-amazfish

Amazfit Bip support for SailfishOS
GNU General Public License v3.0
103 stars 52 forks source link

PineTime / InfiniTime : OTA now takes the DFU ZIP file #237

Closed JF002 closed 2 years ago

JF002 commented 2 years ago

In Infinitime, the firmware (for the OTA) is provided as a DFU ZIP file. However, Amazfish does not support the ZIP file and only accept the uncompressed binary file.

This PR adds support for the ZIP file (and removes the support for the raw bin file). The name of the firmware file inside the archive and the CRC of the firmware are read from the manifest.json file included in the DFU archive.

piggz commented 2 years ago

Looking good... What happens if I select a random zip file? What happens if i select a zip file containing manifest.json, but not the structure we expect?

JF002 commented 2 years ago

Looking good... What happens if I select a random zip file? What happens if i select a zip file containing manifest.json, but not the structure we expect?

That's... something I'll need to check! Thanks for reminding me to also test error cases! :)

JF002 commented 2 years ago

So, I've just pushed a new commit 1db2d10 that checks for the validity of the archive and json file before starting the upload! The transfer will start only if all information are available in the archive and in the manifest file.