Search code examples
javaandroidjava-native-interfaceloadlibrary

See result of System.loadLibrary/ the defined methods and classes?


I have an .so file that I successfully integrated into android studio and I can load the file by calling System.loadLibrary.

Is there a way I can see what methods and classes I can use now with this library loaded?


Solution

  • Depends on how the library maps Java methods to native function pointers: it can do one or both of the following:

    • Dynamic symbols that start with Java_ are mangled names for the class and method name.

    • If the code uses RegisterNatives system call you will have to put a breakpoint on env->RegisterNatives and look at the surrounding code/arguments.