Detranspiler
Recover Java source from JNI-native binaries
A Python tool for reverse engineers that recovers Java source code from compiled native binary files, with optional Ghidra integration and a confidence-scored HTML report.
Detranspiler is a Python tool for people who work in reverse engineering and need to recover Java source code from native binary files. Some Java applications ship parts of their logic inside compiled native libraries (files like DLLs on Windows or SO files on Linux) rather than in standard Java bytecode. Detranspiler targets those applications and tries to rebuild readable Java-like source from what is left inside the binary.
The tool works as a multi-step pipeline. It reads the native binary, scans its exports, imports, and strings for clues about how Java methods were originally structured, and then calls an optional external tool called Ghidra to decompile the native code into C-like pseudocode. From there it traces how the binary registers and calls Java methods through a standard interface called JNI, and merges everything it finds across several recovery layers to produce the best available version of each method body. The process is designed around cases where a protection tool or transpiler has converted Java bytecode into native code, making the original source hard to read.
After a run, the tool produces several outputs: recovered Java-like source files, a human-readable HTML report with recovery metrics, an interactive graph showing how Java classes connect to native functions, and per-method C files linked to their Java declarations. It is honest about confidence, marking each recovered method with a level from minimal to high rather than claiming perfect results.
The tool comes with both a command-line interface and an optional desktop GUI. The GUI lets you configure an analysis, browse recovered source files, view the HTML report and the interactive relationship graph, and run environment diagnostics, all without using a terminal. The GUI requires an optional extra install step.
Detranspiler is licensed under the MIT license and works on Windows, Linux, and macOS. Python 3.10 or newer is required. A Java runtime is recommended for the decompilation step, and Ghidra is optional but improves results significantly when available.
Where it fits
- Recover readable Java-like source code from a .dll or .so file where the original Java bytecode was compiled into native code.
- Generate a confidence-scored HTML report and interactive relationship graph showing how Java classes connect to native functions in a protected application.
- Analyze a transpiler-protected Android app's native library to understand which Java methods were converted and how they map back to JNI calls.