-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathDebugTest.kt
48 lines (42 loc) · 1.51 KB
/
DebugTest.kt
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
package suites
import TestBase
import jmp0.app.AndroidEnvironment
import jmp0.app.IAndroidInvokeFile
import jmp0.app.interceptor.intf.IInterceptor
import org.junit.jupiter.api.Test
class DebugTest: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? {
TODO("Not yet implemented")
}
override fun ioResolver(path: String): String? {
return null
}
})
val clazz = ae.findClass("jmp0.test.testapp.DebugTest")
val instance:Any = clazz.getDeclaredConstructor(Int::class.java,String::class.java).newInstance(10,"AAAA")
clazz.getDeclaredMethod("testAll",Int::class.java).invoke(instance,1)
// ae.runInvokeFile(this)
ae.destroy()
}
override fun run(androidEnvironment: AndroidEnvironment) {
// jmp0.test.testapp.DebugTest(10,"AAAA").testAll(1)
}
}