This repository was archived by the owner on Oct 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
46 lines (42 loc) · 1.32 KB
/
index.js
File metadata and controls
46 lines (42 loc) · 1.32 KB
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
43
44
45
46
const portal = require('./includes/portal');
const gls = require('./includes/gls');
if (process.argv.length < 3 || process.argv.length > 4) {
console.error("Usage: node index.js [User ID] [User Password]");
return;
}
if (!gls.checkInstalled()) {
console.error("[Error] MiPlatform - not installed");
return;
}
gls.setImage();
const userId = process.argv[2];
const userPass = process.argv[3];
portal.login(userId, userPass, (result) => {
if (result) {
portal.getGlobalVal((globalVal) => {
if (globalVal.length > 0) {
gls.setGlobalVal(globalVal, (result) => {
if (result) {
gls.executeGLS((result) => {
if (result) {
console.log("Success");
}
else {
console.error("[Error] GLS - failed");
}
})
}
else {
console.error("[Error] Regedit - failed");
}
});
}
else {
console.error("[Error] GlobalVal - missing");
}
});
}
else {
console.error("[Error] Login - failed");
}
});