-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
29 lines (26 loc) · 709 Bytes
/
script.js
File metadata and controls
29 lines (26 loc) · 709 Bytes
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
var cl;
var meth;
var line;
var strArg = []
recv('cls', function onMessage(cls) {
cl = cls.class;
meth = cls.meth;
strArg = cls.line;
});
// Thhis is to have a file in the device to include the output. Touch it before to create it.
//var f = new File("/sdcard/log.txt", "w");
var result
Java.perform(function(){
for (let i = 0; i < strArg.length; i++) {
strArg[i] = strArg[i].replace(/(\r\n|\n|\r)/gm, "");
console.log("\x1b[31m"+strArg[i]+"\x1b[0m")
f.write("\x1b[31m"+strArg[i]+"\x1b[0m\n");
result = Java.use(cl)[meth](strArg[i])
// f.write(result + "\n");
send(
result
);
}
// f.flush();
// f.close();
});