-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsyslevel.js
31 lines (28 loc) · 1.25 KB
/
syslevel.js
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
var name = 0;
Interceptor.attach(Module.findExportByName(null, "remove"), {
onEnter: function (args) {
Java.perform(function () {
const File = Java.use("java.io.File");
const FileInputStream = Java.use("java.io.FileInputStream");
const FileOutputStream = Java.use("java.io.FileOutputStream");
const ActivityThread = Java.use("android.app.ActivityThread");
path = Memory.readUtf8String(args[0]);
// create the input channel
var f = File.$new(path);
var fis = FileInputStream.$new(f);
var inChannel = fis.getChannel();
// create the output channet
var application = ActivityThread.currentApplication();
if (application == null)
return;
var context = application.getApplicationContext();
var fos = context.openFileOutput('deleted_' + path.replace(/\//g,"_"), 0);
name = name + 1;
var outChannel = fos.getChannel();
// transfer the file from the input channel to the output channel
inChannel.transferTo(0, inChannel.size(), outChannel);
fis.close();
fos.close();
});
}
});