Skip to main content

Overview

Android apps are distributed as .apk files, ZIP archives containing compiled Dalvik bytecode (.dex), resources, and the manifest. Reverse engineering converts that bytecode back to readable Java/Kotlin source to find hardcoded secrets, logic flaws, and attack surface. Primary tool: JADX, decompiles .dex → Java source directly, no intermediate smali step required.

JADX

Install

Verify:

Decompile: CLI

Decompile APK to Java source:
Output structure:
Decompile with debug info preserved:
Export as Gradle project (importable in Android Studio):

Decompile: GUI

Key GUI features:
  • Tree view of all packages/classes
  • Built-in search across all decompiled source (Ctrl+Shift+F)
  • Cross-reference view, see every caller of a method
  • Inline smali view alongside Java
  • Jump to declaration (Ctrl+Click)

Hunting for Secrets

Hardcoded Strings (CLI)

After decompilation, grep the source:

strings.xml and resources

BuildConfig: often contains env flags and keys

Example find:

Analyzing Authentication Logic

Find Login Activity

Example decompiled login:
Client-side authentication check → bypass via Frida or patching.

Find Crypto Usage

Example weak crypto find:

Find Network Calls / Endpoints

Example Retrofit config:
Map all endpoints defined in the interface:

Find Root / Tamper Detection

Example detection logic to bypass:
Bypass: hook isRooted() with Frida to always return false.

Repackaging (Patch + Resign)

Modify decompiled smali, repack, and sign to test logic bypasses: Step 1: Decode with apktool (smali level):
Step 2: Edit smali (e.g. bypass root check):
Step 3: Rebuild:
Step 4: Sign:
Step 5: Install:

Workflow Summary