# How to Decompile an APK: jadx, apktool and Online

Get the APK off a phone or out of a bundle, decompile it to Java with jadx, disassemble it to smali with apktool, and rebuild it.

By Android APK Decompiler (https://www.decompileandroid.com/). Published 2026-12-02, updated 2026-12-02. Web page: https://www.decompileandroid.com/guides/how-to-decompile-an-apk/

An APK is a zip file. Inside are the app’s code as Dalvik bytecode in one or more `classes.dex` files, its compiled resources and `AndroidManifest.xml`, and often native libraries in `lib/`. Decompiling turns the bytecode back into Java you can read. Disassembling turns it into smali, a readable form of the bytecode that you can edit and build back into an APK.

**Short answer:** to read the code, run `jadx -d app-src app.apk`, or upload the file to the [online decompiler](https://www.decompileandroid.com/) to skip installing anything. To change the app and rebuild it, use `apktool d app.apk -o app-smali`, edit the smali, and build it with `apktool b`.

## Which tool for which job

| You want to | Use | You get |
| --- | --- | --- |
| Read the code | [jadx](https://github.com/skylot/jadx) | Java source files, plus decoded resources |
| Browse and search the code | jadx-gui | A code browser with search, usages and renaming |
| Change the app and rebuild it | [apktool](https://apktool.org/) | smali and resources you can build back into an APK |
| See the manifest and resources only | jadx or apktool | Readable `AndroidManifest.xml`, layouts and strings |
| Avoid installing anything | [decompileandroid.com](https://www.decompileandroid.com/) | A zip with jadx’s Java and resources and apktool’s smali |

Both jadx and apktool are free and open source, and both need Java. For more tools, including commercial ones, see [Android decompilers compared](https://www.decompileandroid.com/guides/android-decompilers-compared/).

## Step 1: Get the APK

### From a phone, with adb

Turn on USB debugging in the phone’s developer options, connect it, and find the app’s package name and the paths of its APK files:

```shell
adb shell pm list packages | grep binaryeye
adb shell pm path de.markusfisch.android.binaryeye
```

The second command prints one `package:` line per file. Apps installed from Google Play usually print several: `base.apk` plus split APKs such as `split_config.arm64_v8a.apk` (native libraries for the phone’s processor), `split_config.en.apk` (strings for its language) and `split_config.xxhdpi.apk` (images for its screen). Pull each one with the path after `package:`:

```shell
adb pull /data/app/~~Xk3…==/de.markusfisch.android.binaryeye-9Qa…==/base.apk
```

The code is almost always in `base.apk`. Apps that use dynamic feature modules keep some of it in other splits, named after the feature.

### From an app bundle or a split APK file

- **.aab** (Android App Bundle): the format developers upload to Google Play. jadx opens it directly. To get an installable APK from your own bundle, use Google’s [bundletool](https://developer.android.com/tools/bundletool) with `build-apks --mode=universal`.
- **.xapk, .apkm and .apks**: zip files of split APKs made by download sites and backup apps. jadx reads them directly; otherwise unzip them and use the APK files inside.

APKs from download sites can be modified. If it matters, compare the signing certificate (`apksigner verify --print-certs app.apk`) with one from a copy you trust.

## Step 2: Decompile to Java with jadx

Download the latest release from [jadx’s GitHub releases](https://github.com/skylot/jadx/releases) and unzip it; the `bin` folder has `jadx` and `jadx-gui`. On a Mac, `brew install jadx` works too. jadx needs Java 11 or newer; on Windows, the release named `with-jre` includes Java.

```shell
jadx -d app-src app.apk
```

This writes the Java code to `app-src/sources/` and the decoded manifest, resources and assets to `app-src/resources/`. For the split APKs from a phone, pass them all: `jadx -d app-src base.apk split_*.apk`. On Binary Eye 1.75.6, an open-source barcode scanner, jadx 1.5.6 decompiles all 2,611 classes in a few seconds on a laptop.

jadx usually finishes with a line like `ERROR - finished with errors, count: 6`. That means a few methods couldn’t be turned into Java; the rest of the output is complete. Those methods appear with a comment saying why, and `--show-bad-code` prints jadx’s best attempt at them.

Options worth knowing:

- `--deobf` renames short obfuscated names such as `a` and `b` to longer unique ones, so a search for a name finds only that class or method.
- `-e` (`--export-gradle`) saves the output as a Gradle project you can open in Android Studio. It won’t build without fixes, but navigation and search work.
- `--mappings-path mapping.txt -Prename-mappings.invert=yes` applies the `mapping.txt` that R8 or ProGuard wrote during the build, which restores the original names if the app is yours. The `invert` option is needed because the file maps original names to obfuscated ones.
- `-r` skips resources and `-s` skips code, when you only need one of them.
- `--single-class com.example.Foo` decompiles one class instead of the whole app.

For exploring an app, `jadx-gui app.apk` is easier than reading files: it searches code and resources, jumps to definitions, finds usages, lets you rename classes and methods as you work out what they do, and shows the smali of any class next to its Java.

## Step 3: Disassemble, edit and rebuild with apktool

jadx’s Java is for reading; it rarely compiles. To change an app, work on smali instead. Download `apktool.jar` from [apktool.org](https://apktool.org/) (or `brew install apktool`) and run:

```shell
apktool d app.apk -o app-smali
```

The folder holds the decoded `AndroidManifest.xml`, `res/` with the resources as XML, `smali/` (plus `smali_classes2/` and so on for apps with several dex files), `assets/`, `lib/` and `apktool.yml`, which apktool needs to rebuild. Each class is one `.smali` file. A method that reads a setting looks like this:

```smali
.method public static isEnabled(Landroid/content/Context;)Z
    .locals 2

    const-string v0, "beta_features"

    const/4 v1, 0x0

    invoke-static {p0, v0, v1}, Lcom/example/Settings;->getBoolean(Landroid/content/Context;Ljava/lang/String;Z)Z

    move-result v0

    return v0
.end method
```

`v0` and `v1` are registers for local values and `p0` is the first parameter. `const-string` loads a string, `invoke-static` calls a method, and `move-result` takes its return value. Release builds also have many `.line` lines, which only map instructions to line numbers.

After editing, build, align and sign the APK. `zipalign` and `apksigner` come with the Android SDK build tools, and `keytool` with Java:

```shell
apktool b app-smali -o app-unsigned.apk
zipalign -p -f 4 app-unsigned.apk app-aligned.apk
keytool -genkeypair -keystore test.keystore -alias test -keyalg RSA -validity 10000
apksigner sign --ks test.keystore --out app-signed.apk app-aligned.apk
adb install app-signed.apk
```

The rebuilt app is signed with your key, not the developer’s, so Android won’t install it over the original: uninstall that first. For an app made of split APKs, sign every split with the same key and install them together with `adb install-multiple`. Apps that check their own signature or use Google Play Integrity may refuse to run.

Two apktool options help when you test your own app: `--debuggable` marks the rebuilt app as debuggable, and `--net-sec-conf` adds a network security configuration that trusts user-installed certificates, so a proxy such as Burp Suite or mitmproxy can show its HTTPS traffic.

## Or decompile it online

[decompileandroid.com](https://www.decompileandroid.com/) runs jadx 1.5.6 and apktool 3.0.3 for you. Upload an .apk, .aab, .xapk, .apks, .apkm, .dex, .jar or .aar file of up to 500 MB and download a zip with three folders: `sources/` with jadx’s Java, `resources/` with the manifest and resources, and `apktool/` with smali you can rebuild with `apktool b apktool`. Your files can only be reached through the private link you get after uploading.

## Why the decompiled code looks odd

- **Short names like `a`, `b` and `defpackage`:** release builds are shrunk with R8 (or ProGuard), which renames classes, methods and fields and often moves classes into the default package; jadx puts those in a folder called `defpackage`. The original names are gone. Classes the app’s manifest and layouts refer to, such as activities, keep theirs, and so do library classes the app keeps for reflection. Start from those.
- **Kotlin:** jadx writes Java even for Kotlin apps. It uses the Kotlin metadata stored in the classes to restore names where it can, but coroutines and inline functions still look different from the source.
- **Methods that failed:** some bytecode doesn’t map back to Java, usually in very large methods or code processed by an obfuscator. Read the smali for those, in jadx-gui or apktool’s output.
- **Almost no app code at all:** the app is probably built with Flutter, React Native, Unity or .NET, which keep their code outside the dex files. See [Decompiling Flutter, React Native, Unity and .NET apps](https://www.decompileandroid.com/guides/decompile-flutter-react-native-unity-apps/).
- **Code in `lib/`:** `.so` files are compiled C or C++ for each processor. They need a native disassembler such as Ghidra, not a Java decompiler.

## Is it legal?

Decompiling your own apps, open-source apps, and apps you have permission to test is fine. For other apps it depends on where you are and why: many countries allow decompiling for interoperability or security research under conditions, while app licenses and terms of service often forbid it. Publishing or distributing a modified app almost always infringes the developer’s copyright. This is not legal advice; check the rules that apply to you.

## Common questions

### Can I get the original source code back?

No. Compiling removes comments, formatting and, in release builds, most names, and decompilers write their own version of the logic. You get code that does the same thing and is usually readable, not the developer’s files.

### Can I decompile an APK to Kotlin?

Decompilers write Java, even for Kotlin apps. The Java is usually close enough to follow the logic, and jadx restores many Kotlin names from the metadata in the classes.

### Why won’t the decompiled code compile?

Decompiled Java is an approximation: inner classes, lambdas, loops and generics can come out in forms that don’t compile, and some methods fail entirely. To modify an app, edit apktool’s smali instead and rebuild with `apktool b`.

### Can I decompile an app without a computer?

Yes: copy the APK off the phone with a file manager or a backup app, then upload it to [decompileandroid.com](https://www.decompileandroid.com/) from the phone’s browser.

---

Android APK Decompiler (https://www.decompileandroid.com/) decompiles Android apps online: upload an APK, AAB or split APK and download its Java source code, resources and smali.
