Tool

jni_helper

Static helper by evilpan for reverse engineering Android JNI code. Its extract_jni.py script parses an APK's DEX files with Androguard, finds methods declared native, derives each one's mangled Java_ symbol name and C prototype, including overloaded methods, and saves them with the exported Java_ and JNI_OnLoad functions of the APK's arm64-v8a native libraries as a JSON signature file. Scripts for Ghidra, IDA Pro and Binary Ninja load that file and apply the prototypes and JNI types to the matching functions; a radare2 script is a work in progress.

Requirements & limits

  • Latest release at review: v0.6, published 2024-10-23, whose only asset is the demo APK built by CI; the reviewed master commit of 2025-02-24 only updates a README link. CI builds the demo app with JDK 17 and runs extract_jni.py on it as its only test, without checking the output or exercising the disassembler scripts.
  • extract_jni.py needs Python 3 with androguard, rich and pyelftools from requirements.txt and takes an APK the analyst already has; it reads native libraries only from lib/arm64-v8a. Methods bound at run time through RegisterNatives are not covered, which the README lists as an open TODO, and the disassembler scripts find functions only by their mangled Java_ symbol names.
  • The Ghidra script is installed by a Makefile into the ghidra_scripts folder in the user's home directory, together with the bundled jni.h.gdt data-type archive; the IDA plugin has separate versions for IDA Pro before 7.4 and for 7.4 and later; the Binary Ninja script runs from File > Run Script and parses the bundled headers/jni.h. Supported versions of Ghidra, Binary Ninja and radare2 are not stated.
  • No license file, and GitHub detects none, so reuse terms for the scripts are unstated. Bundled headers keep their own notices: headers/jni.h is Oracle's GPL-2.0 file with the Classpath exception, while r2/jni.h and headers/art_method.h are Android Open Source Project files under Apache-2.0. The demo_apk folder holds the source of the author's test app. This review ran nothing.

About this entry

Type
Tool
Category
Android tools
Relationship
Foundation tool
Targets
App · Binary

Sources reviewed

The description was reviewed against primary sources. This does not establish runtime testing, security auditing or verified compatibility.

Report an outdated entry Suggest a translation fix

Primary sources

  1. README.md GitHub · evilpan/jni_helper · Revision 04b844c
  2. extract_jni.py GitHub · evilpan/jni_helper · Revision 04b844c
  3. requirements.txt GitHub · evilpan/jni_helper · Revision 04b844c
  4. ghidra/README.md GitHub · evilpan/jni_helper · Revision 04b844c
  5. ida/README.md GitHub · evilpan/jni_helper · Revision 04b844c
  6. binary_ninja/jni_helper.py GitHub · evilpan/jni_helper · Revision 04b844c
  7. r2/README.md GitHub · evilpan/jni_helper · Revision 04b844c
  8. headers/jni.h GitHub · evilpan/jni_helper · Revision 04b844c
  9. .github/workflows/main.yml GitHub · evilpan/jni_helper · Revision 04b844c
  10. https://github.com/evilpan/jni_helper/releases/tag/v0.6

More in Apps

All 108 entries in Apps