Check FW >= 4.6 and < 5.x
All checks were successful
Build and test project / build-and-test (push) Successful in 1m27s
All checks were successful
Build and test project / build-and-test (push) Successful in 1m27s
This commit is contained in:
@@ -53,11 +53,6 @@ var FIRMWARE_DOWNLOADS = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Supported firmware versions for patching (derived from FIRMWARE_DOWNLOADS).
|
|
||||||
*/
|
|
||||||
const SUPPORTED_FIRMWARE = Object.keys(FIRMWARE_DOWNLOADS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the firmware download URL for a given serial prefix and firmware version.
|
* Get the firmware download URL for a given serial prefix and firmware version.
|
||||||
* Returns null if no URL is available.
|
* Returns null if no URL is available.
|
||||||
@@ -153,8 +148,10 @@ class KoboDevice {
|
|||||||
? serial.substring(0, 4)
|
? serial.substring(0, 4)
|
||||||
: serial.substring(0, 3);
|
: serial.substring(0, 3);
|
||||||
const model = KOBO_MODELS[serialPrefix] || 'Unknown Kobo (' + serial.substring(0, 4) + ')';
|
const model = KOBO_MODELS[serialPrefix] || 'Unknown Kobo (' + serial.substring(0, 4) + ')';
|
||||||
const isSupported = SUPPORTED_FIRMWARE.includes(firmware);
|
const fwParts = firmware.split('.');
|
||||||
const isIncompatible = firmware.startsWith('5.');
|
const fwMajor = parseInt(fwParts[0], 10) || 0;
|
||||||
|
const fwMinor = parseInt(fwParts[1], 10) || 0;
|
||||||
|
const isIncompatible = !(fwMajor === 4 && fwMinor >= 6);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
serial,
|
serial,
|
||||||
@@ -162,7 +159,6 @@ class KoboDevice {
|
|||||||
firmware,
|
firmware,
|
||||||
hardwareId,
|
hardwareId,
|
||||||
model,
|
model,
|
||||||
isSupported,
|
|
||||||
isIncompatible,
|
isIncompatible,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user