I'm trying to perform static analysis on Android framework code, and I'm coming across some Java methods that are calling JNI functions. How do I figure out which native libraries these functions reside in?
Thanks.
Reverse Engineering Stack Exchange is a question and answer site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation. It only takes a minute to sign up.
Sign up to join this communityI haven't touched Android in almost a year but IIRC:
All JNI libraries need to be loaded from Java side first e.g.
System.loadLibrary("hello-jni");
which translates to invoke-virtual
in compiled Java.
Also, IDA Pro identifies fully qualified names in .so
s it decompiles, so you will be able to figure out Java names for those JNI functions. See also http://www.hexblog.com/?p=809.
This tool may also be of help, although it's rather old https://github.com/maaaaz/jnianalyzer.
It's been a while, but there should be a static code block with the .so they are calling. I would need to disassemble a file using a shared library.
It will resemble: https://stackoverflow.com/questions/8437106/java-jni-call-to-load-library