W3docs

How to decompile DEX into Java source code?

To decompile DEX (Dalvik Executable) files into Java source code, you can use a DEX decompiler such as JD-GUI or DEX2JAR.

To decompile DEX (Dalvik Executable) files into Java source code, you can use a modern decompiler such as jadx. Note that DEX files are often extracted from APK archives before decompilation.

  1. jadx (Command Line):
  • Download and install jadx from the official GitHub repository (https://github.com/skylot/jadx).
  • Open a terminal or command prompt and navigate to the directory containing your DEX file.
  • Run the following command to decompile the DEX file into Java source code:
jadx -d output_dir "<dex file path>"
  • The decompiled Java source code will be saved in the specified output_dir.
  1. jadx-gui (Graphical Interface):
  • Download jadx-gui from the same GitHub repository.
  • Launch the application and open the DEX file by going to "File > Open" or by dragging and dropping the DEX file into the jadx-gui window.
  • jadx-gui will decompile the DEX file and display the Java source code in a new window.

Keep in mind that decompiling DEX files is not an exact science, and the quality of the decompiled source code may vary depending on the complexity of the DEX file and the capabilities of the decompiler. The decompiled source code may not always be 100% accurate, and you may need to make manual adjustments to the code to make it work properly.