-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathrouter_firmware.js
42 lines (36 loc) · 1.48 KB
/
router_firmware.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
1. Goto http://fota.slv.fxd.jiophone.net/
2. Replace router options and current and max versions accordingly
3. Run it in browser developer console, to scan for available firmware versions.
*/
function precisionRound(number, precision) {
const factor = Math.pow(10, precision);
return Math.round(number * factor) / factor;
}
function checkFirmwareExists(version, url) {
var http = new XMLHttpRequest();
http.open('HEAD', url);
http.onreadystatechange = function () {
if (this.readyState === this.DONE) {
if (this.status !== 404) {
console.log(`${version} : ${url}`);
}
}
};
http.send();
}
async function loadFirmwares() {
const router = {
manufacturer: "Sercomm", // Replace this with your Router Manufacturer (Sercomm, Skyworth, Arcadyan, etc...)
model: "JCOW414", // Replace this with your Router Model Name (JCOW414, JCOW411, etc...)
firmwarePrefix: "SRCMTF1_JCOW414_R", // Replace this with your Router Firmware Version Prefix (SRCMTF1_JCOW414_R, SKYWTF1_JCOW407_R, ARCNTF1_JCOW411_R, etc...)
};
let currentVersion = 2.3;
const maxVersion = 3;
while (currentVersion < maxVersion) {
const url = `http://fota.slv.fxd.jiophone.net/ONT/${router.manufacturer}/${router.model}/${router.firmwarePrefix}${precisionRound(currentVersion, 2)}.img`;
checkFirmwareExists(precisionRound(currentVersion, 2), url);
currentVersion += 0.01;
}
}
loadFirmwares();