-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathFileTest.kt
More file actions
53 lines (46 loc) · 1.64 KB
/
Copy pathFileTest.kt
File metadata and controls
53 lines (46 loc) · 1.64 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
47
48
49
50
51
52
53
package suites
import TestBase
import TestUtil
import jmp0.app.AndroidEnvironment
import jmp0.app.IAndroidInvokeFile
import jmp0.app.interceptor.intf.IInterceptor
import org.junit.jupiter.api.Test
class FileTest:TestBase(),IAndroidInvokeFile {
override fun test() {
val ae = AndroidEnvironment(TestUtil.testApkFile, object : IInterceptor {
override fun nativeCalled(
uuid: String,
className: String,
funcName: String,
signature: String,
param: Array<Any?>
): IInterceptor.ImplStatus {
return IInterceptor.ImplStatus(false,null)
}
override fun methodCalled(
uuid: String,
className: String,
instance: Any?,
funcName: String,
signature: String,
param: Array<Any?>
): Any? {
return null
}
override fun ioResolver(path: String): String? {
if (path == "/proc/self/maps"){
return "../temp/appdbg-test.apk/assets/hello"
}
return null
}
})
val clazz = ae.loadClass("jmp0.test.testapp.FileTest")
val ins = clazz.getDeclaredConstructor().newInstance()
clazz.getDeclaredMethod("testAll").invoke(ins)
// ae.runInvokeFile(this)
ae.destroy()
}
override fun run(androidEnvironment: AndroidEnvironment) {
// FileTest().testAll()
}
}