LinuxCommandLibrary

dexdump

Dump information from a DEX or ODEX file

TLDR

Extract classes and methods from an APK file

$ dexdump [path/to/file].apk
copy

Display header information of DEX files contained in an APK file
$ dexdump -f [path/to/file].apk
copy

Display the dis-assembled output of executable sections
$ dexdump -d [path/to/file].apk
copy

Output results to a file
$ dexdump -o [path/to/file] [path/to/file].apk
copy

SYNOPSIS

dexdump [-cCFhlnstvx] [-d DIR] [-f STR] [-p METHOD] DEXFILE [DEXFILE ...]

PARAMETERS

-c
    Dump code sections: instructions, registers, and debug info

-C
    Deobfuscate using map.txt file

-d DIR
    Dump class files to specified directory

-f STR
    Filter output by string match

-F FORMAT
    Set output format (e.g., xml, plain)

-h
    Display this help message

-l
    Brief listing of DEX contents

-n
    Numeric (non-symbolic) code view

-p METHOD
    Dump only the specified method

-s
    Dump string table

-t
    Dump type table

-v
    Verbose output

-x
    XML output format

DESCRIPTION

Dexdump is a command-line utility from the Android SDK build-tools package, designed to parse and display detailed information from Dalvik Executable (.dex) files used in Android applications.

It extracts headers, class definitions, methods, fields, string pools, type lists, and bytecode instructions, making it invaluable for reverse engineering APKs (after extracting classes.dex), debugging Dalvik bytecode, or analyzing app behavior.

Output can be filtered, dumped to files, or formatted in XML. Unlike higher-level tools like APKTool, dexdump provides low-level DEX structure dumps, similar to objdump for native binaries. It's essential for developers and security researchers working with Android internals.

Typically invoked on extracted DEX files from APKs via unzip or aapt. Supports multi-DEX files and verbose disassembly with debug info.

CAVEATS

Android-specific; requires SDK build-tools installation (e.g., apt install android-sdk-platform-tools-common). No man page; use -h. Fails on malformed DEX. Not for live APKs—extract DEX first.

INSTALLATION

On Debian/Ubuntu: sudo apt install android-sdk-platform-tools-common. Or download Android SDK build-tools and add to PATH.
Verify: dexdump -h

EXAMPLE USAGE

dexdump classes.dex -c (disassemble code).
dexdump -d ./out/ app.dex (dump classes to dir).

HISTORY

Developed by Google as part of Android's dx toolchain since Android 1.0 (2008). Evolved with Dalvik/ART; now in build-tools/bin. Replaced by baksmali for some uses in modern Android.

SEE ALSO

aapt(1), apktool(1), objdump(1), readelf(1), jadx(1)

Copied to clipboard