Apologies for a beginner-esque question, but I am reverse engineering an Android application, that is most probably using the
libusbhost.so library to interface with USB devices via Java Native Interface.
How would I go about doing so?
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 community
It is a bit unclear what do you mean by "library being called". If you want to know when the library is loaded, you may look for references to
System.load(string) java functions. You might for example hook it using Frida.
If you want to see when particular functions exported by the
libusbhost.so are called, you also may use Frida. There is prebuild tool called frida-trace. For example using
frida-trace -U -i “Java_*” [package_name], will print out all the calls to JNI native functions from your app, along with their timestamp.
If you want to alter the parameters of the called functions, modify the way they work, or replace their return values - you may find the Frida Interceptor module useful.