explaingit

pxb1988/dex2jar

13,109JavaAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

A toolkit that converts Android APK and DEX files into readable Java class files or smali text, making it easy to inspect what an Android app actually does.

Mindmap

mindmap
  root((dex2jar))
    Input formats
      DEX files
      Android APK
    Output formats
      JAR files
      smali text
    Tools included
      d2j-dex2jar converter
      DEX disassembler
      DEX reader writer
    Use cases
      Security analysis
      Reverse engineering
      Code inspection
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Convert an Android APK to a JAR file to open it in a Java decompiler and read its source code.

USE CASE 2

Disassemble a DEX file to human-readable smali text to inspect its low-level bytecode.

USE CASE 3

Audit an unfamiliar Android app for security vulnerabilities or malicious behavior by examining its code.

USE CASE 4

Read or write DEX file contents programmatically using the included DEX reader and writer library.

Tech stack

Javasmali

Getting it running

Difficulty · moderate Time to first run · 30min

Requires building the project from source and unzipping the output package before the shell scripts are available.

Use freely for any purpose including commercial use, as long as you include the copyright and license notice. (Apache 2.0)

In plain English

dex2jar is a collection of tools for working with Android application files. When an Android app is installed, its code is stored in a file format called DEX (Dalvik Executable), which is the compiled bytecode format used by Android's runtime. dex2jar helps convert these files into a form that is easier to inspect. The main tool, d2j-dex2jar, converts a DEX file or Android APK (the package file for Android apps) into a JAR file. A JAR file is a standard Java archive containing compiled Java class files, which can then be opened in common Java code viewers or decompilers. This makes it possible to examine what an Android application does at the code level. The project also includes a reader and writer for DEX files directly, which allows programmatic access to the contents of a DEX file without conversion. There is also a disassembler (smali/baksmali) that converts DEX files into a human-readable text format called smali and can reassemble smali text back into DEX. This is a lower-level representation than Java source code but still far more readable than raw binary. dex2jar is primarily used for Android security analysis and reverse engineering. Developers, security researchers, and auditors use it to inspect what code an Android application contains, which can help identify security issues, malicious behavior, or simply understand how an unfamiliar app works. To use the main tool, you build the project, unzip the output package, and run a shell script against an APK or DEX file. The converted result appears as a .jar file. The project is licensed under Apache 2.0.

Copy-paste prompts

Prompt 1
Using dex2jar, convert this Android APK to a JAR file so I can open it in a Java decompiler: [path to APK]
Prompt 2
Show me how to disassemble a DEX file to smali format using dex2jar and what the output looks like.
Prompt 3
Walk me through inspecting the code of an Android APK using dex2jar followed by a Java decompiler like jadx.
Prompt 4
How do I build dex2jar from source, and what shell command do I run to convert an APK?
Open on GitHub → Explain another repo

← pxb1988 on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.