@depup/systeminformation 5.31.5-depup.0 → 5.33.6-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/changes.json +1 -1
- package/lib/audio.js +62 -8
- package/lib/battery.js +6 -2
- package/lib/bluetooth.js +6 -2
- package/lib/cpu.js +108 -60
- package/lib/docker.js +50 -62
- package/lib/dockerSocket.js +56 -261
- package/lib/filesystem.js +132 -28
- package/lib/graphics.js +175 -89
- package/lib/index.d.ts +6 -8
- package/lib/index.js +4 -2
- package/lib/memory.js +14 -5
- package/lib/network.js +59 -73
- package/lib/osinfo.js +28 -9
- package/lib/printer.js +5 -5
- package/lib/processes.js +49 -15
- package/lib/system.js +3 -4
- package/lib/usb.js +0 -4
- package/lib/util.js +93 -20
- package/lib/virtualbox.js +10 -4
- package/lib/wifi.js +40 -44
- package/package.json +6 -5
package/lib/util.js
CHANGED
|
@@ -201,14 +201,15 @@ function parseTime(t, pmDesignator) {
|
|
|
201
201
|
if (parts[2]) {
|
|
202
202
|
parts[1] += parts[2];
|
|
203
203
|
}
|
|
204
|
+
const p1 = (parts[1] || '').toLowerCase();
|
|
204
205
|
let isPM =
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
(pmDesignator &&
|
|
206
|
+
p1.indexOf('pm') > -1 ||
|
|
207
|
+
p1.indexOf('p.m.') > -1 ||
|
|
208
|
+
p1.indexOf('p. m.') > -1 ||
|
|
209
|
+
p1.indexOf('n') > -1 ||
|
|
210
|
+
p1.indexOf('ch') > -1 ||
|
|
211
|
+
p1.indexOf('ös') > -1 ||
|
|
212
|
+
(pmDesignator && p1.indexOf(pmDesignator) > -1);
|
|
212
213
|
hour = parseInt(parts[0], 10);
|
|
213
214
|
min = parseInt(parts[1], 10);
|
|
214
215
|
hour = isPM && hour < 12 ? hour + 12 : hour;
|
|
@@ -364,7 +365,8 @@ function getPowershell() {
|
|
|
364
365
|
}
|
|
365
366
|
|
|
366
367
|
function getVboxmanage() {
|
|
367
|
-
|
|
368
|
+
const vboxPath = (process.env.VBOX_INSTALL_PATH || process.env.VBOX_MSI_INSTALL_PATH || '').replace(/["%!^&|<>`$;\r\n]/g, '');
|
|
369
|
+
return _windows ? `"${vboxPath}\\VBoxManage.exe"` : 'vboxmanage';
|
|
368
370
|
}
|
|
369
371
|
|
|
370
372
|
function powerShellProceedResults(data) {
|
|
@@ -410,9 +412,12 @@ function powerShellStart() {
|
|
|
410
412
|
_psPersistent = true;
|
|
411
413
|
_psChild.stdout.on('data', (data) => {
|
|
412
414
|
_psResult = _psResult + data.toString('utf8');
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
415
|
+
let sepIndex = _psResult.indexOf(_psCmdSeperator);
|
|
416
|
+
while (sepIndex >= 0) {
|
|
417
|
+
const end = sepIndex + _psCmdSeperator.length;
|
|
418
|
+
powerShellProceedResults(_psResult.slice(0, end));
|
|
419
|
+
_psResult = _psResult.slice(end);
|
|
420
|
+
sepIndex = _psResult.indexOf(_psCmdSeperator);
|
|
416
421
|
}
|
|
417
422
|
});
|
|
418
423
|
_psChild.stderr.on('data', () => {
|
|
@@ -621,7 +626,7 @@ function smartMonToolsInstalled() {
|
|
|
621
626
|
const pathArray = execSync('which smartctl 2>/dev/null', execOptsLinux).toString().split('\r\n');
|
|
622
627
|
_smartMonToolsInstalled = pathArray.length > 0;
|
|
623
628
|
} catch {
|
|
624
|
-
|
|
629
|
+
noop();
|
|
625
630
|
}
|
|
626
631
|
}
|
|
627
632
|
return _smartMonToolsInstalled;
|
|
@@ -734,6 +739,9 @@ function sanitizeShellString(str, strict) {
|
|
|
734
739
|
s[i] === '&' ||
|
|
735
740
|
s[i] === ']' ||
|
|
736
741
|
s[i] === '#' ||
|
|
742
|
+
s[i] === '%' ||
|
|
743
|
+
s[i] === '!' ||
|
|
744
|
+
s[i] === '^' ||
|
|
737
745
|
s[i] === '\\' ||
|
|
738
746
|
s[i] === '\t' ||
|
|
739
747
|
s[i] === '\n' ||
|
|
@@ -757,6 +765,20 @@ function sanitizeShellString(str, strict) {
|
|
|
757
765
|
return result;
|
|
758
766
|
}
|
|
759
767
|
|
|
768
|
+
function sanitizeContainerID(str) {
|
|
769
|
+
const s = String(str || '')
|
|
770
|
+
.substring(0, 2000)
|
|
771
|
+
.replace(/[^a-zA-Z0-9_.,*-]/g, '');
|
|
772
|
+
return s.indexOf('..') === -1 ? s : '';
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
function sanitizeImageID(str) {
|
|
776
|
+
const s = String(str || '')
|
|
777
|
+
.substring(0, 2000)
|
|
778
|
+
.replace(/[^a-zA-Z0-9_.,:@/-]/g, '');
|
|
779
|
+
return s.indexOf('..') === -1 ? s : '';
|
|
780
|
+
}
|
|
781
|
+
|
|
760
782
|
function isPrototypePolluted() {
|
|
761
783
|
const s = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
762
784
|
let notPolluted = true;
|
|
@@ -830,6 +852,22 @@ function isPrototypePolluted() {
|
|
|
830
852
|
return !notPolluted;
|
|
831
853
|
}
|
|
832
854
|
|
|
855
|
+
function sanitizeString(str, strict) {
|
|
856
|
+
if (typeof strict === 'undefined') {
|
|
857
|
+
strict = false;
|
|
858
|
+
}
|
|
859
|
+
let result = '';
|
|
860
|
+
const s = isPrototypePolluted() ? '---' : sanitizeShellString(str, strict);
|
|
861
|
+
const l = mathMin(s.length, 2000);
|
|
862
|
+
|
|
863
|
+
for (let i = 0; i <= l; i++) {
|
|
864
|
+
if (s[i] !== undefined) {
|
|
865
|
+
result = result + s[i];
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
return result;
|
|
869
|
+
}
|
|
870
|
+
|
|
833
871
|
function hex2bin(hex) {
|
|
834
872
|
return ('00000000' + parseInt(hex, 16).toString(2)).substr(-8);
|
|
835
873
|
}
|
|
@@ -1149,7 +1187,7 @@ function promiseAll(promises) {
|
|
|
1149
1187
|
}
|
|
1150
1188
|
|
|
1151
1189
|
function promisify(nodeStyleFunction) {
|
|
1152
|
-
return ()
|
|
1190
|
+
return function () {
|
|
1153
1191
|
const args = Array.prototype.slice.call(arguments);
|
|
1154
1192
|
return new Promise((resolve, reject) => {
|
|
1155
1193
|
args.push((err, data) => {
|
|
@@ -1165,7 +1203,7 @@ function promisify(nodeStyleFunction) {
|
|
|
1165
1203
|
}
|
|
1166
1204
|
|
|
1167
1205
|
function promisifySave(nodeStyleFunction) {
|
|
1168
|
-
return ()
|
|
1206
|
+
return function () {
|
|
1169
1207
|
const args = Array.prototype.slice.call(arguments);
|
|
1170
1208
|
return new Promise((resolve) => {
|
|
1171
1209
|
args.push((err, data) => {
|
|
@@ -1269,7 +1307,7 @@ function plistParser(xmlStr) {
|
|
|
1269
1307
|
if (depth > 1 && metaData[depth - 2].tagStart === 'array') {
|
|
1270
1308
|
metaData[depth - 2].data.push(metaData[depth - 1].data);
|
|
1271
1309
|
}
|
|
1272
|
-
if (depth > 1 && metaData[depth - 2].tagStart === 'dict') {
|
|
1310
|
+
if (depth > 1 && metaData[depth - 2].tagStart === 'dict' && !isProtoKey(metaData[depth - 1].key)) {
|
|
1273
1311
|
metaData[depth - 2].data[metaData[depth - 1].key] = metaData[depth - 1].data;
|
|
1274
1312
|
}
|
|
1275
1313
|
depth--;
|
|
@@ -1299,7 +1337,7 @@ function plistParser(xmlStr) {
|
|
|
1299
1337
|
if (depth > 0 && metaData[depth - 1].tagStart === 'array') {
|
|
1300
1338
|
metaData[depth - 1].data.push(metaData[depth].data);
|
|
1301
1339
|
}
|
|
1302
|
-
if (depth > 0 && metaData[depth - 1].tagStart === 'dict') {
|
|
1340
|
+
if (depth > 0 && metaData[depth - 1].tagStart === 'dict' && !isProtoKey(metaData[depth].key)) {
|
|
1303
1341
|
metaData[depth - 1].data[metaData[depth].key] = metaData[depth].data;
|
|
1304
1342
|
}
|
|
1305
1343
|
}
|
|
@@ -1373,8 +1411,8 @@ function plistReader(output) {
|
|
|
1373
1411
|
|
|
1374
1412
|
function semverCompare(v1, v2) {
|
|
1375
1413
|
let res = 0;
|
|
1376
|
-
const parts1 = v1.split('.');
|
|
1377
|
-
const parts2 = v2.split('.');
|
|
1414
|
+
const parts1 = v1.split('.').map((p) => parseInt(p, 10) || 0);
|
|
1415
|
+
const parts2 = v2.split('.').map((p) => parseInt(p, 10) || 0);
|
|
1378
1416
|
if (parts1[0] < parts2[0]) {
|
|
1379
1417
|
res = 1;
|
|
1380
1418
|
} else if (parts1[0] > parts2[0]) {
|
|
@@ -1399,12 +1437,30 @@ function semverCompare(v1, v2) {
|
|
|
1399
1437
|
return res;
|
|
1400
1438
|
}
|
|
1401
1439
|
|
|
1440
|
+
// Mac model name and serial number / model identifier
|
|
1441
|
+
|
|
1402
1442
|
function getAppleModel(key) {
|
|
1403
1443
|
const appleModelIds = [
|
|
1404
1444
|
{
|
|
1405
|
-
key: 'Mac17,
|
|
1445
|
+
key: 'Mac17,9',
|
|
1446
|
+
name: 'MacBook Pro',
|
|
1447
|
+
size: '14-inch',
|
|
1448
|
+
processor: 'M5 Pro',
|
|
1449
|
+
year: '2026',
|
|
1450
|
+
additional: ''
|
|
1451
|
+
},
|
|
1452
|
+
{
|
|
1453
|
+
key: 'Mac17,8',
|
|
1406
1454
|
name: 'MacBook Pro',
|
|
1407
1455
|
size: '16-inch',
|
|
1456
|
+
processor: 'M5 Pro',
|
|
1457
|
+
year: '2026',
|
|
1458
|
+
additional: ''
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
key: 'Mac17,7',
|
|
1462
|
+
name: 'MacBook Pro',
|
|
1463
|
+
size: '14-inch',
|
|
1408
1464
|
processor: 'M5 Max',
|
|
1409
1465
|
year: '2026',
|
|
1410
1466
|
additional: ''
|
|
@@ -1412,7 +1468,7 @@ function getAppleModel(key) {
|
|
|
1412
1468
|
{
|
|
1413
1469
|
key: 'Mac17,6',
|
|
1414
1470
|
name: 'MacBook Pro',
|
|
1415
|
-
size: '
|
|
1471
|
+
size: '16-inch',
|
|
1416
1472
|
processor: 'M5 Max',
|
|
1417
1473
|
year: '2026',
|
|
1418
1474
|
additional: ''
|
|
@@ -2702,8 +2758,21 @@ function checkWebsite(url, timeout = 5000) {
|
|
|
2702
2758
|
function cleanString(str) {
|
|
2703
2759
|
return str.replace(/To Be Filled By O.E.M./g, '');
|
|
2704
2760
|
}
|
|
2761
|
+
|
|
2762
|
+
function grep(str, pattern) {
|
|
2763
|
+
const result = str
|
|
2764
|
+
.split('\n')
|
|
2765
|
+
.filter((line) => line.includes(pattern))
|
|
2766
|
+
.join('\n');
|
|
2767
|
+
return result;
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2705
2770
|
function noop() {}
|
|
2706
2771
|
|
|
2772
|
+
function isProtoKey(key) {
|
|
2773
|
+
return key === '__proto__' || key === 'constructor' || key === 'prototype';
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2707
2776
|
exports.toInt = toInt;
|
|
2708
2777
|
exports.splitByNumber = splitByNumber;
|
|
2709
2778
|
exports.execOptsWin = execOptsWin;
|
|
@@ -2732,7 +2801,10 @@ exports.noop = noop;
|
|
|
2732
2801
|
exports.isRaspberry = isRaspberry;
|
|
2733
2802
|
exports.isRaspbian = isRaspbian;
|
|
2734
2803
|
exports.sanitizeShellString = sanitizeShellString;
|
|
2804
|
+
exports.sanitizeContainerID = sanitizeContainerID;
|
|
2805
|
+
exports.sanitizeImageID = sanitizeImageID;
|
|
2735
2806
|
exports.isPrototypePolluted = isPrototypePolluted;
|
|
2807
|
+
exports.sanitizeString = sanitizeString;
|
|
2736
2808
|
exports.decodePiCpuinfo = decodePiCpuinfo;
|
|
2737
2809
|
exports.getRpiGpu = getRpiGpu;
|
|
2738
2810
|
exports.promiseAll = promiseAll;
|
|
@@ -2757,4 +2829,5 @@ exports.semverCompare = semverCompare;
|
|
|
2757
2829
|
exports.getAppleModel = getAppleModel;
|
|
2758
2830
|
exports.checkWebsite = checkWebsite;
|
|
2759
2831
|
exports.cleanString = cleanString;
|
|
2832
|
+
exports.grep = grep;
|
|
2760
2833
|
exports.getPowershell = getPowershell;
|
package/lib/virtualbox.js
CHANGED
|
@@ -35,8 +35,11 @@ function vboxInfo(callback) {
|
|
|
35
35
|
try {
|
|
36
36
|
if (running) {
|
|
37
37
|
const sinceDateObj = new Date(runningSinceString);
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const parsed = Date.parse(sinceDateObj);
|
|
39
|
+
if (!isNaN(parsed)) {
|
|
40
|
+
const offset = sinceDateObj.getTimezoneOffset();
|
|
41
|
+
runningSince = Math.round((Date.now() - parsed) / 1000) + offset * 60;
|
|
42
|
+
}
|
|
40
43
|
}
|
|
41
44
|
} catch {
|
|
42
45
|
util.noop();
|
|
@@ -46,8 +49,11 @@ function vboxInfo(callback) {
|
|
|
46
49
|
try {
|
|
47
50
|
if (!running) {
|
|
48
51
|
const sinceDateObj = new Date(stoppedSinceString);
|
|
49
|
-
const
|
|
50
|
-
|
|
52
|
+
const parsed = Date.parse(sinceDateObj);
|
|
53
|
+
if (!isNaN(parsed)) {
|
|
54
|
+
const offset = sinceDateObj.getTimezoneOffset();
|
|
55
|
+
stoppedSince = Math.round((Date.now() - parsed) / 1000) + offset * 60;
|
|
56
|
+
}
|
|
51
57
|
}
|
|
52
58
|
} catch {
|
|
53
59
|
util.noop();
|
package/lib/wifi.js
CHANGED
|
@@ -18,7 +18,7 @@ const exec = require('child_process').exec;
|
|
|
18
18
|
const execSync = require('child_process').execSync;
|
|
19
19
|
const util = require('./util');
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
const _platform = process.platform;
|
|
22
22
|
|
|
23
23
|
const _linux = _platform === 'linux' || _platform === 'android';
|
|
24
24
|
const _darwin = _platform === 'darwin';
|
|
@@ -26,6 +26,9 @@ const _windows = _platform === 'win32';
|
|
|
26
26
|
|
|
27
27
|
function wifiDBFromQuality(quality) {
|
|
28
28
|
const qual = parseFloat(quality);
|
|
29
|
+
if (isNaN(qual)) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
29
32
|
if (qual < 0) {
|
|
30
33
|
return 0;
|
|
31
34
|
}
|
|
@@ -36,7 +39,11 @@ function wifiDBFromQuality(quality) {
|
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
function wifiQualityFromDB(db) {
|
|
39
|
-
const
|
|
42
|
+
const dbValue = parseFloat(db);
|
|
43
|
+
if (isNaN(dbValue)) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const result = 2 * (dbValue + 100);
|
|
40
47
|
return result <= 100 ? result : 100;
|
|
41
48
|
}
|
|
42
49
|
|
|
@@ -122,7 +129,7 @@ function wifiFrequencyFromChannel(channel) {
|
|
|
122
129
|
|
|
123
130
|
function wifiChannelFromFrequencs(frequency) {
|
|
124
131
|
let channel = 0;
|
|
125
|
-
for (
|
|
132
|
+
for (const key in _wifi_frequencies) {
|
|
126
133
|
if ({}.hasOwnProperty.call(_wifi_frequencies, key)) {
|
|
127
134
|
if (_wifi_frequencies[key] === frequency) {
|
|
128
135
|
channel = util.toInt(key);
|
|
@@ -190,26 +197,33 @@ function nmiDeviceLinux(iface) {
|
|
|
190
197
|
try {
|
|
191
198
|
const lines = execSync(cmd, util.execOptsLinux).toString().split('\n');
|
|
192
199
|
const ssid = util.getValue(lines, 'GENERAL.CONNECTION');
|
|
200
|
+
const uuid = util.getValue(lines, 'GENERAL.CON-UUID');
|
|
193
201
|
return {
|
|
194
202
|
iface,
|
|
195
203
|
type: util.getValue(lines, 'GENERAL.TYPE'),
|
|
196
204
|
vendor: util.getValue(lines, 'GENERAL.VENDOR'),
|
|
197
205
|
product: util.getValue(lines, 'GENERAL.PRODUCT'),
|
|
198
206
|
mac: util.getValue(lines, 'GENERAL.HWADDR').toLowerCase(),
|
|
199
|
-
ssid: ssid !== '--' ? ssid : null
|
|
207
|
+
ssid: ssid !== '--' ? ssid : null,
|
|
208
|
+
uuid: uuid !== '--' ? uuid : null
|
|
200
209
|
};
|
|
201
210
|
} catch {
|
|
202
211
|
return {};
|
|
203
212
|
}
|
|
204
213
|
}
|
|
205
214
|
|
|
206
|
-
function nmiConnectionLinux(
|
|
207
|
-
|
|
215
|
+
function nmiConnectionLinux(uuid) {
|
|
216
|
+
// query by connection UUID instead of SSID: profile names may differ from the SSID
|
|
217
|
+
if (!uuid || !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(uuid)) {
|
|
218
|
+
return {};
|
|
219
|
+
}
|
|
220
|
+
const cmd = `nmcli -t connection show ${uuid} 2>/dev/null`;
|
|
208
221
|
try {
|
|
209
222
|
const lines = execSync(cmd, util.execOptsLinux).toString().split('\n');
|
|
223
|
+
const ssid = util.getValue(lines, '802-11-wireless.ssid');
|
|
210
224
|
const bssid = util.getValue(lines, '802-11-wireless.seen-bssids').toLowerCase();
|
|
211
225
|
return {
|
|
212
|
-
ssid: ssid
|
|
226
|
+
ssid: ssid || null,
|
|
213
227
|
uuid: util.getValue(lines, 'connection.uuid'),
|
|
214
228
|
type: util.getValue(lines, 'connection.type'),
|
|
215
229
|
autoconnect: util.getValue(lines, 'connection.autoconnect') === 'yes',
|
|
@@ -225,7 +239,7 @@ function wpaConnectionLinux(iface) {
|
|
|
225
239
|
if (!iface) {
|
|
226
240
|
return {};
|
|
227
241
|
}
|
|
228
|
-
const cmd = `wpa_cli -i ${iface} status 2>&1`;
|
|
242
|
+
const cmd = `wpa_cli -i ${util.sanitizeString(iface, true)} status 2>&1`;
|
|
229
243
|
try {
|
|
230
244
|
const lines = execSync(cmd, util.execOptsLinux).toString().split('\n');
|
|
231
245
|
const freq = util.toInt(util.getValue(lines, 'freq', '='));
|
|
@@ -280,7 +294,9 @@ function getWifiNetworkListNmi() {
|
|
|
280
294
|
function getWifiNetworkListIw(iface) {
|
|
281
295
|
const result = [];
|
|
282
296
|
try {
|
|
283
|
-
|
|
297
|
+
const iwlistParts = execSync(`export LC_ALL=C; iwlist ${util.sanitizeString(iface, true)} scan 2>&1; unset LC_ALL`, util.execOptsLinux)
|
|
298
|
+
.toString()
|
|
299
|
+
.split(' Cell ');
|
|
284
300
|
if (iwlistParts[0].indexOf('resource busy') >= 0) {
|
|
285
301
|
return -1;
|
|
286
302
|
}
|
|
@@ -324,11 +340,11 @@ function getWifiNetworkListIw(iface) {
|
|
|
324
340
|
if (l.indexOf('pairwise cipher') >= 0) {
|
|
325
341
|
const parts = l.split(':');
|
|
326
342
|
if (parts.length > 1) {
|
|
327
|
-
if (parts[1].indexOf('tkip')) {
|
|
343
|
+
if (parts[1].indexOf('tkip') >= 0) {
|
|
328
344
|
wpaFlag = wpaFlag ? 'TKIP/' + wpaFlag : 'TKIP';
|
|
329
|
-
} else if (parts[1].indexOf('ccmp')) {
|
|
345
|
+
} else if (parts[1].indexOf('ccmp') >= 0) {
|
|
330
346
|
wpaFlag = wpaFlag ? 'CCMP/' + wpaFlag : 'CCMP';
|
|
331
|
-
} else if (parts[1].indexOf('proprietary')) {
|
|
347
|
+
} else if (parts[1].indexOf('proprietary') >= 0) {
|
|
332
348
|
wpaFlag = wpaFlag ? 'PROP/' + wpaFlag : 'PROP';
|
|
333
349
|
}
|
|
334
350
|
}
|
|
@@ -336,9 +352,9 @@ function getWifiNetworkListIw(iface) {
|
|
|
336
352
|
if (l.indexOf('authentication suites') >= 0) {
|
|
337
353
|
const parts = l.split(':');
|
|
338
354
|
if (parts.length > 1) {
|
|
339
|
-
if (parts[1].indexOf('802.1x')) {
|
|
355
|
+
if (parts[1].indexOf('802.1x') >= 0) {
|
|
340
356
|
wpaFlag = wpaFlag ? '802.1x/' + wpaFlag : '802.1x';
|
|
341
|
-
} else if (parts[1].indexOf('psk')) {
|
|
357
|
+
} else if (parts[1].indexOf('psk') >= 0) {
|
|
342
358
|
wpaFlag = wpaFlag ? 'PSK/' + wpaFlag : 'PSK';
|
|
343
359
|
}
|
|
344
360
|
}
|
|
@@ -424,15 +440,7 @@ function wifiNetworks(callback) {
|
|
|
424
440
|
}
|
|
425
441
|
});
|
|
426
442
|
if (iface) {
|
|
427
|
-
|
|
428
|
-
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface, true);
|
|
429
|
-
const l = util.mathMin(s.length, 2000);
|
|
430
|
-
|
|
431
|
-
for (let i = 0; i <= l; i++) {
|
|
432
|
-
if (s[i] !== undefined) {
|
|
433
|
-
ifaceSanitized = ifaceSanitized + s[i];
|
|
434
|
-
}
|
|
435
|
-
}
|
|
443
|
+
const ifaceSanitized = util.sanitizeString(iface, true);
|
|
436
444
|
|
|
437
445
|
const res = getWifiNetworkListIw(ifaceSanitized);
|
|
438
446
|
if (res === -1) {
|
|
@@ -495,6 +503,9 @@ function wifiNetworks(callback) {
|
|
|
495
503
|
|
|
496
504
|
bssidsParts.forEach((bssidPart) => {
|
|
497
505
|
const bssidLines = bssidPart.split(os.EOL);
|
|
506
|
+
if (bssidLines.length < 4) {
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
498
509
|
const bssidLine = bssidLines[0].split(':');
|
|
499
510
|
bssidLine.shift();
|
|
500
511
|
const bssid = bssidLine.join(':').trim().toLowerCase();
|
|
@@ -585,30 +596,13 @@ function wifiConnections(callback) {
|
|
|
585
596
|
const ifaces = ifaceListLinux();
|
|
586
597
|
const networkList = getWifiNetworkListNmi();
|
|
587
598
|
ifaces.forEach((ifaceDetail) => {
|
|
588
|
-
|
|
589
|
-
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(ifaceDetail.iface, true);
|
|
590
|
-
const ll = util.mathMin(s.length, 2000);
|
|
591
|
-
|
|
592
|
-
for (let i = 0; i <= ll; i++) {
|
|
593
|
-
if (s[i] !== undefined) {
|
|
594
|
-
ifaceSanitized = ifaceSanitized + s[i];
|
|
595
|
-
}
|
|
596
|
-
}
|
|
599
|
+
const ifaceSanitized = util.sanitizeString(ifaceDetail.iface, true);
|
|
597
600
|
|
|
598
601
|
const nmiDetails = nmiDeviceLinux(ifaceSanitized);
|
|
599
602
|
const wpaDetails = wpaConnectionLinux(ifaceSanitized);
|
|
600
|
-
const
|
|
603
|
+
const nmiConnection = nmiConnectionLinux(nmiDetails.uuid);
|
|
604
|
+
const ssid = nmiConnection.ssid || nmiDetails.ssid || wpaDetails.ssid;
|
|
601
605
|
const network = networkList.filter((nw) => nw.ssid === ssid);
|
|
602
|
-
let ssidSanitized = '';
|
|
603
|
-
const t = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(ssid, true);
|
|
604
|
-
const l = util.mathMin(t.length, 32);
|
|
605
|
-
for (let i = 0; i <= l; i++) {
|
|
606
|
-
if (t[i] !== undefined) {
|
|
607
|
-
ssidSanitized = ssidSanitized + t[i];
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
const nmiConnection = nmiConnectionLinux(ssidSanitized);
|
|
612
606
|
const channel = network && network.length && network[0].channel ? network[0].channel : wpaDetails.channel ? wpaDetails.channel : null;
|
|
613
607
|
const bssid = network && network.length && network[0].bssid ? network[0].bssid : wpaDetails.bssid ? wpaDetails.bssid : null;
|
|
614
608
|
const signalLevel = network && network.length && network[0].signalLevel ? network[0].signalLevel : null;
|
|
@@ -760,7 +754,9 @@ function wifiInterfaces(callback) {
|
|
|
760
754
|
if (_linux) {
|
|
761
755
|
const ifaces = ifaceListLinux();
|
|
762
756
|
ifaces.forEach((ifaceDetail) => {
|
|
763
|
-
const
|
|
757
|
+
const ifaceSanitized = util.sanitizeString(ifaceDetail.iface, true);
|
|
758
|
+
|
|
759
|
+
const nmiDetails = nmiDeviceLinux(ifaceSanitized);
|
|
764
760
|
result.push({
|
|
765
761
|
id: ifaceDetail.id,
|
|
766
762
|
iface: ifaceDetail.iface,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/systeminformation",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.33.6-depup.0",
|
|
4
4
|
"description": "Advanced, lightweight system and OS information library (with updated dependencies)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"types": "./lib/index.d.ts",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"test": "node ./test/test.js",
|
|
16
|
-
"testDeno": "deno run -A ./test/test.js"
|
|
16
|
+
"testDeno": "deno run -A ./test/test.js",
|
|
17
|
+
"testAll": "node ./test/testAll.js"
|
|
17
18
|
},
|
|
18
19
|
"files": [
|
|
19
20
|
"lib/",
|
|
@@ -104,14 +105,14 @@
|
|
|
104
105
|
"android"
|
|
105
106
|
],
|
|
106
107
|
"engines": {
|
|
107
|
-
"node": ">=
|
|
108
|
+
"node": ">=10.0.0"
|
|
108
109
|
},
|
|
109
110
|
"depup": {
|
|
110
111
|
"changes": {},
|
|
111
112
|
"depsUpdated": 0,
|
|
112
113
|
"originalPackage": "systeminformation",
|
|
113
|
-
"originalVersion": "5.
|
|
114
|
-
"processedAt": "2026-
|
|
114
|
+
"originalVersion": "5.33.6",
|
|
115
|
+
"processedAt": "2026-08-30T00:59:35.725Z",
|
|
115
116
|
"smokeTest": "passed"
|
|
116
117
|
}
|
|
117
118
|
}
|