systeminformation 5.21.5 → 5.21.7
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/lib/system.js +6 -8
- package/lib/util.js +1 -0
- package/lib/wifi.js +28 -4
- package/package.json +1 -1
package/lib/system.js
CHANGED
|
@@ -318,10 +318,11 @@ function system(callback) {
|
|
|
318
318
|
exports.system = system;
|
|
319
319
|
|
|
320
320
|
function cleanDefaults(s) {
|
|
321
|
-
|
|
322
|
-
if (
|
|
323
|
-
|
|
324
|
-
|
|
321
|
+
const cmpStr = s.toLowerCase();
|
|
322
|
+
if (cmpStr.indexOf('o.e.m.') === -1 && cmpStr.indexOf('default string') === -1 && cmpStr !== 'default') {
|
|
323
|
+
return s || '';
|
|
324
|
+
}
|
|
325
|
+
return '';
|
|
325
326
|
}
|
|
326
327
|
function bios(callback) {
|
|
327
328
|
|
|
@@ -561,7 +562,7 @@ function baseboard(callback) {
|
|
|
561
562
|
const workload = [];
|
|
562
563
|
const win10plus = parseInt(os.release()) >= 10;
|
|
563
564
|
const maxCapacityAttribute = win10plus ? 'MaxCapacityEx' : 'MaxCapacity';
|
|
564
|
-
workload.push(util.powerShell('Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU
|
|
565
|
+
workload.push(util.powerShell('Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl'));
|
|
565
566
|
workload.push(util.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${maxCapacityAttribute}, MemoryDevices | fl`));
|
|
566
567
|
util.promiseAll(
|
|
567
568
|
workload
|
|
@@ -579,9 +580,6 @@ function baseboard(callback) {
|
|
|
579
580
|
if (!result.assetTag) {
|
|
580
581
|
result.assetTag = cleanDefaults(util.getValue(lines, 'sku', ':'));
|
|
581
582
|
}
|
|
582
|
-
if (!result.assetTag) {
|
|
583
|
-
result.assetTag = cleanDefaults(util.getValue(lines, 'SMBIOSAssetTag', ':'));
|
|
584
|
-
}
|
|
585
583
|
|
|
586
584
|
// memphysical
|
|
587
585
|
lines = data.results[1] ? data.results[1].toString().split('\r\n') : [''];
|
package/lib/util.js
CHANGED
package/lib/wifi.js
CHANGED
|
@@ -401,7 +401,15 @@ function wifiNetworks(callback) {
|
|
|
401
401
|
}
|
|
402
402
|
});
|
|
403
403
|
if (iface) {
|
|
404
|
-
|
|
404
|
+
let ifaceSanitized = '';
|
|
405
|
+
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface, true);
|
|
406
|
+
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
|
407
|
+
if (s[i] !== undefined) {
|
|
408
|
+
ifaceSanitized = ifaceSanitized + s[i];
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
const res = getWifiNetworkListIw(ifaceSanitized);
|
|
405
413
|
if (res === -1) {
|
|
406
414
|
// try again after 4 secs
|
|
407
415
|
setTimeout(function (iface) {
|
|
@@ -529,11 +537,27 @@ function wifiConnections(callback) {
|
|
|
529
537
|
const ifaces = ifaceListLinux();
|
|
530
538
|
const networkList = getWifiNetworkListNmi();
|
|
531
539
|
ifaces.forEach(ifaceDetail => {
|
|
532
|
-
|
|
533
|
-
const
|
|
540
|
+
let ifaceSanitized = '';
|
|
541
|
+
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(ifaceDetail.iface, true);
|
|
542
|
+
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
|
543
|
+
if (s[i] !== undefined) {
|
|
544
|
+
ifaceSanitized = ifaceSanitized + s[i];
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
const nmiDetails = nmiDeviceLinux(ifaceSanitized);
|
|
549
|
+
const wpaDetails = wpaConnectionLinux(ifaceSanitized);
|
|
534
550
|
const ssid = nmiDetails.ssid || wpaDetails.ssid;
|
|
535
551
|
const network = networkList.filter(nw => nw.ssid === ssid);
|
|
536
|
-
|
|
552
|
+
let ssidSanitized = '';
|
|
553
|
+
const t = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(ssid, true);
|
|
554
|
+
for (let i = 0; i <= util.mathMin(t.length, 2000); i++) {
|
|
555
|
+
if (t[i] !== undefined) {
|
|
556
|
+
ssidSanitized = ssidSanitized + t[i];
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
const nmiConnection = nmiConnectionLinux(ssidSanitized);
|
|
537
561
|
const channel = network && network.length && network[0].channel ? network[0].channel : (wpaDetails.channel ? wpaDetails.channel : null);
|
|
538
562
|
const bssid = network && network.length && network[0].bssid ? network[0].bssid : (wpaDetails.bssid ? wpaDetails.bssid : null);
|
|
539
563
|
if (ssid && bssid) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.21.
|
|
3
|
+
"version": "5.21.7",
|
|
4
4
|
"description": "Advanced, lightweight system and OS information library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",
|