Demo Android app that shows JNI end to end: a native C library (libhello-jni.so) built for all common ABIs, Java calling into native code, and a small crackme-style check.
- JNI —
getHelloString()returns a string from native code;checkActivation()validates input in C. - Native — CMake-built shared library, C (not C++),
armeabi-v7a,arm64-v8a,x86,x86_64. - Crackme-style check — single-byte XOR compare against an embedded table (educational / demo).
- Android Studio Koala+ or compatible, JDK 17+ (as required by AGP 9).
- Android SDK with API 36 and NDK + CMake (install via SDK Manager).
./gradlew assembleDebugDebug APK: app/build/outputs/apk/debug/app-debug.apk
Release (after you configure signing):
./gradlew assembleRelease| Path | Purpose |
|---|---|
app/src/main/java/.../MainActivity.java |
JNI declarations, System.loadLibrary, UI logic |
app/src/main/cpp/native-lib.c |
Native implementation + XOR check |
app/src/main/cpp/CMakeLists.txt |
Native build |
app/src/main/res/ |
Layouts, themes, drawables |
This project is licensed under the MIT License — see LICENSE.