Skip to main content
Sometimes you need to modify an application’s code to access hidden information, bypass checks, or understand obfuscated logic. This page covers the complete workflow: decompile → modify → recompile → sign.

APK Decompilers

jadx

The recommended choice. Decompiles DEX to readable Java.

JD-Gui

Pioneering GUI Java decompiler. Open the APK directly in JD-Gui to inspect code.

Bytecode-Viewer

Analyze using multiple decompilers simultaneously for cross-verification.

GDA

Windows-only with extensive Android reverse engineering features.

CFR

Handles modern Java features well.

frida-DEXdump

Dumps the DEX of a running APK from memory — bypasses static obfuscation removed at runtime.
Fastest workflow: Use Visual Studio Code with the APKLab extension to automatically decompile, modify, recompile, sign, and install without running any commands. Also useful: apk.sh.

The Smali Workflow

Step 1 — Decompile with apktool

This gives you Smali code and resources. Key files to inspect:
  • res/values/strings.xml (and all XMLs under res/values/*)
  • AndroidManifest.xml
  • Any .sqlite or .db files
If apktool has trouble decoding, try apktool d APP.apk -r (skip resource decoding).

Step 2 — Modify Smali Code

Smali is the human-readable representation of Dalvik bytecode. Reference for opcodes: http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html

Hello World Example

Java source:
Equivalent Smali:

Common Light Modifications

Adding Log Output

Injecting System.loadLibrary() Early

To preload a native library in a static initializer:
Alternatively in Application.onCreate():

Step 3 — Recompile

Step 4 — Sign the APK

Sign either with jarsigner (before zipalign) or with apksigner (after zipalign) — not both. Using both will break the signature.

Understanding Dalvik / ART

  • Android apps are written in Java or Kotlin and compiled to Dalvik Executable (DEX) bytecode
  • The Android Runtime (ART) uses Ahead-of-Time (AOT) compilation of DEX to native code
  • Smali is the assembly language for DEX — the human-readable form
  • baksmali disassembles DEX to Smali; smali assembles Smali back to DEX

References