79694018

Date: 2025-07-08 09:46:42
Score: 0.5
Natty:
Report link

Yes, you can call Java methods (non-native) from a class resolved using vm.resolveClass() in unidbg, as long as the method exists in the APK's DEX file and is not marked native.

Example:

DvmClassclazz = vm.resolveClass("Lcom/example/MyClass;"); DvmObject<?> result = clazz.callStaticJniMethodObject(emulator, "getValue()Ljava/lang/String;"); System.out.println("Result: " + result.getValue());

For instance methods:

DvmObject<?> instance = clazz.newObject(null); DvmObject<?> result = instance.callJniMethodObject(emulator, "sayHello()Ljava/lang/String;");

Important:

If the method uses Android system APIs, you may need to override or mock behavior via the JNI interface.

Assumptions:

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Mr.K