SReverseby Simpa Labs

Native / JNI

Tracing Android request logic into JNI and native code

An empty Java method is not empty. The logic moved into a native library, and so does the analysis.

Match the declaration to the native function

Record the Java class, native method, argument types and return type. Inspect the matching ABI library from the APK. Name-based lookup uses Java_ exports; explicit registration maps a method name and descriptor to a function pointer through RegisterNatives.

Start at JNI_OnLoad and follow initialization and later registration paths. RegisterNatives is called through the JNI interface, so searching the ELF symbol table for that name is not a reliable registration test. Android's JNI guide explains both lookup paths.

# Run from an extracted APK folder with LLVM tools installed
rg --files lib
llvm-readelf --file-header lib/arm64-v8a/libapp.so
llvm-nm --dynamic --defined-only lib/arm64-v8a/libapp.so

Replace the example library path with the file in your APK. Match the ELF header and ABI before following function arguments. Android's current NDK ABIs include armeabi-v7a, arm64-v8a, x86 and x86_64; the ABI reference defines them.

Follow bytes across the JNI boundary

For ordinary JNI calls, distinguish the instance object from the class argument of a static method. Read the full method descriptor and the conversion calls used by the native function. Android's CriticalNative methods use a different ABI.

GetStringUTFChars returns Modified UTF-8. GetByteArrayElements provides access to byte-array elements and can return a copy. NewByteArray allocates an array; SetByteArrayRegion fills its contents. NewStringUTF creates a Java string from Modified UTF-8 input. Match these operations with the JNI function specification.

Compare the function with the request

Record the function's input buffers, lengths, encoding and output, then compare the value placed in the app's request. Use controlled test inputs and keep credentials or private payloads out of shared logs. Test empty, non-ASCII and zero-containing input where the method accepts it.

A changing output with the same visible arguments calls for checking hidden state, randomness and timing. Trace those inputs before treating the function as pure. For a key handle, inspect the permitted operation and runtime requirements described by Android Keystore.

Build the full client around the recovered logic

Keep byte conversion and signing in tested functions, then connect them with login, token refresh, serialization and request order. Compare changed inputs and fresh sessions with the app. Required runtime components come with setup steps.

Native Android reconstruction carries the result into the full API delivery. The Ghidra guide follows ELF and JNI mappings, and the signing example shows byte-level tests.

Reviewed 19 October 2026 · SReverse research desk

Related

Start a project

Send the full APK

Send the full APK. We review the application and quote its complete API reconstruction.

Projects start at $70. Most are delivered in 24 to 72 hours.

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?