-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/src/_multithread.js | ||
+++ b/src/_multithread.js | ||
@@ -7,7 +7,7 @@ | ||
// Also, leave a core available for the renderer process | ||
const osCPUs = require("os").cpus().length - 1; | ||
// See #904 | ||
- const numCPUs = (osCPUs > 7) ? 7 : osCPUs; | ||
+ const numCPUs = (osCPUs > 3) ? 3 : osCPUs; | ||
|
||
const si = require("systeminformation"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
`systeminfomation.system()` and `systeminfomation.chassis()` will call `dmesg` | ||
which doesn't work on Android without root | ||
|
||
--- a/src/classes/hardwareInspector.class.js | ||
+++ b/src/classes/hardwareInspector.class.js | ||
@@ -29,13 +29,22 @@ | ||
}, 20000); | ||
} | ||
updateInfo() { | ||
- window.si.system().then(d => { | ||
- window.si.chassis().then(e => { | ||
- document.getElementById("mod_hardwareInspector_manufacturer").innerText = this._trimDataString(d.manufacturer); | ||
- document.getElementById("mod_hardwareInspector_model").innerText = this._trimDataString(d.model, d.manufacturer, e.type); | ||
- document.getElementById("mod_hardwareInspector_chassis").innerText = e.type; | ||
- }); | ||
- }); | ||
+ const exec = require('child_process').exec; | ||
+ exec('getprop ro.product.manufacturer', function (_, stdout) { | ||
+ let manufacturer = "Unknown"; | ||
+ if (stdout !== undefined && stdout !== "") { | ||
+ manufacturer = stdout; | ||
+ } | ||
+ document.getElementById("mod_hardwareInspector_manufacturer").innerText = _trimDataString(manufacturer); | ||
+ }); | ||
+ exec('getprop ro.product.model', function (_, stdout) { | ||
+ let model = "Unknown"; | ||
+ if (stdout !== undefined && stdout !== "") { | ||
+ model = stdout; | ||
+ } | ||
+ document.getElementById("mod_hardwareInspector_model").innerText = _trimDataString(model); | ||
+ }); | ||
+ document.getElementById("mod_hardwareInspector_chassis").innerText = "Unknown"; | ||
} | ||
_trimDataString(str, ...filters) { | ||
return str.trim().split(" ").filter(word => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
`systeminfomation.fsSize()` doesn't work on Android | ||
|
||
--- a/src/classes/filesystem.class.js | ||
+++ b/src/classes/filesystem.class.js | ||
@@ -504,17 +504,8 @@ | ||
this.space_bar.text.innerHTML = "Calculating available space..."; | ||
this.space_bar.bar.removeAttribute("value"); | ||
|
||
- window.si.fsSize().catch(() => { | ||
- this.space_bar.text.innerHTML = "Could not calculate mountpoint usage."; | ||
- this.space_bar.bar.value = 100; | ||
- }).then(d => { | ||
- d.forEach(fsBlock => { | ||
- if (path.startsWith(fsBlock.mount)) { | ||
- this.fsBlock = fsBlock; | ||
- } | ||
- }); | ||
- this.renderDiskUsage(this.fsBlock); | ||
- }); | ||
+ this.space_bar.text.innerHTML = "Could not calculate mountpoint usage."; | ||
+ this.space_bar.bar.value = 100; | ||
}; | ||
|
||
this.renderDiskUsage = async fsBlock => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
`net.mac` is always empty on Android. | ||
|
||
--- a/src/classes/netstat.class.js | ||
+++ b/src/classes/netstat.class.js | ||
@@ -77,7 +77,7 @@ | ||
} else { | ||
// Find the first external, IPv4 connected networkInterface that has a MAC address set | ||
|
||
- while (net.operstate !== "up" || net.internal === true || net.ip4 === "" || net.mac === "") { | ||
+ while (net.operstate !== "up" || net.internal === true || net.ip4 === "") { | ||
netID++; | ||
if (data[netID]) { | ||
net = data[netID]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters