RUScan

Learn / APK reverse engineering

How to decompile an APK to Java: jadx commands and an online decompiler

Install jadx or run its GUI, decompile an APK, DEX or AAB to Java sources, read AndroidManifest.xml, and decide when an online decompiler is the faster route.

Updated: 2026-11-24·7 min read

Decompiling turns the DEX bytecode of an Android package back into readable Java and decodes the binary manifest and resources. It is the first step of most audits: you see which components the app exports, whether debug flags survived into the release build and which keys are embedded in the code. The reference open-source tool for the job is jadx. The same result can be had online, with nothing installed.

What a decompiler gives you

A run of jadx produces two directories. sources/ holds Java files that approximate the original classes. resources/ holds the decoded AndroidManifest.xml, the string tables, assets and native libraries. The manifest alone answers many audit questions, because its flags are plain attributes there.

The output has limits. Comments and formatting never survive compilation. A release build processed by R8 keeps short names such as a and b for everything that was obfuscated. The README of jadx puts it plainly: in most cases the tool cannot decompile 100% of the code, so errors occur.

Install jadx

You need 64-bit Java 11 or later. Download the ZIP of the latest release from the project page on GitHub and unpack it. In version 1.5.7 the archive is about 75 MB. Inside bin/ there are two launchers for Linux and macOS (jadx and jadx-gui) and two matching .bat files for Windows.

One detail saves an hour of confusion: java -jar lib/jadx-1.5.7-all.jar opens the graphical interface, because that is the main class of the JAR. The command-line tool is started through the launcher script:

sh bin/jadx -d out app.apk

On a 13 KB test APK the run took 3 seconds in a container on a test VM. It ended with exit code 3 and the line finished with errors, count: 1: one method of the main activity was left undecompiled, the other seven classes came out in full. A non-zero exit code asks for a look at the log. The output is there.

Useful options

  • -d, --output-dir: where to write the result.
  • -r, --no-res: skip resources when only the code matters.
  • -s, --no-src: skip the sources when only the manifest and resources matter. This is the fast path for a flags check.
  • --deobf: generate readable, unique names for obfuscated identifiers.
  • --show-bad-code: print code that jadx knows it decompiled incorrectly.
  • --log-level ERROR: hide the warnings and keep the summary.

Read the manifest

The decoded manifest is the shortest route to the release hygiene of a build. Three attributes cover most of what auditors look for first:

grep -n "debuggable\|usesCleartextTraffic\|exported" \
  out/resources/AndroidManifest.xml

On the test APK the answer came on two lines: android:debuggable="true" and android:usesCleartextTraffic="true" on the application element. Both are findings in a release build. The debuggable flag and cleartext traffic each have a guide with the fix.

Find strings in the sources

Keys and tokens sit in string constants. A search for the prefixes of common providers is enough to locate them:

grep -rn --include="*.java" -E "AIza[0-9A-Za-z_-]{35}|sk_live_|ghp_" \
  out/sources

On the test APK this printed one line, MainActivity.java:23, with a Google API key. What such a finding means, and when a key is safe to keep in the app, is covered in the guide on leaked API keys. The DEX page shows how to read the same strings without decompiling at all.

When an online decompiler is enough

A browser-based run takes seconds and leaves nothing on the machine. It fits a quick look at one package, a locked-down laptop without Java, or a check that only needs the flags and the secrets. APKSonar works this way: the analysis runs on a server, and the report comes back with the findings sorted by severity. For a confidential build, the calculation is different. Then jadx on your own machine keeps the file inside the company network.

The right to decompile matters too. Audit the builds you publish, or the ones you are asked to test. For third-party apps the license terms and local law decide what is allowed.

Frequently asked

Is there a free online APK decompiler?

Yes. APKSonar runs the analysis on its server: you upload an APK, XAPK, AAB or DEX file and receive a report with manifest flags, leaked secrets and library versions. For hours of reading source code, the desktop tool jadx remains the reference.

Why does jadx report errors on some classes?

The jadx README states that in most cases it cannot decompile 100% of the code, so errors occur. The log names the classes and methods that failed. The rest of the output stays usable.

Can jadx open an AAB or an XAPK file?

Yes. The README lists APK, DEX, AAB, XAPK, APKM, APKS and ZIP archives as accepted inputs. An AAB or a split archive such as XAPK or APKS opens without repacking.

Is decompiled Java the original source code?

No. Comments, formatting and part of the structure are lost at compilation. Names renamed by R8 or ProGuard stay short like a and b. The logic is readable, the original text is gone.

Do I need Java to decompile an APK?

jadx needs 64-bit Java 11 or later on the machine that runs it. An online decompiler runs it on a server, so the browser is the only requirement there.

More on this topic

From other categories

All articles →