SReverseby Simpa Labs

Native analysis

Finding API logic inside native shared libraries

Some Android apps perform their request work in a shared object reached through JNI. The Java layer contains declarations and little else, so the analysis moves to the native binary.

What the Java layer shows

An app that delegates to native code loads one or more shared objects at start and declares methods without implementations. The Java side of the request may consist of a native method that accepts a payload and returns a result, plus the code that loads the library. Decompiling the DEX file is still worth doing, because it gives you the class and method signature. Resolve that declaration to a native address through lookup or registration.

In the APK the libraries sit under lib/, split by architecture. Work with the variant the device uses, since picking a different one costs time and produces confusing offsets.

Understand what you are reading

A shared object is a compiled program. Static reading shows instructions, data and a symbol table that a release build often strips down to the exported entries.

Two consequences follow. First, code compiled for Android has a specific instruction set and calling convention per architecture, so the disassembly view depends on the target. Second, JNI imposes its own conventions on the functions that Java can call. An exported entry point has a name the runtime resolves, or explicit registration maps a method to its address. Registration can happen at initialization or later. Android's JNI guidance describes both approaches. Finding that mapping is the first real step, because it tells you which function in the library corresponds to which Java declaration.

Locate the request code

Reading a whole library is rarely necessary. Request construction leaves traces you can search for before you understand any instruction.

  • String references. Compiled code points at data in the same file, so a search for a path segment, a header name or a parameter key lands near the code that uses it. Cross references from the string to its readers do most of the navigation work.
  • Imported functions. Imports provide clues, not a complete dependency map. Hashing, string handling or transport code can be inlined, statically linked or reached through another module. The import list narrows the purpose of the file quickly.
  • Constants. Initialisation vectors, lookup tables and fixed masks are byte sequences in the data section. Their shape suggests a candidate primitive; confirm its operations and input/output behavior before naming it.
  • Registration calls. Where the app registers its native methods at runtime, the table it passes maps names to addresses, and it is a reliable index into the binary.

Work the boundary between the layers

The interesting values usually arrive from Java and leave through the same door. Instrument the process and record what crosses.

  • Hook the resolved native function, whether exported by name or registered explicitly. The arguments show what Java provided and the return value shows what native code produced.
  • Compare those values with the captured request. A field absent from those arguments may come from native code, retained state, a callback or a later request-building step. Trace its source before assigning it to a layer.
  • Replay with one argument altered to see which outputs move. This separates an input that feeds a signature from one that is merely copied into the payload.

Record input/output pairs and compare the complete request, including state carried between calls.

Plan for the parts that resist

Not every library yields to the same effort. Budget accordingly.

  • For JSON built in native code, recover the field names and encoding, then trace session and signing inputs needed to send the request.
  • A signed or encrypted payload costs more, because the canonical form and the key handling both matter.
  • Binary protocols and WebSocket sessions need framing and state checks; their cost depends on the actual implementation rather than the protocol label.

Mixed cases are common. A library signs a body that Java serialised, which means your reproduction has to match the serialisation exactly before the signature check can pass.

Deliver an equivalent implementation

The reconstructed function becomes part of the working app client. Delivery includes Python, JavaScript/TypeScript, Postman and complete documentation for the full APK workflow. Verification compares your output with the app's on several inputs, then sends the result to the live service and checks that the server accepts it. Repeat the comparison with fresh state and error paths. Shared libraries can depend on stored state, other processes or device services as well as their direct inputs. Reproducing that behaviour is what the client needs.

Reviewed 19 October 2026 · SReverse research desk

Start your full APK reconstruction

Send the full APK

Projects start at $70. Choose WhatsApp or email, then attach the APK in the app that opens. We reply within one hour with the next step and send the fixed quote after review.

Want us to contact you?