SReverseby Simpa Labs

Native analysis

Analyzing an Android shared library in Ghidra

Start with the library's ELF header and ABI, then trace the JNI calls used by the app. Compare the recovered request logic with the bytes the running app sends.

Match the library to its ABI

Android native libraries use ELF. The APK stores them under lib/<abi>/. Match Ghidra's processor and bitness to the ELF header: arm64-v8a uses AArch64, armeabi-v7a uses 32-bit ARM, x86 uses IA-32 and x86_64 uses x86-64. Android's ABI guide lists these formats.

Keep the APK version, library hash and ABI with your notes. A result from one library or architecture needs a separate check before you apply it to another. Let analysis finish, then inspect the entry points, imports, strings and cross-references.

Recover the JNI mapping

JNI links Java or Kotlin methods to native functions. Name-based lookup uses exported Java_ symbols. Explicit registration uses RegisterNatives with method names, descriptors and function pointers. Start at JNI_OnLoad and follow initialization calls to find registration. Also check later loading paths when the method is registered after startup.

For ordinary JNI, the first argument is JNIEnv*. The next is an object reference for an instance method or jclass for a static method. Android's @CriticalNative methods use a different ABI. Read the Java declaration and JNI descriptor to recover argument and return types; a short exported name alone does not contain that full signature. See Android's JNI guidance and the JNI type descriptors.

Follow request data through native code

Start with the Java caller that supplies a path, body, timestamp or session value. Trace each buffer's length and encoding through the native function to its returned bytes. That gives you a concrete comparison: the input supplied by the app, the native output and the value placed in the request.

Crypto imports and constants are clues to a primitive. Check how the caller uses them, including mode, padding, key source and output encoding. A readable constant or a large function does not establish which algorithm creates the request signature.

Resolve strings and branches at their use sites

For an encoded string, follow the decoder call and record its input, length and output. Check other callers before reusing that decoder on another data block. For a dispatcher-based control flow, record the executed states and branch inputs so the recovered order follows the actual function.

Static reading gives the code path to test. Runtime observation checks the argument layout, return buffer and state used by a real request. Compare changed inputs as well as one fixed example. Keep observations tied to the tested build and architecture.

Carry the result into a working client

The useful result is code that creates fresh requests with the app's login, signing, payload handling and session state. Native Android reverse engineering connects those functions to the full client delivery. The JNI request guide follows the surrounding Java/native call chain.

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?