zhkl0228 / unidbg

Allows you to emulate an Android native library, and an experimental iOS emulation
Apache License 2.0
3.88k stars 966 forks source link

override callObjectMethodV #24

Closed leiguo1029 closed 5 years ago

leiguo1029 commented 5 years ago

@Override public DvmObject callObjectMethodV(BaseVM vm, DvmObject dvmObject, String signature, VaList vaList) { switch (signature){ case "java/lang/Thread->getStackTrace()[Ljava/lang/StackTraceElement;": return ???? } return super.callObjectMethodV(vm, dvmObject, signature, vaList); }

signature为“java/lang/Thread->getStackTrace()[Ljava/lang/StackTraceElement;”时返回值应该怎么写呢?如何返回object的数组?

zhkl0228 commented 5 years ago

https://github.com/zhkl0228/unidbg/blob/4e7c3c1f478ed9c97c30fff16995105bf949f40d/src/test/java/com/xunmeng/pinduoduo/secure/DeviceNative.java 这里面有示例

leiguo1029 commented 5 years ago

https://github.com/zhkl0228/unidbg/blob/4e7c3c1f478ed9c97c30fff16995105bf949f40d/src/test/java/com/xunmeng/pinduoduo/secure/DeviceNative.java 这里”

https://github.com/zhkl0228/unidbg/blob/4e7c3c1f478ed9c97c30fff16995105bf949f40d/src/test/java/com/xunmeng/pinduoduo/secure/DeviceNative.java 这里面有示例

好的 那signature是“java/lang/Thread->currentThread()Ljava/lang/Thread;”的时候 我这样 return vm.resolveClass("java/lang/Thread").newObject(Thread.currentThread()); 对吗?