├── README.md
├── greasemonkey
├── .gm.json
├── README.md
└── ZTE-Web-Script.user.js
└── zte.js
/README.md:
--------------------------------------------------------------------------------
1 | See https://www.lteforum.at/mobilfunk/script-fuer-zte-router.20462/ for more.
2 |
--------------------------------------------------------------------------------
/greasemonkey/.gm.json:
--------------------------------------------------------------------------------
1 | {"downloadUrl":null,"enabled":true,"iconFilename":null,"iconType":null,"userExcludes":[],"userIncludes":[],"userMatches":[]}
--------------------------------------------------------------------------------
/greasemonkey/README.md:
--------------------------------------------------------------------------------
1 | For use with greasemonkey extension, to automatically load the script from the GitHub repo.
2 |
--------------------------------------------------------------------------------
/greasemonkey/ZTE-Web-Script.user.js:
--------------------------------------------------------------------------------
1 | // ==UserScript==
2 | // @name ZTE-Web-Script
3 | // @version 0.1
4 | // @description Automatically loading ZTE-Web-Script
5 | // @match https://192.168.0.1/*
6 | // @match https://192.168.1.1/*
7 | // @match https://192.168.2.1/*
8 | // @match http://192.168.0.1/*
9 | // @match http://192.168.1.1/*
10 | // @match http://192.168.2.1/*
11 | // @require https://code.jquery.com/jquery-3.7.1.min.js
12 | // @grant GM_xmlhttpRequest
13 | // ==/UserScript==
14 |
15 | (function() {
16 | 'use strict';
17 |
18 | function handleResponse(responseText, onload) {
19 | var script = document.createElement('script');
20 | script.textContent = responseText;
21 | document.head.appendChild(script);
22 | if (onload) onload();
23 | }
24 |
25 | function loadScript(url, onload, onerror) {
26 | // Add timestamp to the URL to bypass cache
27 | var timestamp = new Date().getTime();
28 | var urlWithTimestamp = url + "?t=" + timestamp;
29 |
30 | if (typeof GM_xmlhttpRequest !== "undefined") {
31 | GM_xmlhttpRequest({
32 | method: "GET",
33 | url: urlWithTimestamp,
34 | onload: function(response) {
35 | handleResponse(response.responseText, onload);
36 | },
37 | onerror: onerror
38 | });
39 | } else {
40 | var xhr = new XMLHttpRequest();
41 | xhr.open("GET", urlWithTimestamp, true);
42 | xhr.onreadystatechange = function() {
43 | if (xhr.readyState === 4) {
44 | if (xhr.status === 200) {
45 | handleResponse(xhr.responseText, onload);
46 | } else {
47 | if (onerror) onerror();
48 | }
49 | }
50 | };
51 | xhr.onerror = onerror;
52 | xhr.send();
53 | }
54 | }
55 |
56 | loadScript("https://cdn.jsdelivr.net/gh/tpoechtrager/ZTE-Web-Script/zte.js", function() {
57 | console.log("ZTE-Web-Script loaded and executed.");
58 | }, function() {
59 | alert("Failed to load the ZTE-Web-Script");
60 | });
61 |
62 | })();
63 |
--------------------------------------------------------------------------------
/zte.js:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Original code by Miononno
4 | * https://www.youtube.com/watch?v=1kanq1w2DA0
5 | *
6 | * Enhanced by unknown @ lteforum.at
7 | *
8 | */
9 |
10 | console.log("Loading ZTE Script v" + "2025-04-17-#1");
11 |
12 | siginfo =
13 | "wan_active_band,wan_active_channel,wan_lte_ca,wan_apn,wan_ipaddr," +
14 | "cell_id,dns_mode,prefer_dns_manual,standby_dns_manual,network_type," +
15 |
16 | "network_provider_fullname," +
17 | "rmcc,rmnc," +
18 |
19 | "ip_passthrough_enabled," +
20 |
21 | "bandwidth," +
22 | "tx_power," +
23 |
24 | "rscp_1,ecio_1,rscp_2,ecio_2,rscp_3,ecio_3,rscp_4,ecio_4," +
25 |
26 | "ngbr_cell_info," +
27 | "lte_multi_ca_scell_info,lte_multi_ca_scell_sig_info," +
28 | "lte_band,lte_rsrp,lte_rsrq," +
29 | "lte_rsrq,lte_rssi,lte_rsrp,lte_snr," +
30 | "lte_ca_pcell_band,lte_ca_pcell_freq,lte_ca_pcell_bandwidth," +
31 | "lte_ca_scell_band,lte_ca_scell_bandwidth," +
32 | "lte_rsrp_1,lte_rsrp_2,lte_rsrp_3,lte_rsrp_4," +
33 | "lte_snr_1,lte_snr_2,lte_snr_3,lte_snr_4," +
34 | "lte_pci,lte_pci_lock,lte_earfcn_lock," +
35 |
36 | "5g_rx0_rsrp,5g_rx1_rsrp,Z5g_rsrp,Z5g_rsrq,Z5g_SINR," +
37 | "nr5g_cell_id,nr5g_pci," +
38 | "nr5g_action_channel,nr5g_action_band," +
39 | "nr5g_action_nsa_band," +
40 | "nr_ca_pcell_band,nr_ca_pcell_freq," +
41 | "nr_multi_ca_scell_info," +
42 | "nr5g_sa_band_lock,nr5g_nsa_band_lock," +
43 |
44 | "pm_sensor_ambient,pm_sensor_mdm,pm_sensor_5g,pm_sensor_pa1,wifi_chip_temp";
45 |
46 | is_mc888 = false;
47 | is_mc889 = false;
48 | logged_in_as_developer = false;
49 |
50 | function dump_variable(v)
51 | {
52 | for (property in v)
53 | {
54 | try
55 | {
56 | console.log(property + ":" + JSON.stringify(v[property]));
57 | }
58 | catch { }
59 | }
60 | }
61 |
62 | function var2html(prefix, v)
63 | {
64 | for (index in v)
65 | {
66 | var items = v[index];
67 |
68 | for (item_index in items)
69 | $("#" + prefix + "_" + index + "_" + item_index).html(items[item_index]);
70 | }
71 | }
72 |
73 | function test_cmd(cmd)
74 | {
75 | $.ajax({
76 | type: "GET",
77 | url: "/goform/goform_get_cmd_process",
78 | data:
79 | {
80 | cmd: cmd,
81 | multi_data: "1"
82 | },
83 | dataType: "json",
84 | success: function(a)
85 | {
86 | console.log(a);
87 | }
88 | });
89 | }
90 |
91 | // https://stackoverflow.com/a/68009748/1392778
92 | window.cookies = window.cookies ||
93 | {
94 | // https://stackoverflow.com/a/25490531/1028230
95 | get: function(name)
96 | {
97 | var b = document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)');
98 | return b ? b.pop() : null;
99 | },
100 |
101 | delete: function(name)
102 | {
103 | document.cookie = '{0}=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;'
104 | .replace('{0}', name);
105 | },
106 |
107 | set: function(name, value)
108 | {
109 | document.cookie =
110 | '{0}={1};expires=Fri, 31 Dec 9999 23:59:59 GMT;path=/;SameSite=Lax'
111 | .replace('{0}', name)
112 | .replace('{1}', value);
113 | }
114 | };
115 |
116 | function show_logout_and_shutdown_buttons()
117 | {
118 | document.getElementById("logout").childNodes.forEach(el => {
119 | $(el).hide();
120 | $(el).show();
121 | });
122 | }
123 |
124 | wait_for_log_in_done = false;
125 | function wait_for_log_in()
126 | {
127 | check_log_in(
128 | function()
129 | {
130 | if (wait_for_log_in_done) return;
131 | wait_for_log_in_done = true;
132 |
133 | inject_html();
134 | get_status();
135 |
136 | show_logout_and_shutdown_buttons_i = 0;
137 | show_logout_and_shutdown_buttons_timer_id = window.setInterval(function() {
138 | show_logout_and_shutdown_buttons();
139 | if (++show_logout_and_shutdown_buttons_i >= 6)
140 | window.clearInterval(show_logout_and_shutdown_buttons_timer_id);
141 | }, 500);
142 |
143 | show_logout_and_shutdown_buttons();
144 |
145 | window.setInterval(get_status, 1000);
146 | window.setInterval(prevent_automatic_logout, 60000);
147 |
148 | window.clearInterval(wait_for_log_in_timer_id);
149 | },
150 |
151 | function()
152 | {
153 | if (typeof show_log_in_info_once === "undefined")
154 | console.log("Contents of script will show once you are logged in!");
155 | show_log_in_info_once = true;
156 | }
157 | );
158 | }
159 |
160 | function init()
161 | {
162 | wait_for_log_in_timer_id = window.setInterval(wait_for_log_in, 250);
163 | wait_for_log_in();
164 | }
165 |
166 | function perform_automatic_login_or_init()
167 | {
168 | if (have_admin_password_hash())
169 | {
170 | check_log_in(
171 |
172 | function()
173 | {
174 | console.log("Already logged in ...");
175 | init();
176 | },
177 |
178 | function()
179 | {
180 | console.log("Logging in ...");
181 | perform_login(function() {
182 | console.log("... logged in");
183 | init();
184 | hash_fix_i = 0;
185 | hash_fix_timer_id = window.setInterval(function() {
186 | window.location.hash = "home";
187 | if (++hash_fix_i >= 10) window.clearInterval(hash_fix_timer_id);
188 | }, 100);
189 | });
190 | }
191 |
192 | );
193 | }
194 | else init();
195 | }
196 |
197 | /*
198 | * Wait until inner version string is available.
199 | */
200 | prepare_2_done = false;
201 | function prepare_2()
202 | {
203 | $.ajax({
204 | type: "GET",
205 | url: "/goform/goform_get_cmd_process",
206 | data:
207 | {
208 | cmd: "wa_inner_version"
209 | },
210 | dataType: "json",
211 | success: function(a)
212 | {
213 | if (a.wa_inner_version == "" || prepare_2_done) return;
214 | prepare_2_done = true;
215 |
216 | is_mc888 = a.wa_inner_version.indexOf("MC888") > -1;
217 | is_mc889 = a.wa_inner_version.indexOf("MC889") > -1;
218 |
219 | if (is_mc888 || is_mc889) hash = SHA256;
220 | else hash = hex_md5;
221 |
222 | perform_automatic_login_or_init();
223 |
224 | window.clearInterval(prepare_2_timer_id);
225 | }
226 | })
227 | }
228 |
229 | /*
230 | * Wait until SHA256() is available.
231 | */
232 | function prepare_1()
233 | {
234 | if (typeof SHA256 === "undefined")
235 | {
236 | return;
237 | }
238 |
239 | window.clearInterval(prepare_1_timer_id);
240 |
241 | prepare_2_timer_id = window.setInterval(prepare_2, 250);
242 | prepare_2();
243 | }
244 |
245 | function make_hidden_settings_visible()
246 | {
247 | alert("This option makes hidden device settings visible.\n" +
248 | "Hidden settings are marked with a '[hidden option]' suffix");
249 |
250 | window.setInterval(function() {
251 | Array.from(document.querySelectorAll('*')).forEach(el => {
252 | // $(el).hide();
253 | // $(el).show();
254 | if($("#ipv4_section").length > 0) {
255 | $('#ipv4_section .row').css('display', 'block');
256 | }
257 | if (el.classList.contains("hide")) {
258 | el.classList.remove("hide");
259 | el.innerHTML += " [hidden option]";
260 | }
261 | })},
262 | 1000);
263 | }
264 |
265 | function have_admin_password_hash()
266 | {
267 | return cookies.get("admin_password_hash") !== null;
268 | }
269 |
270 | function perform_login(successCallback, developer_login = false, save_password_hash = false)
271 | {
272 | var password_hash = "";
273 |
274 | if (have_admin_password_hash())
275 | password_hash = cookies.get("admin_password_hash");
276 |
277 | if (password_hash == "")
278 | {
279 | var password = prompt("Router Password");
280 |
281 | if (password == null || password == "")
282 | return;
283 |
284 | password_hash = SHA256(password);
285 | }
286 |
287 | $.ajax({
288 | type: "GET",
289 | url: "/goform/goform_get_cmd_process",
290 | data:
291 | {
292 | cmd: "wa_inner_version,cr_version,RD,LD",
293 | multi_data: "1"
294 | },
295 | dataType: "json",
296 | success: function(a)
297 | {
298 | ad = hash(hash(a.wa_inner_version + a.cr_version) + a.RD);
299 | $.ajax({
300 | type: "POST",
301 | url: "/goform/goform_set_cmd_process",
302 | data:
303 | {
304 | isTest: "false",
305 | goformId: developer_login ? "DEVELOPER_OPTION_LOGIN" : "LOGIN",
306 | password: SHA256(password_hash + a.LD),
307 | AD: ad
308 | },
309 | success: function(a)
310 | {
311 | var j = JSON.parse(a);
312 | console.log(j);
313 | if ("0" == j.result)
314 | {
315 | if (save_password_hash) cookies.set("admin_password_hash", password_hash);
316 | if (successCallback) successCallback();
317 | }
318 | else
319 | {
320 | var reason = "";
321 | switch (j.result)
322 | {
323 | case "1":
324 | {
325 | reason = "Try again later";
326 | break;
327 | }
328 | case "3":
329 | {
330 | reason = "Wrong Password";
331 | if (have_admin_password_hash())
332 | {
333 | console.log("Wrong password. Removing stored password hash ...");
334 | cookies.delete("admin_password_hash");
335 | }
336 | break;
337 | }
338 | default: reason = "Unknown";
339 | }
340 | alert((developer_login ? "Developer login" : "Login") + " failed! Reason: " + reason + ".");
341 | }
342 | },
343 | error: err
344 | });
345 | }
346 | });
347 | }
348 |
349 | function prevent_automatic_logout()
350 | {
351 | $.ajax({
352 | type: "GET",
353 | url: "/tmpl/network/apn_setting.html?v=" + Math.round(+new Date() / 1000)
354 | });
355 | }
356 |
357 | function enable_automatic_login()
358 | {
359 | var res = confirm("You can make this script log in for you\n" +
360 | "once you paste it into the developer console.\n\n" +
361 | "The password will be stored in a cookie as an SHA256 hash.\n\n" +
362 | "Continue?");
363 |
364 | if (!res)
365 | return;
366 |
367 | cookies.delete("admin_password_hash");
368 |
369 | perform_login(function() {
370 | alert("Successfully saved password as hash!");
371 | }, false, true);
372 | }
373 |
374 | function check_log_in(logged_in_callback, not_logged_in_callback = null)
375 | {
376 | $.ajax({
377 | type: "GET",
378 | url: "/goform/goform_get_cmd_process",
379 | data:
380 | {
381 | // multi_data is required here otherwise
382 | // a false "ok" might be returned by the
383 | // router if a session in another browser
384 | // is running.
385 | multi_data: "1",
386 | cmd: "loginfo"
387 | },
388 | dataType: "json",
389 | success: function(a)
390 | {
391 | if (a.loginfo.toLowerCase() == "ok")
392 | {
393 | if (logged_in_callback)
394 | logged_in_callback();
395 | }
396 | else
397 | {
398 | if (not_logged_in_callback)
399 | not_logged_in_callback();
400 | }
401 | },
402 | error: err
403 | });
404 | }
405 |
406 | class LteCaCellInfo
407 | {
408 | constructor(pci, band, earfcn, bandwidth, rssi, rsrp1, rsrp2, rsrp3, rsrp4, rsrq, sinr1, sinr2, sinr3, sinr4)
409 | {
410 | this.pci = pci;
411 | this.band = band;
412 | this.earfcn = earfcn;
413 | this.bandwidth = bandwidth;
414 | this.rssi = rssi;
415 | this.rsrp1 = rsrp1;
416 | this.rsrp2 = rsrp2;
417 | this.rsrp3 = rsrp3;
418 | this.rsrp4 = rsrp4;
419 | this.rsrq = rsrq;
420 | this.sinr1 = sinr1;
421 | this.sinr2 = sinr2;
422 | this.sinr3 = sinr3;
423 | this.sinr4 = sinr4;
424 | }
425 | }
426 |
427 | function parse_lte_cell_info()
428 | {
429 | //Object { lte_multi_ca_scell_sig_info: "-44.0,-3.0,19.5,0,2;", lte_multi_ca_scell_info: "1,XX,2,3,1525,15.0" }
430 |
431 | // lte_multi_ca_scell_info
432 | // 0: CaIndex
433 | // 1: PCI
434 | // 2: ??
435 | // 3: Band
436 | // 4: Earfcn
437 | // 5: Bandwidth
438 |
439 | // lte_multi_ca_scell_sig_info
440 | // 0: RSRP, -44 invalid
441 | // 1: RSRQ
442 | // 2: SINR
443 | // 3: ??
444 | // 4: ??
445 |
446 | if (!is_lte)
447 | return [];
448 |
449 | var lte_cells = [];
450 |
451 | var lte_main_band =
452 | (lte_ca_pcell_band != "" ? lte_ca_pcell_band : lte_band);
453 |
454 | if (lte_main_band == "")
455 | lte_main_band = "??";
456 |
457 | lte_cells.push(new LteCaCellInfo(
458 | parseInt(lte_pci, 16),
459 | "B" + lte_main_band,
460 | lte_ca_pcell_freq == "" ? wan_active_channel : lte_ca_pcell_freq,
461 | (lte_ca_pcell_bandwidth != "" ? lte_ca_pcell_bandwidth : bandwidth).replace("MHz", "").replace(".0", ""),
462 | lte_rssi,
463 | lte_rsrp_1,
464 | lte_rsrp_2,
465 | lte_rsrp_3,
466 | lte_rsrp_4,
467 | lte_rsrq,
468 | lte_snr_1,
469 | lte_snr_2,
470 | lte_snr_3,
471 | lte_snr_4
472 | ));
473 |
474 | // Only MC888 seems to have lte_multi_ca_scell_sig_info so far.
475 | // MC889 doesn't have it.
476 |
477 | var scell_infos = lte_multi_ca_scell_info.split(";").filter(n => n);
478 | var scell_sig_infos = lte_multi_ca_scell_sig_info.split(";").filter(n => n);
479 |
480 | for (var i = 0; i < scell_infos.length; i++)
481 | {
482 | if (scell_infos[i] == "")
483 | continue;
484 |
485 | var scell_info = scell_infos[i].split(",");
486 | var have_scell_sig_info = scell_sig_infos.length > i;
487 | var scell_sig_info = have_scell_sig_info ? scell_sig_infos[i].split(",") : undefined;
488 |
489 | if (scell_info.length < 6)
490 | continue;
491 |
492 | if (have_scell_sig_info && scell_sig_info.length < 3)
493 | continue;
494 |
495 | lte_cells.push(new LteCaCellInfo(
496 | parseInt(scell_info[1], 16), // PCI
497 | "B" + scell_info[3], // Band
498 | scell_info[4], // Earfcn
499 | scell_info[5].replace(".0", ""), // Bandwidth
500 | "", // RSSI
501 | (have_scell_sig_info ? scell_sig_info[0] : "").replace("-44.0", "?????"), // RSRP
502 | "",
503 | "",
504 | "",
505 | have_scell_sig_info ? scell_sig_info[1] : "", // RSRQ
506 | have_scell_sig_info ? scell_sig_info[2] : "", // SINR
507 | "",
508 | "",
509 | ""));
510 | }
511 |
512 | return lte_cells;
513 | }
514 |
515 | class NrCaCellInfo
516 | {
517 | constructor(pci, band, arfcn, bandwidth, rsrp1, rsrp2, rsrq, sinr)
518 | {
519 | this.pci = pci;
520 | this.band = band;
521 | this.arfcn = arfcn;
522 | this.bandwidth = bandwidth;
523 | this.rsrp1 = rsrp1;
524 | this.rsrp2 = rsrp2;
525 | this.rsrq = rsrq;
526 | this.sinr = sinr;
527 | this.unchanged_updates = 0;
528 | this.info_text = "";
529 | }
530 | }
531 |
532 | function parse_nr_cell_info()
533 | {
534 | if (!is_5g)
535 | return [];
536 |
537 | if (is_5g_nsa && !is_5g_nsa_active)
538 | {
539 | // Base station is capable of 5G NSA
540 | // but we don't have any receipton of the NSA band.
541 | return [];
542 | }
543 |
544 | /*
545 | * There's apparently no better fix for this.
546 | * The API does not reset its memory correctly after switching from
547 | * 5G CA to 5G without CA.
548 | */
549 | var is_ca = nr_ca_pcell_freq == "" || nr5g_action_channel == nr_ca_pcell_freq;
550 |
551 | if (_5g_rx0_rsrp == "")
552 | _5g_rx0_rsrp = Z5g_rsrp;
553 |
554 | var nr_cells = [];
555 |
556 | var allowed_nr_bands =
557 | (is_5g_nsa ? nr5g_nsa_band_lock : nr5g_sa_band_lock).split(",");
558 |
559 | if (!is_ca) {
560 | var nr_band =
561 | (is_5g_nsa ? "n" + nr5g_action_nsa_band : nr5g_action_band);
562 |
563 | if (nr_band == "n" || nr_band == "n-1")
564 | nr_band = "n??";
565 |
566 | nr_cells.push(new NrCaCellInfo(
567 | parseInt(nr5g_pci, 16),
568 | nr_band,
569 | nr5g_action_channel,
570 | is_5g_nsa ? "" : bandwidth.replace("MHz", ""),
571 | _5g_rx0_rsrp,
572 | _5g_rx1_rsrp,
573 | Z5g_rsrq,
574 | Z5g_SINR.replace("-20.0", "?????").replace("-3276.8", "?????")
575 | ));
576 |
577 | previous_nr_cells = nr_cells;
578 | return nr_cells;
579 | }
580 |
581 | var pcc_band = nr_ca_pcell_band != ""
582 | ? nr_ca_pcell_band
583 | : (nr5g_action_band != ""
584 | ? (nr5g_action_band[0] == 'n' || nr5g_action_band[0] == 'N'
585 | ? nr5g_action_band.substr(1)
586 | : nr5g_action_band)
587 | : "??");
588 |
589 | var pcc_freq = nr_ca_pcell_freq != ""
590 | ? nr_ca_pcell_freq
591 | : (nr5g_action_channel != ""
592 | ? nr5g_action_channel
593 | : "??");
594 |
595 | nr_cells.push(new NrCaCellInfo(
596 | parseInt(nr5g_pci, 16),
597 | "n" + pcc_band,
598 | pcc_freq,
599 | bandwidth == "" ? "" : bandwidth.replace("MHz", ""),
600 | _5g_rx0_rsrp,
601 | _5g_rx1_rsrp,
602 | Z5g_rsrq,
603 | Z5g_SINR.replace("-20.0", "?????").replace("-3276.8", "?????")
604 | ));
605 |
606 | nr_multi_ca_scell_info.split(";").forEach(cell => {
607 | if (cell == "")
608 | return;
609 |
610 | // 0,XX,1,n75,292330,30MHz,0,-73.3,-10.5,17.5;
611 | // 0 1 2 3 4 5 6 7 8 9
612 | var cell_data = cell.split(",");
613 |
614 | if (cell_data.length < 10)
615 | return;
616 |
617 | var nr_band = cell_data[3].replace("n", "");
618 |
619 | /*
620 | * Try to detect false data. See comment above.
621 | */
622 | if (allowed_nr_bands.indexOf(nr_band) == -1)
623 | return;
624 |
625 | nr_cells.push(new NrCaCellInfo(
626 | cell_data[1], // PCI
627 | cell_data[3], // Band
628 | cell_data[4], // Arfcn
629 | cell_data[5].replace("MHz", ""),
630 | cell_data[7], // RSRP
631 | "",
632 | cell_data[8], // RSRQ
633 | cell_data[9].replace("0.0", "?????") // SINR
634 | ));
635 | });
636 |
637 | /*
638 | * Try to detect false data. See comment above.
639 | * Only do this for SCells.
640 | */
641 | if (false && typeof previous_nr_cells !== "undefined" && nr_cells.length == previous_nr_cells.length)
642 | {
643 | for (var i = 1; i < nr_cells.length; i++)
644 | {
645 | if (nr_cells[i].rsrp1 == previous_nr_cells[i].rsrp1 &&
646 | nr_cells[i].sinr == previous_nr_cells[i].sinr)
647 | {
648 | nr_cells[i].unchanged_updates = previous_nr_cells[i].unchanged_updates + 1;
649 | if (nr_cells[i].unchanged_updates >= 30)
650 | nr_cells[i].info_text = "[Data might be invalid]";
651 | }
652 | }
653 | }
654 |
655 | previous_nr_cells = nr_cells;
656 | return nr_cells;
657 | }
658 |
659 | function get_band_info(cells)
660 | {
661 | var bands = "";
662 | cells.forEach(cell => {
663 | var info = cell.band;
664 | if (cell.bandwidth != "") info += "(" + cell.bandwidth + "MHz)";
665 | bands += bands ? " + " : "";
666 | bands += info;
667 | });
668 | return bands;
669 | }
670 |
671 | function get_status()
672 | {
673 | $.ajax({
674 | type: "GET",
675 | url: "/goform/goform_get_cmd_process",
676 | data:
677 | {
678 | cmd: siginfo,
679 | multi_data: "1"
680 | },
681 | dataType: "json",
682 | success: function(a)
683 | {
684 | for (signal = a, vars = siginfo.split(','), e = 0; e < vars.length; e++)
685 | {
686 | v = vars[e];
687 | window[(!isNaN(v[0]) ? "_" : "" ) + v] = a[v];
688 | }
689 |
690 | is_umts = (network_type == "HSPA" || network_type == "HSDPA" || network_type == "HSUPA" || network_type == "HSPA+" || network_type == "DC-HSPA+" ||
691 | network_type == "UMTS" || network_type == "CDMA" || network_type == "CDMA_EVDO" || network_type == "EVDO_EHRPD" || network_type == "TDSCDMA");
692 |
693 | // MC801 = EN-DC, MC801A = ENDC
694 | is_lte = (network_type == "LTE" || network_type == "ENDC" || network_type == "EN-DC" || network_type == "LTE-NSA");
695 | is_lte_plus = (wan_lte_ca && (wan_lte_ca == "ca_activated" || wan_lte_ca == "ca_deactivated"));
696 |
697 | is_5g_sa = (network_type == "SA");
698 | is_5g_nsa = (network_type == "ENDC" || network_type == "EN-DC" || network_type == "LTE-NSA");
699 | is_5g_nsa_active = is_5g_nsa && network_type != "LTE-NSA";
700 | is_5g = is_5g_sa || is_5g_nsa;
701 |
702 | if (is_umts) $("#umts_signal_container").show();
703 | else $("#umts_signal_container").hide();
704 |
705 | if (is_lte_plus) $("#lte_ca_active_tr").show();
706 | else $("#lte_ca_active_tr").hide();
707 |
708 | if (network_provider_fullname != "") $("#provider").show();
709 | else $("#provider").hide();
710 |
711 | if (cell_id) $("#cell").show();
712 | else $("#cell").hide();
713 |
714 | if (is_5g && nr5g_cell_id) $("#5g_cell").show();
715 | else $("#5g_cell").hide();
716 |
717 | if (tx_power != "" && is_lte && !is_5g_nsa /* Prevent showing an outdated value from an LTE session */)
718 | {
719 | tx_power += " dBm (" + Math.pow(10, tx_power/10.0).toFixed(3) + " mW)";
720 | $("#txp").show();
721 | }
722 | else $("#txp").hide();
723 |
724 | $("#ca_active").html(wan_lte_ca && wan_lte_ca == "ca_activated" ? "✓" : "✕");
725 |
726 | /*
727 | * LTE Cell Info
728 | */
729 |
730 | var lte_cells = parse_lte_cell_info();
731 |
732 | var2html("__lte_signal", lte_cells);
733 |
734 | for (var i = 0; i < 6; i++)
735 | {
736 | var cell_num = i + 1;
737 | if (is_lte && lte_cells.length > i)
738 | {
739 | var lte_cell = lte_cells[i];
740 | if (lte_cell.rsrp1 != "")
741 | {
742 | $("#lte_" + cell_num + "_rsrp").show();
743 | $("#lte_" + cell_num + "_sinr").show();
744 | $("#lte_" + cell_num + "_rsrq").show();
745 | }
746 | else
747 | {
748 | $("#lte_" + cell_num + "_rsrp").hide();
749 | $("#lte_" + cell_num + "_sinr").hide();
750 | $("#lte_" + cell_num + "_rsrq").hide();
751 | }
752 | $("#lte_" + cell_num).show();
753 | }
754 | else $("#lte_" + cell_num).hide();
755 | }
756 |
757 | var lte_bands = get_band_info(lte_cells);
758 |
759 | /*
760 | * LTE Cell Info End
761 | */
762 |
763 | /*
764 | * NR Cell Info
765 | */
766 |
767 | var nr_cells = parse_nr_cell_info();
768 |
769 | var2html("__nr_signal", nr_cells);
770 |
771 | for (var i = 1; i <= 3; i++)
772 | {
773 | if (is_5g && nr_cells.length >= i) $("#5g_" + i).show();
774 | else $("#5g_" + i).hide();
775 | }
776 |
777 | if (nr_cells.length > 0)
778 | {
779 | if (nr_cells[0].rsrp2 != "") $("#5g_1_rsrp2").show();
780 | else $("#5g_1_rsrp2").hide();
781 |
782 | // Not available with NSA
783 | if (nr_cells[0].bandwidth != "") $("#5g_1_bandwidth").show();
784 | else $("#5g_1_bandwidth").hide();
785 | }
786 |
787 | var nr_bands = get_band_info(nr_cells);
788 |
789 | /*
790 | * NR Cell Info End
791 | */
792 |
793 | /*
794 | * Band info
795 | */
796 |
797 | var bandinfo = lte_bands;
798 |
799 | if (nr_bands != "")
800 | {
801 | if (bandinfo != "") bandinfo += " + ";
802 | bandinfo += nr_bands;
803 | }
804 |
805 | if (bandinfo != "")
806 | {
807 | $("#__bandinfo").html(bandinfo);
808 | $("#bandinfo").show();
809 | }
810 | else $("#bandinfo").hide();
811 |
812 | /*
813 | * Band info end
814 | */
815 |
816 | if (is_umts && lte_ca_pcell_band)
817 | $("#umts_signal_table_main_band").html(" (" + lte_ca_pcell_band + ")");
818 |
819 | if (ngbr_cell_info)
820 | {
821 | if (is_lte)
822 | {
823 | var ngbr_cells = ngbr_cell_info.split(";");
824 | if (ngbr_cells.length > 0)
825 | {
826 | var html = "
";
827 | for (var i = 0; i < ngbr_cells.length; i++)
828 | {
829 | var cell = ngbr_cells[i];
830 | var [freq, pci, rsrq, rsrp, rssi] = cell.split(",");
831 | html += ""+ pci + ": | RSRP: " + rsrp + " dBm | RSRQ: " + rsrq + " dB |
";
832 | }
833 | html += "
";
834 | }
835 | ngbr_cell_info = html;
836 | }
837 | else
838 | {
839 | ngbr_cell_info = ngbr_cell_info.replace(";", "
");
840 | }
841 |
842 | $("#ngbr_cells").show();
843 | }
844 | else
845 | {
846 | $("#ngbr_cells").hide();
847 | }
848 |
849 | if (wan_ipaddr) $("#wanipinfo").show();
850 | else $("#wanipinfo").hide();
851 |
852 | if (pm_sensor_ambient || pm_sensor_mdm || pm_sensor_5g || pm_sensor_pa1 || wifi_chip_temp)
853 | {
854 | var temp = "";
855 | if (pm_sensor_ambient && pm_sensor_ambient > -40) temp += (temp ? " " : "") + "A: " + pm_sensor_ambient + "°c";
856 | if (pm_sensor_mdm && pm_sensor_mdm > -40) temp += (temp ? " " : "") + "M: " + pm_sensor_mdm + "°c";
857 | if (pm_sensor_5g && pm_sensor_5g > -40) temp += (temp ? " " : "") + "5G: " + pm_sensor_mdm + "°c";
858 | if (pm_sensor_pa1 && pm_sensor_pa1 > -40) temp += (temp ? " " : "") + "P: " + pm_sensor_pa1 + "°c";
859 | if (wifi_chip_temp && wifi_chip_temp > -40) temp += (temp ? " " : "") + "W: " + wifi_chip_temp + "°c";
860 | $("#temps").html(temp);
861 | $("#temperature").show();
862 | }
863 | else $("#temperature").hide();
864 |
865 | for (e = 0; e < vars.length; e++)
866 | {
867 | v = vars[e];
868 | v = (!isNaN(v[0]) ? "_" : "" ) + v;
869 | $("#" + v).html(window[v]);
870 | }
871 | }
872 | })
873 | }
874 |
875 | function err(a, e, n)
876 | {
877 | alert("Communication Error"), console.log(a), console.log(e), console.log(n)
878 | }
879 |
880 | function set_net_mode(mode = null)
881 | {
882 | var modes = [
883 | "Only_GSM",
884 | "Only_WCDMA",
885 | "Only_LTE",
886 | "WCDMA_AND_GSM",
887 | "WCDMA_preferred",
888 | "WCDMA_AND_LTE",
889 | "GSM_AND_LTE",
890 | "CDMA_EVDO_LTE",
891 | "Only_TDSCDMA",
892 | "TDSCDMA_AND_WCDMA",
893 | "TDSCDMA_AND_LTE",
894 | "TDSCDMA_WCDMA_HDR_CDMA_GSM_LTE",
895 | "TDSCDMA_WCDMA_GSM_LTE",
896 | "GSM_WCDMA_LTE",
897 | "Only_5G",
898 | "LTE_AND_5G",
899 | "GWL_5G",
900 | "TCHGWL_5G",
901 | "WL_AND_5G",
902 | "TGWL_AND_5G",
903 | "4G_AND_5G"
904 | ];
905 |
906 | mode = mode || prompt("Enter one of\n" + modes.join(", "), "WL_AND_5G");
907 | if (!mode) return;
908 |
909 | $.ajax({
910 | type: "GET",
911 | url: "/goform/goform_get_cmd_process",
912 | data:
913 | {
914 | cmd: "wa_inner_version,cr_version,RD",
915 | multi_data: "1"
916 | },
917 | dataType: "json",
918 | success: function(a)
919 | {
920 | ad = hash(hash(a.wa_inner_version + a.cr_version) + a.RD);
921 | $.ajax({
922 | type: "POST",
923 | url: "/goform/goform_set_cmd_process",
924 | data:
925 | {
926 | isTest: "false",
927 | goformId: "SET_BEARER_PREFERENCE",
928 | BearerPreference: mode,
929 | AD: ad
930 | },
931 | success: function(a)
932 | {
933 | console.log(a);
934 | j = JSON.parse(a);
935 | if ("success" != j.result)
936 | alert("Setting mode to '" + mode + "' failed");
937 | },
938 | error: err
939 | })
940 | }
941 | })
942 |
943 | }
944 |
945 | function lte_cell_lock(reset = false) {
946 | var lockParameters;
947 |
948 | if (reset) {
949 | lockParameters = ["0", "0"];
950 | } else {
951 | var defaultPciEarfcn = parseInt(lte_pci, 16) + "," + wan_active_channel;
952 | var cellLockDetails = prompt("Please input PCI,EARFCN, separated by ',' char (example 116,3350). "+
953 | "Leave default for lock on current main band.", defaultPciEarfcn);
954 |
955 | if (cellLockDetails === null || cellLockDetails.trim() === "") {
956 | return;
957 | }
958 |
959 | var inputValues = cellLockDetails.split(",");
960 | var pciIsValid = !isNaN(inputValues[0]) && Number.isInteger(parseFloat(inputValues[0]));
961 | var earfcnIsValid = !isNaN(inputValues[1]) && Number.isInteger(parseFloat(inputValues[1]));
962 |
963 | if (!pciIsValid || !earfcnIsValid) {
964 | alert("Invalid input. Please ensure all values are correctly formatted.");
965 | return;
966 | }
967 |
968 | lockParameters = inputValues;
969 | }
970 |
971 | $.ajax({
972 | type: "GET",
973 | url: "/goform/goform_get_cmd_process",
974 | data: {
975 | cmd: "wa_inner_version,cr_version,RD",
976 | multi_data: "1"
977 | },
978 | dataType: "json",
979 | success: function(a) {
980 | ad = hash(hash(a.wa_inner_version + a.cr_version) + a.RD);
981 | $.ajax({
982 | type: "POST",
983 | url: "/goform/goform_set_cmd_process",
984 | data: {
985 | isTest: "false",
986 | goformId: "LTE_LOCK_CELL_SET",
987 | lte_pci_lock: lockParameters[0],
988 | lte_earfcn_lock: lockParameters[1],
989 | AD: ad
990 | },
991 | success: function(a) {
992 | var response = JSON.parse(a);
993 | if (response.result === "success") {
994 |
995 | var rebootMessage =
996 | "You have to reboot your Router in order " +
997 | (reset ? "to remove the cell lock" : "for the cell lock to be active") + ".\n\nReboot now?";
998 |
999 | if (confirm(rebootMessage)) {
1000 | reboot(true);
1001 | }
1002 | } else {
1003 | alert("Error.");
1004 | }
1005 | },
1006 | error: function(err) {
1007 | console.error(err);
1008 | alert("An error occurred while attempting to lock the cell.");
1009 | }
1010 | });
1011 | }
1012 | });
1013 | }
1014 |
1015 | function nr_cell_lock(reset = false) {
1016 | var cellLockDetails;
1017 |
1018 | if (reset) {
1019 | cellLockDetails = "0,0,0,0";
1020 | } else {
1021 | var nrCellInfo = parse_nr_cell_info();
1022 | var defaultCellDetails = "";
1023 |
1024 | if (nrCellInfo.length > 0) {
1025 | var primaryNrCell = nrCellInfo[0];
1026 | defaultCellDetails = primaryNrCell.pci + ',' + primaryNrCell.arfcn + ',' + primaryNrCell.band.replace('n', '') + ',' + "30";
1027 | }
1028 |
1029 | cellLockDetails = prompt("Please input PCI,ARFCN,BAND,SCS separated by ',' char (example 202,639936,78,30). " +
1030 | "Leave default for locking the current NR primary band. You may need to adjust the SCS.", defaultCellDetails);
1031 |
1032 | if (cellLockDetails === null || cellLockDetails.trim() === "") {
1033 | return;
1034 | } else {
1035 | var inputValues = cellLockDetails.split(",");
1036 |
1037 | var pciIsValid = !isNaN(inputValues[0]) && Number.isInteger(parseFloat(inputValues[0]));
1038 | var arfcnIsValid = !isNaN(inputValues[1]) && Number.isInteger(parseFloat(inputValues[1]));
1039 | var bandIsValid = !isNaN(inputValues[2]) && Number.isInteger(parseFloat(inputValues[2]));
1040 | var scsIsValid = ["15", "30", "60", "120", "240"].includes(inputValues[3]);
1041 |
1042 | if (!pciIsValid || !arfcnIsValid || !bandIsValid || !scsIsValid) {
1043 | alert("Invalid input. Please ensure all values are correctly formatted.");
1044 | return;
1045 | }
1046 | }
1047 | }
1048 |
1049 | $.ajax({
1050 | type: "GET",
1051 | url: "/goform/goform_get_cmd_process",
1052 | data: {
1053 | cmd: "wa_inner_version,cr_version,RD",
1054 | multi_data: "1"
1055 | },
1056 | dataType: "json",
1057 | success: function(a) {
1058 | ad = hash(hash(a.wa_inner_version + a.cr_version) + a.RD);
1059 | $.ajax({
1060 | type: "POST",
1061 | url: "/goform/goform_set_cmd_process",
1062 | data: {
1063 | isTest: "false",
1064 | goformId: "NR5G_LOCK_CELL_SET",
1065 | nr5g_cell_lock: cellLockDetails,
1066 | AD: ad
1067 | },
1068 | success: function(a) {
1069 | var response = JSON.parse(a);
1070 | if (response.result === "success") {
1071 |
1072 | var rebootMessage =
1073 | "You have to reboot your Router in order " +
1074 | (reset ? "to remove the cell lock" : "for the cell lock to be active")+ ".\n\nReboot now?";
1075 |
1076 | if (confirm(rebootMessage)) {
1077 | reboot(true);
1078 | }
1079 | } else {
1080 | alert("Error.");
1081 | }
1082 | },
1083 | error: function(err) {
1084 | console.error(err);
1085 | alert("An error occurred while attempting to lock the cell.");
1086 | }
1087 | });
1088 | }
1089 | });
1090 | }
1091 |
1092 | function lte_band_selection(a = null, nested_attempt_with_dev_login = false)
1093 | {
1094 | a = a || prompt("Please input LTE bands number, separated by + char (example 1+3+20). If you want to use every supported band, write 'AUTO'.", "AUTO");
1095 |
1096 | var had_admin_password_hash = have_admin_password_hash();
1097 |
1098 | if (null != (a = a && a.toLowerCase()) && "" !== a)
1099 | {
1100 | var e = a.split("+");
1101 | var n = 0;
1102 | var all_bands = "0xA3E2AB0908DF";
1103 |
1104 | if ("AUTO" === a.toUpperCase())
1105 | {
1106 | n = all_bands;
1107 | }
1108 | else
1109 | {
1110 | for (var l = 0; l < e.length; l++) n += Math.pow(2, parseInt(e[l]) - 1);
1111 | n = n.toString(16);
1112 | n = "0x" + (Math.pow(10, 11 - n.length) + n + "").substr(1);
1113 | }
1114 |
1115 | $.ajax({
1116 | type: "GET",
1117 | url: "/goform/goform_get_cmd_process",
1118 | data:
1119 | {
1120 | cmd: "wa_inner_version,cr_version,RD",
1121 | multi_data: "1"
1122 | },
1123 | dataType: "json",
1124 | success: function(a)
1125 | {
1126 | ad = hash(hash(a.wa_inner_version + a.cr_version) + a.RD), $.ajax({
1127 | type: "POST",
1128 | url: "/goform/goform_set_cmd_process",
1129 | data:
1130 | {
1131 | isTest: "false",
1132 | goformId: "BAND_SELECT",
1133 | is_gw_band: 0,
1134 | gw_band_mask: 0,
1135 | is_lte_band: 1,
1136 | lte_band_mask: n,
1137 | AD: ad
1138 | },
1139 | success: function(a)
1140 | {
1141 | console.log(a);
1142 |
1143 | var j = JSON.parse(a);
1144 |
1145 | if ("success" == j.result)
1146 | {
1147 | if (nested_attempt_with_dev_login)
1148 | {
1149 | if (!had_admin_password_hash)
1150 | alert("Successfully performed LTE band lock with developer login ...");
1151 | }
1152 | }
1153 | else
1154 | {
1155 | if (!nested_attempt_with_dev_login && !logged_in_as_developer)
1156 | {
1157 | if (!had_admin_password_hash)
1158 | {
1159 | alert("LTE band locking failed.\n\n" +
1160 | "Your device model may require to log in as developer\n" +
1161 | "in order to be able to lock LTE bands.");
1162 | }
1163 |
1164 | perform_login(
1165 | function() {
1166 | logged_in_as_developer = true;
1167 | lte_band_selection(a, true);
1168 | }, true);
1169 | }
1170 | else
1171 | {
1172 | alert("LTE band locking with developer login still failed.\nThere might be something else wrong.");
1173 | }
1174 | }
1175 | },
1176 | error: err
1177 | })
1178 | }
1179 | })
1180 | }
1181 | }
1182 |
1183 | function nr_band_selection(a)
1184 | {
1185 | var e;
1186 | var a = a || prompt("Please input 5G bands number, separated by + char (example 3+78). If you want to use every supported band, write 'AUTO'.", "AUTO");
1187 |
1188 | null != a && "" !== a && (e = a.split("+").join(","));
1189 | "AUTO" === a.toUpperCase() && (e = "1,2,3,5,7,8,20,28,38,41,50,51,66,70,71,74,75,76,77,78,79,80,81,82,83,84");
1190 |
1191 | $.ajax({
1192 | type: "GET",
1193 | url: "/goform/goform_get_cmd_process",
1194 | data:
1195 | {
1196 | cmd: "wa_inner_version,cr_version,RD",
1197 | multi_data: "1"
1198 | },
1199 | dataType: "json",
1200 | success: function(a)
1201 | {
1202 | ad = hash(hash(a.wa_inner_version + a.cr_version) + a.RD), $.ajax({
1203 | type: "POST",
1204 | url: "/goform/goform_set_cmd_process",
1205 | data:
1206 | {
1207 | isTest: "false",
1208 | goformId: "WAN_PERFORM_NR5G_BAND_LOCK",
1209 | nr5g_band_mask: e,
1210 | AD: ad
1211 | },
1212 | success: function(a)
1213 | {
1214 | console.log(a);
1215 | },
1216 | error: err
1217 | })
1218 | }
1219 | });
1220 | }
1221 |
1222 | function bridge_mode(enable)
1223 | {
1224 | if (!confirm((enable ? "Enable" : "Disable") + " bridge mode and reboot router?"))
1225 | return;
1226 |
1227 | $.ajax({
1228 | type: "GET",
1229 | url: "/goform/goform_get_cmd_process",
1230 | data:
1231 | {
1232 | cmd: "wa_inner_version,cr_version,RD",
1233 | multi_data: "1"
1234 | },
1235 | dataType: "json",
1236 | success: function(a)
1237 | {
1238 | ad = hash(hash(a.wa_inner_version + a.cr_version) + a.RD), $.ajax({
1239 | type: "POST",
1240 | url: "/goform/goform_set_cmd_process",
1241 | data:
1242 | {
1243 | isTest: "false",
1244 | goformId: "OPERATION_MODE",
1245 | opMode: (enable ? "LTE_BRIDGE" : "PPP"),
1246 | ethernet_port_specified: "1",
1247 | AD: ad
1248 | },
1249 | success: function(a)
1250 | {
1251 | console.log(a);
1252 | alert("Successfully " + (enable ? "enabled" : "disabled") + " bridge mode! Rebooting ..." +
1253 | (enable ? "\n\nIf your device has multiple LAN port then the lower one\nis the WAN/bridge port!" : ""));
1254 | reboot(true);
1255 | },
1256 | error: err
1257 | })
1258 | }
1259 | })
1260 | }
1261 |
1262 | function arp_proxy(enable)
1263 | {
1264 | if (!confirm((enable ? "Enable" : "Disable") + " ARP proxy and reboot router?"))
1265 | return;
1266 |
1267 | $.ajax({
1268 | type: "GET",
1269 | url: "/goform/goform_get_cmd_process",
1270 | data:
1271 | {
1272 | cmd: "wa_inner_version,cr_version,RD",
1273 | multi_data: "1"
1274 | },
1275 | dataType: "json",
1276 | success: function(a)
1277 | {
1278 | ad = hash(hash(a.wa_inner_version + a.cr_version) + a.RD), $.ajax({
1279 | type: "POST",
1280 | url: "/goform/goform_set_cmd_process",
1281 | data:
1282 | {
1283 | isTest: "false",
1284 | goformId: "ARP_PROXY_SWITCH",
1285 | arp_proxy_switch: enable ? 1 : 0,
1286 | AD: ad
1287 | },
1288 | success: function(a)
1289 | {
1290 | console.log(a);
1291 | alert((enable ? "Enabled" : "Disabled") + " ARP proxy!");
1292 | reboot(true);
1293 | },
1294 | error: err
1295 | })
1296 | }
1297 | })
1298 | }
1299 |
1300 | function reboot(force = false)
1301 | {
1302 | if (!force && !confirm("Reboot Router?"))
1303 | return
1304 |
1305 | $.ajax({
1306 | type: "GET",
1307 | url: "/goform/goform_get_cmd_process",
1308 | data:
1309 | {
1310 | cmd: "wa_inner_version,cr_version,RD",
1311 | multi_data: "1"
1312 | },
1313 | dataType: "json",
1314 | success: function(a)
1315 | {
1316 | ad = hash(hash(a.wa_inner_version + a.cr_version) + a.RD), $.ajax({
1317 | type: "POST",
1318 | url: "/goform/goform_set_cmd_process",
1319 | data:
1320 | {
1321 | isTest: "false",
1322 | goformId: "REBOOT_DEVICE",
1323 | AD: ad
1324 | },
1325 | success: function(a)
1326 | {
1327 | console.log(a);
1328 | if (!force) alert("Rebooting ...");
1329 | },
1330 | error: err
1331 | })
1332 | }
1333 | })
1334 | }
1335 |
1336 | function version_info()
1337 | {
1338 | $.ajax({
1339 | type: "GET",
1340 | url: "/goform/goform_get_cmd_process",
1341 | data:
1342 | {
1343 | cmd: "hardware_version,web_version,wa_inner_version,cr_version,RD",
1344 | multi_data: "1"
1345 | },
1346 | dataType: "json",
1347 | success: function(a)
1348 | {
1349 | v = "HW version: " + a.hardware_version + "\nWEB version: " + a.web_version + "\nWA INNER version: " + a.wa_inner_version;
1350 | alert(v);
1351 | }
1352 | })
1353 | }
1354 |
1355 | function inject_main_container_if_missing() {
1356 | // Newer models like the MC888 Ultra don't have a main container anymore.
1357 | // Inject a fake one to get the script working.
1358 |
1359 | if (!$("#mainContainer").length) {
1360 | $("body").prepend(`
1361 |
1362 |
1376 |
1377 | `);
1378 | }
1379 | }
1380 |
1381 | function inject_html()
1382 | {
1383 | inject_main_container_if_missing();
1384 |
1385 | $(".color_background_blue").css("background-color", "#456");
1386 | $(".headcontainer").hide();
1387 |
1388 | $("#mainContainer").prepend(`
1389 |
1518 |
1519 |
1520 |
1521 |
1522 |
1523 |
1524 |
1525 |
1526 |
1527 | LTE () |
1528 |
1529 |
1530 | RSRP1: |
1531 | dBm |
1532 | SINR1: |
1533 | dB |
1534 |
1535 |
1536 | RSRP2: |
1537 | dBm |
1538 | SINR2: |
1539 | dB |
1540 |
1541 |
1542 | RSRP3: |
1543 | dBm |
1544 | SINR3: |
1545 | dB |
1546 |
1547 |
1548 | RSRP4: |
1549 | dBm |
1550 | SINR4: |
1551 | dB |
1552 |
1553 |
1554 | RSRQ: |
1555 | dB |
1556 | RSSI: |
1557 | dBm |
1558 |
1559 |
1560 | EARFCN: |
1561 | |
1562 |
1563 |
1564 | PCI: |
1565 | |
1566 |
1567 |
1568 | BW: |
1569 | MHz |
1570 |
1571 |
1572 |
1573 |
1574 |
1575 |
1576 |
1577 |
1578 | LTE () |
1579 |
1580 |
1581 | RSRP: |
1582 | dBm |
1583 |
1584 |
1585 | SINR: |
1586 | dB |
1587 |
1588 |
1589 | RSRQ: |
1590 | dB |
1591 |
1592 |
1593 | EARFCN: |
1594 | |
1595 |
1596 |
1597 | PCI: |
1598 | |
1599 |
1600 |
1601 | BW: |
1602 | MHz |
1603 |
1604 |
1605 |
1606 |
1607 |
1608 |
1609 |
1610 | LTE () |
1611 |
1612 |
1613 | RSRP: |
1614 | dBm |
1615 |
1616 |
1617 | SINR: |
1618 | dB |
1619 |
1620 |
1621 | RSRQ: |
1622 | dB |
1623 |
1624 |
1625 | EARFCN: |
1626 | |
1627 |
1628 |
1629 | PCI: |
1630 | |
1631 |
1632 |
1633 | BW: |
1634 | MHz |
1635 |
1636 |
1637 |
1638 |
1639 |
1640 |
1641 |
1642 | LTE () |
1643 |
1644 |
1645 | RSRP: |
1646 | dBm |
1647 |
1648 |
1649 | SINR: |
1650 | dB |
1651 |
1652 |
1653 | RSRQ: |
1654 | dB |
1655 |
1656 |
1657 | EARFCN: |
1658 | |
1659 |
1660 |
1661 | PCI: |
1662 | |
1663 |
1664 |
1665 | BW: |
1666 | MHz |
1667 |
1668 |
1669 |
1670 |
1671 |
1672 |
1673 |
1674 | LTE () |
1675 |
1676 |
1677 | RSRP: |
1678 | dBm |
1679 |
1680 |
1681 | SINR: |
1682 | dB |
1683 |
1684 |
1685 | RSRQ: |
1686 | dB |
1687 |
1688 |
1689 | EARFCN: |
1690 | |
1691 |
1692 |
1693 | PCI: |
1694 | |
1695 |
1696 |
1697 | BW: |
1698 | MHz |
1699 |
1700 |
1701 |
1702 |
1703 |
1704 |
1705 |
1706 | LTE () |
1707 |
1708 |
1709 | RSRP: |
1710 | dBm |
1711 |
1712 |
1713 | SINR: |
1714 | dB |
1715 |
1716 |
1717 | RSRQ: |
1718 | dB |
1719 |
1720 |
1721 | EARFCN: |
1722 | |
1723 |
1724 |
1725 | PCI: |
1726 | |
1727 |
1728 |
1729 | BW: |
1730 | MHz |
1731 |
1732 |
1733 |
1734 |
1735 |
1736 |
1737 |
1738 |
1739 |
1740 | UMTS |
1741 |
1742 |
1743 | RSCP1: |
1744 | dBm |
1745 | ECIO1: |
1746 | - dB |
1747 |
1748 |
1749 | RSCP2: |
1750 | dBm |
1751 | ECIO2: |
1752 | - dB |
1753 |
1754 |
1755 | RSCP3: |
1756 | dBm |
1757 | ECIO3: |
1758 | - dB |
1759 |
1760 |
1761 | RSCP4: |
1762 | dBm |
1763 | ECIO4: |
1764 | - dB |
1765 |
1766 |
1767 |
1768 |
1769 |
1770 |
1771 |
1772 |
1773 |
1774 |
1775 | 5G ()
1776 |
1777 | |
1778 |
1779 |
1780 | RSRP1: |
1781 | dBm |
1782 |
1783 |
1784 | RSRP2: |
1785 | dBm |
1786 |
1787 |
1788 | SINR: |
1789 | dB |
1790 |
1791 |
1792 | ARFCN: |
1793 | |
1794 |
1795 |
1796 | PCI: |
1797 | |
1798 |
1799 |
1800 | BW: |
1801 | MHz |
1802 |
1803 |
1804 |
1805 |
1806 |
1807 |
1808 |
1809 |
1810 |
1811 |
1812 | 5G ()
1813 |
1814 | |
1815 |
1816 |
1817 | RSRP: |
1818 | dBm |
1819 |
1820 |
1821 | SINR: |
1822 | dB |
1823 |
1824 |
1825 | ARFCN: |
1826 | |
1827 |
1828 |
1829 | PCI: |
1830 | |
1831 |
1832 |
1833 | BW: |
1834 | MHz |
1835 |
1836 |
1837 |
1838 |
1839 |
1840 |
1841 |
1842 |
1843 |
1844 | 5G ()
1845 |
1846 | |
1847 |
1848 |
1849 | RSRP: |
1850 | dBm |
1851 |
1852 |
1853 | SINR: |
1854 | dB |
1855 |
1856 |
1857 | ARFCN: |
1858 | |
1859 |
1860 |
1861 | PCI: |
1862 | |
1863 |
1864 |
1865 | BW: |
1866 | MHz |
1867 |
1868 |
1869 |
1870 |
1871 |
1872 |
1873 |
1874 |
1875 |
1876 | PROVIDER: |
1877 | |
1878 |
1879 |
1880 | CELL: |
1881 | |
1882 |
1883 |
1884 | 5G CELL: |
1885 | |
1886 |
1887 |
1888 | NGBR: |
1889 | |
1890 |
1891 |
1892 | TX POWER: |
1893 | |
1894 |
1895 |
1896 | CONNECTION: |
1897 | |
1898 |
1899 |
1900 | BANDS: |
1901 |
1902 |
1903 | |
1904 |
1905 |
1906 | LTE CA ACTIVE: |
1907 | |
1908 |
1909 |
1910 | WAN IP: |
1911 | |
1912 |
1913 |
1914 | TEMP: |
1915 | |
1916 |
1917 |
1918 |
1919 |
1920 |
1921 |
1922 |
1923 |
1924 |
1997 |
1998 |
1999 |
2000 |
2001 |
2002 | `)
2003 | }
2004 |
2005 | function set_config(key, value){
2006 | if (typeof require.s.contexts._.defined["config/config"][key] === "undefined") {
2007 | console.log("Config key not found, setting it anyway: " + key);
2008 | } else {
2009 | console.log("Previous config value: " + require.s.contexts._.defined["config/config"][key]);
2010 | }
2011 | console.log("Setting config: " + key + " to " + value);
2012 | require.s.contexts._.defined["config/config"][key] = value;
2013 | }
2014 |
2015 | function config_SHOW_APN_DNS(){
2016 | const value = prompt("Show APN DNS settings? (true/false)", "true");
2017 | set_config("SHOW_APN_DNS", value === "true");
2018 | }
2019 |
2020 | prepare_1_timer_id = window.setInterval(prepare_1, 250);
2021 | prepare_1();
2022 |
2023 | $("#change").prop("disabled", !1);
2024 |
2025 | $("#umts_signal_container").hide();
2026 | for (var i = 1; i <= 3; i++) $("#5g_" + i).hide();
2027 | for (var i = 1; i <= 6; i++) $("#lte_" + i).hide();
2028 | $("#lte_ca_active_tr").hide();
2029 | $("#provider").hide();
2030 | $("#cell").hide();
2031 | $("#5g_cell").hide();
2032 | $("#ngbr_cells").hide();
2033 | $("#txp").hide();
2034 | $("#temperature").hide();
2035 | $("#wanipinfo").hide();
2036 |
--------------------------------------------------------------------------------