Hide sensitive information with NDK
Your app token and SDK signature (setAppSecret) are required for Adtrace to work, but plain strings in Java or Kotlin can be read from a decompiled APK. Storing them in native C/C++ with the Android NDK compiles them into a .so library, which is harder to reverse engineer than Java bytecode.
Adtrace still validates every request with its own algorithms. Hiding these values in native code is an extra layer of protection, not a substitute for SDK signature setup in the panel.
What you can hide in native code
| Value | Typical use |
|---|---|
| App token | Pass to AdTraceConfig at init |
| SDK signature | Pass to AdTraceConfig.setAppSecret() |
Use JNI to expose native getters from your Activity or Application, then initialize the SDK with the returned values.
Example project
Step-by-step setup (CMake, native-lib.cpp, JNI method names, System.loadLibrary, and sample code for getAppToken / getSignatures) is in the official example repo: