LinuxCommandLibrary

jadx

Decompile Android DEX and APK files

TLDR

Decompile a Dex file into a directory

$ jadx [path/to/file]
copy

Decompile a Dex file into a specific directory
$ jadx --output-dir [path/to/directory] [path/to/file]
copy

SYNOPSIS

jadx [options]

PARAMETERS

-d


    Output directory

-dd
    Output directory for decompiled sources (overrides -d)

-ds
    Output directory for decompiled resources (overrides -d)

-v
    Verbose output (show debug logs)

--show-bad-code
    Show inconsistent code (incorrect code generation)

--escape-unicode
    Escape non-ASCII characters in strings

--no-replace-consts
    Do not replace constant value in code

--threads
    Threads count (default: number of processors)

--deobf
    Activate deobfuscation

--deobf-min
    Minimum string length for deobfuscation (default: 3)

--deobf-max
    Maximum string length for deobfuscation (default: 64)

--deobf-res-name-source
    Source for resource name deobfuscation (auto, apk, res, none)

--resource-types
    Specify resource types for extraction

--single-class
    Decompile single class

--single-method
    Decompile single method

--cfg
    Save methods control flow graph to dot file

--raw-cfg
    Save raw methods control flow graph to dot file

--rename-flags
    Rename flags, allowed: case, valid, printable, kotlin (default: case,valid,printable)

--ignore-resources
    Do not decode and save resources

--export-gradle
    Generate gradle project

--fallback
    Use fallback mode (decompile even with errors)

-f
    Force overwrite

-q
    Quiet output

--version
    Print version and exit

--help
    Print this help message

DESCRIPTION

Jadx is a command-line tool and GUI for reverse engineering Android Dex and APK files. It aims to produce Java source code from Android bytecode. Jadx can disassemble Dex files to Smali code, decompile Dex to Java classes, and provide a comprehensive view of the application's structure and resources. It's often used for security analysis, reverse engineering, and understanding the inner workings of Android applications. Jadx supports multiple Dex files, obfuscated code, and complex Android application structures. The tool is written in Java and can be run on various platforms, including Linux, Windows, and macOS. It provides a powerful and user-friendly way to inspect and analyze Android applications.

CAVEATS

Decompilation is not always perfect and might produce incorrect or incomplete code, especially with heavily obfuscated or optimized applications. Requires a Java Runtime Environment (JRE) or Java Development Kit (JDK) to be installed. Performance can vary based on the size and complexity of the input file.

USAGE EXAMPLES

  • Decompile an APK file: jadx -d output_dir app.apk
  • Decompile a single class: jadx --single-class com.example.MyClass -d output_dir app.apk

DEOBFUSCATION

Jadx has built-in deobfuscation capabilities to improve the readability of decompiled code from obfuscated applications. The --deobf flag enables this feature.

HISTORY

Jadx was created as an open-source project to provide a better Dex to Java decompilation solution. It was developed to overcome the limitations of existing tools and provide more accurate and readable decompiled code. The project has been actively maintained and improved over time, with contributions from the open-source community.

SEE ALSO

dexdump(1), apktool(1)

Copied to clipboard