1

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.

3

I 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 .sos 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.

2

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

  • Thanks. In the example given, would the static library be libndkfoo.so? – user1118764 Jan 27 '17 at 2:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.