ToolsFebruary 9, 20261 min readby 0xt0pus

dex2jar

Converts Android DEX files to Java JAR format for decompilation and analysis


dex2jar

Description

A tool that converts Android DEX (Dalvik Executable) files to Java JAR files. This allows the Android application code to be viewed using Java decompilers such as jd-gui.

Usage 1: Convert APK to JAR

Converts the DEX bytecode inside an APK file into a JAR file for analysis. The -f flag forces overwrite if the output file already exists.

Command:

d2j-dex2jar.bat -f example.apk

This will create a file named example-dex2jar.jar.

Usage 2: Convert APK to JAR with Custom Output Name

Converts the APK to a JAR file with a specified output filename using the -o flag.

Command:

d2j-dex2jar.bat example.apk -o outputfile.jar

Notes

  • After conversion, the resulting JAR file can be opened in jd-gui or similar Java decompilers to browse the source code.
  • On Linux, use d2j-dex2jar.sh instead of d2j-dex2jar.bat.