SReverseby Simpa Labs

Native request logic

Recovering Android native request signing with radare2

When request signing lives in a native library, the result still needs to be a client that generates accepted requests. Trace the call into the .so, recover its byte rules and verify the rebuilt signer.

Find the native method that handles the request

Follow the request from its final Java or Kotlin call into native code. Record the method name, argument types and return type. A byte array, a Java string and a direct buffer each need different handling at the boundary.

Android supports named native exports and explicit registration through RegisterNatives. In an explicitly registered library, inspect the method table and the initialization path. An export list alone can miss the method you need. The Android JNI guide describes both lookup paths. Java HTTP methods are reached through JNI calls; they are not ordinary C imports of a Java HTTP client.

Use radare2 to narrow the call path

Match the library to the APK’s ABI and version, then inspect imports, strings and references. In radare2, ii lists imports, iz lists data strings, and axt shows references to a chosen address. Read the caller and its callees rather than treating a crypto import as proof that it signs the request.

r2 -A native-fixture.dylib
ii~HMAC
afl~fixture_sign
pdf @ sym.fixture_sign

These commands are for the downloadable host fixture; use the symbol name shown by your own build. The radare2 analysis guide explains function analysis and cross-references. Tool-generated function boundaries need checking against the code.

An owned signer with a known answer

The C fixture computes HMAC-SHA256 over the supplied body bytes with the public test key public-fixture-key. It returns the raw 32-byte digest. The matching Python check signs the same bytes and compares the full digest.

body = b'{"sku":"demo","count":7}'
key = b"public-fixture-key"
expected = hmac.new(key, body, hashlib.sha256).digest()

This is a host-built teaching library, not a recovered Android app. It makes the data path inspectable: the caller supplies the bytes and length, the native function passes them to HMAC, and the caller formats the digest. A real app can build its signature base from the method, encoded path, body and changing session inputs. Each of those steps belongs in the reconstruction.

Check the bytes before changing the algorithm

Compare the message before hashing, the key bytes, the raw digest and its final encoding. Hex output differs from Base64; a final newline changes the message. JSON spacing can change a body signature even when both JSON objects mean the same thing.

Use fixed vectors to check the port, then fresh requests to check runtime inputs. Rotate a timestamp or nonce and verify that the client follows the same rule as the app. Our signature tracing article explains how to connect a generated header to its inputs.

Carry the signer into the complete client

The signer runs inside the app’s login, refresh and request flow. Rebuild that order along with serialization and response handling, so the buyer receives callable methods rather than a detached hash function. Native Android reconstruction covers the full delivery.

Reviewed 22 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?