First of all, sorry for my english. This is not my native language. This is the first time I do something like that so i learn on the go.
Context: I try to understand how the game I installed from the Play store communicates with the server. More precisely, how a specific parameter is set on a every POST request to the server.
This HTTP parameter called 'secret' cannot be reversed engineer easily as it is a kind of hash of the others parameters to check the integrity of the request.
What i've done:
- I extracted the .dex files from the .apk
- I used d2j-dex2jar to extract the .class files.
- I used jd-gui tool to analyse the source code
What i've found: This is the source code that generates the value for the 'secret' parameter:
.method public static native secretForString(Ljava/lang/String;)Ljava/lang/String;
.end method
From what I learnt, java allows you to use native libraries thanks to the native keyword. These native libraries are loaded through the System.loadLibrary(...)
command. In the Main.java file, I have a call to this command System.loadLibrary("Main");
. If I understood correctly how it works, there is a corresponding .so file called libMain.so somewhere installed on my android phone.
I rooted my OnePlus6 and dig into the files looking for this library.
Issue: I can't find this library on my phone. There is no associated .so file in the /data/data//
Questions:
- Can you explain what i'm doing wrong / i'm missing.
- Let's say I find the library, will I be able to read the code in it or do i need a specific tool ?
- If the answer is no for question 2, is it possible to create a small app that loads this specific library and use it ?
Thank you for the time you will spend trying to help me :D