1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-14 09:00:04 +02:00

Garmin: Make fit header crc optional

This commit is contained in:
José Rebelo 2024-04-28 18:28:30 +01:00
parent c13d825322
commit c63207f7de

View File

@ -192,7 +192,7 @@ public class FitFile {
if (hasCRC) { if (hasCRC) {
int incomingCrc = garminByteBufferReader.readShort(); int incomingCrc = garminByteBufferReader.readShort();
if (incomingCrc != ChecksumCalculator.computeCrc(garminByteBufferReader.asReadOnlyBuffer(), 0, headerSize - 2)) { if (incomingCrc != 0 && incomingCrc != ChecksumCalculator.computeCrc(garminByteBufferReader.asReadOnlyBuffer(), 0, headerSize - 2)) {
throw new IllegalArgumentException("Wrong CRC for header in FIT file"); throw new IllegalArgumentException("Wrong CRC for header in FIT file");
} }
// LOG.info("Fit File Header didn't have CRC, no check performed."); // LOG.info("Fit File Header didn't have CRC, no check performed.");