AgentStack
SKILL verified Unlicense Self-run

Android Reverse Engineering

skill-incogbyte-android-reverse-engineering-claude-skill-android-reverse-engineering · by incogbyte

Decompile Android APK, XAPK, AAB, DEX, JAR, and AAR files using jadx or Fernflower/Vineflower. Reverse engineer Android apps, extract HTTP API endpoints (Retrofit, OkHttp, Volley, GraphQL, WebSocket), trace call flows from UI to network layer, analyze security patterns (cert pinning, exposed secrets, Android Fragment Injection via exported PreferenceActivity), perform dynamic analysis with Frida…

No reviews yet
0 installs
13 views
0.0% view→install

Install

$ agentstack add skill-incogbyte-android-reverse-engineering-claude-skill-android-reverse-engineering

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Android Reverse Engineering? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Android Reverse Engineering

Decompile Android APK, XAPK, AAB, DEX, JAR, and AAR files using jadx and Fernflower/Vineflower, trace call flows through application code and libraries, analyze security patterns, produce structured documentation of extracted APIs, and perform adaptive dynamic analysis with Frida — generating custom bypass scripts based on what the static analysis finds, iterating through crash logs to refine hooks until protections are bypassed. Two decompiler engines are supported — jadx for broad Android coverage and Fernflower for higher-quality output on complex Java code — and can be used together for comparison.

Prerequisites

This skill requires Java JDK 17+ and jadx to be installed. Fernflower/Vineflower and dex2jar are optional but recommended for better decompilation quality. bundletool is required for AAB (App Bundle) files. For dynamic analysis (Phase 7), Python 3.8+, adb, and a device/emulator with frida-server are needed — the setup-frida.sh script handles the full setup. Run the dependency checker to verify:

bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/check-deps.sh

If anything is missing, follow the installation instructions in ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/references/setup-guide.md.

Workflow

Phase 1: Verify and Install Dependencies

Before decompiling, confirm that the required tools are available — and install any that are missing.

Action: Run the dependency check script.

bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/check-deps.sh

The output contains machine-readable lines:

  • INSTALL_REQUIRED: — must be installed before proceeding
  • INSTALL_OPTIONAL: — recommended but not blocking

If required dependencies are missing (exit code 1), install them automatically:

bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/install-dep.sh 

The install script detects the OS and package manager, then:

  • Installs without sudo when possible (downloads to ~/.local/share/, symlinks in ~/.local/bin/)
  • Uses sudo and the system package manager when necessary (apt, dnf, pacman)
  • If sudo is needed but unavailable or the user declines, it prints the exact manual command and exits with code 2 — show these instructions to the user

For optional dependencies, ask the user if they want to install them. Vineflower and dex2jar are recommended for best results.

After installation, re-run check-deps.sh to confirm everything is in place. Do not proceed to Phase 2 until all required dependencies are OK.

Phase 2: Decompile

Use the decompile wrapper script to process the target file. The script supports three engines: jadx, fernflower, and both.

Action: Choose the engine and run the decompile script. The script handles APK, XAPK, AAB, DEX, JAR, and AAR files.

bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/decompile.sh [OPTIONS] 

For XAPK files (ZIP bundles containing multiple APKs, used by APKPure and similar stores): the script automatically extracts the archive, identifies all APK files inside (base + split APKs), and decompiles each one into a separate subdirectory. The XAPK manifest is copied to the output for reference.

For AAB files (Android App Bundles): the script uses bundletool to generate a universal APK from the bundle, then decompiles it. bundletool must be installed (run install-dep.sh bundletool).

For DEX files: jadx handles them natively. For Fernflower, dex2jar is used as an intermediate step (same as APK files).

Options:

  • -o — Custom output directory (default: -decompiled)
  • --deobf — Enable deobfuscation (recommended for obfuscated apps)
  • --no-res — Skip resources, decompile code only (faster)
  • --engine ENGINEjadx (default), fernflower, or both

Engine selection strategy:

| Situation | Engine | |---|---| | First pass on any APK/AAB | jadx (fastest, handles resources) | | JAR/AAR library analysis | fernflower (better Java output) | | jadx output has warnings/broken code | both (compare and pick best per class) | | Complex lambdas, generics, streams | fernflower | | Quick overview of a large APK | jadx --no-res | | DEX file analysis | jadx (native support) or fernflower (via dex2jar) |

When using --engine both, the outputs go into /jadx/ and /fernflower/ respectively, with a comparison summary at the end showing file counts and jadx warning counts. Review classes with jadx warnings in the Fernflower output for better code.

For APK files with Fernflower, the script automatically uses dex2jar as an intermediate step. dex2jar must be installed for this to work.

See ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/references/jadx-usage.md and ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/references/fernflower-usage.md for the full CLI references.

Phase 3: Analyze Structure

Navigate the decompiled output to understand the app's architecture.

Actions:

  1. Read AndroidManifest.xml from /resources/AndroidManifest.xml:
  • Identify the main launcher Activity
  • List all Activities, Services, BroadcastReceivers, ContentProviders
  • Note permissions (especially INTERNET, ACCESS_NETWORK_STATE)
  • Find the application class (android:name on ``)
  1. Survey the package structure under /sources/:
  • Identify the main app package and sub-packages
  • Distinguish app code from third-party libraries
  • Look for packages named api, network, data, repository, service, retrofit, http — these are where API calls live
  1. Identify the architecture pattern:
  • MVP: look for Presenter classes
  • MVVM: look for ViewModel classes and LiveData/StateFlow
  • Clean Architecture: look for domain, data, presentation packages
  • This informs where to look for network calls in the next phases

Phase 4: Trace Call Flows

Follow execution paths from user-facing entry points down to network calls.

Actions:

  1. Start from entry points: Read the main Activity or Application class identified in Phase 3.
  1. Follow the initialization chain: Application.onCreate() often sets up the HTTP client, base URL, and DI framework. Read this first.
  1. Trace user actions: From an Activity, follow:
  • onCreate() → view setup → click listeners
  • Click handler → ViewModel/Presenter method
  • ViewModel → Repository → API service interface
  • API service → actual HTTP call
  1. Map DI bindings (if Dagger/Hilt is used): Find @Module classes to understand which implementations are provided for which interfaces.
  1. Handle obfuscated code: When class names are mangled, use string literals and library API calls as anchors. Retrofit annotations and URL strings are never obfuscated.

See ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/references/call-flow-analysis.md for detailed techniques and grep commands.

Phase 5: Extract and Document APIs

Find all API endpoints and produce structured documentation.

Action: Run the API search script for a broad sweep.

bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/find-api-calls.sh /sources/

Additional options:

  • --context N — Show N lines of context around each match (recommended: --context 3)
  • --report FILE — Export results as a structured Markdown report
  • --dedup — Deduplicate results by endpoint/URL

Targeted searches:

# Only Retrofit
bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/find-api-calls.sh /sources/ --retrofit

# Only hardcoded URLs
bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/find-api-calls.sh /sources/ --urls

# Only auth patterns
bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/find-api-calls.sh /sources/ --auth

# Only Kotlin coroutines/Flow patterns
bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/find-api-calls.sh /sources/ --kotlin

# Only RxJava patterns
bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/find-api-calls.sh /sources/ --rxjava

# Only GraphQL patterns
bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/find-api-calls.sh /sources/ --graphql

# Only WebSocket patterns
bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/find-api-calls.sh /sources/ --websocket

# Only security patterns (cert pinning, exposed secrets, debug flags)
bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/find-api-calls.sh /sources/ --security

# Full analysis with context and Markdown report
bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/find-api-calls.sh /sources/ --context 3 --dedup --report report.md

Then, for each discovered endpoint, read the surrounding source code to extract:

  • HTTP method and path
  • Base URL
  • Path parameters, query parameters, request body
  • Headers (especially authentication)
  • Response type
  • Where it's called from (the call chain from Phase 4)

Document each endpoint using this format:

### `METHOD /path`

- **Source**: `com.example.api.ApiService` (ApiService.java:42)
- **Base URL**: `https://api.example.com/v1`
- **Path params**: `id` (String)
- **Query params**: `page` (int), `limit` (int)
- **Headers**: `Authorization: Bearer `
- **Request body**: `{ "email": "string", "password": "string" }`
- **Response**: `ApiResponse`
- **Called from**: `LoginActivity → LoginViewModel → UserRepository → ApiService`

See ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/references/api-extraction-patterns.md for library-specific search patterns and the full documentation template.

Phase 6: Security Patterns Scan

Run the automated security sweep over the decompiled source to surface security-relevant patterns. This is the static baseline that Phase 8 (Security Analysis & Vulnerability Audit) later synthesizes together with the runtime findings from Phase 7.

Action: Run the security-focused search:

bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/find-api-calls.sh /sources/ --security --context 3

Look for and flag:

  • Disabled certificate pinning — custom TrustManager that trusts all certs, ALLOW_ALL_HOSTNAME_VERIFIER
  • Exposed secrets — hardcoded passwords, API keys, encryption keys in source code
  • Debug flags left onBuildConfig.DEBUG checks, staging URLs, verbose logging
  • Weak crypto — MD5 hashing, ECB mode encryption, hardcoded IVs/salts
  • Network Security Config — check res/xml/network_security_config.xml for cleartextTrafficPermitted="true" or overly broad trust anchors

These raw findings feed Phase 8. Targeted vulnerability hunting (e.g. Fragment Injection) and the RASP/anti-tamper synthesis from Phase 7's dynamic analysis happen in Phase 8.

Phase 7: Dynamic Analysis with Frida (Adaptive Loop)

Use Frida to observe and modify app behavior at runtime. Do not use pre-built generic bypass scripts. Instead, generate custom Frida scripts based on what the static analysis (Phases 3–6) revealed in the decompiled code, then iterate based on crash logs and runtime behavior.

This phase requires a connected device/emulator. The user likely already has frida-server on their device — detect it first before offering to install anything.

Step 7.1: Setup Frida Environment

Action: Run the Frida setup script. It detects the existing environment before changing anything.

bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/setup-frida.sh

The script performs these checks in order:

  1. adb connectivity — is a device/emulator connected?
  2. frida-server on device — checks common paths (/data/local/tmp/frida-server, etc.) and running processes
  3. frida-server version — extracts version from the binary on device
  4. Python 3 + venv module — required for frida-tools
  5. Creates/reuses venv — at ~/.local/share/frida-re/venv, installs frida-tools matching the device's frida-server version
  6. Version match validation — warns if client/server versions diverge
  7. Connectivity test — runs frida-ps -U to verify end-to-end

If frida-server is missing from the device, the script prints instructions. To auto-install:

bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/setup-frida.sh --install-server

Important: The venv ensures frida-tools never pollutes the global Python environment. The version matching ensures client and server are compatible. If the user already has a working frida-server, the script adapts to their version instead of forcing an upgrade.

Read the machine-readable output lines (FRIDA_VENV=, FRIDA_SERVER_VERSION=, FRIDA_DEVICE=, FRIDA_STATUS=) to configure subsequent steps.

Step 7.2: Baseline Crash Check (Before Any Hooks)

Before writing any Frida script, check if the app even runs on this device. Many apps with RASP will crash immediately on rooted devices/emulators.

Action: Launch the app and capture crash diagnostics.

bash ${CLAUDE_PLUGIN_ROOT}/skills/android-reverse-engineering/scripts/adb-crash-capture.sh -p 

Options:

  • -t — monitoring window (default: 10)
  • -a — launch specific activity instead of auto-detect
  • -o — save logcat/crash logs to directory
  • -v — include full logcat in output

Read the machine-readable output:

  • APP_STATUS=running — app is fine, proceed to runtime analysis
  • APP_STATUS=crashed — check CRASH_SIGNAL, CRASH_EXCEPTION, CRASH_MESSAGE
  • APP_STATUS=exited — app quit without a visible crash (common RASP pattern: System.exit() or Process.killProcess())

The script also outputs:

  • JAVA CRASH section — full stack trace from FATAL EXCEPTION
  • NATIVE CRASH section — signal info and native backtrace
  • RASP/SECURITY INDICATORS — log lines mentioning security, root, frida, tamper, integrity, debug, hook
  • APP LOG — last 50 lines from the app's PID

If the app runs fine (status=running), skip to Step 7.4 for runtime analysis. If the app crashes or exits, proceed to Step 7.3.

Step 7.3: Adaptive Bypass Loop

This is the core of dynamic analysis. Use the decompiled code from previous phases combined with crash logs to understand WHY the app is dying, then generate a targeted Frida script to bypass that specific check.

The loop:

1. Read crash output from Step 7.2 (or previous iteration)
2. Identify the protection mechanism:
   - Cross-reference crash class/method with decompiled code
   - Follow the stack trace back to the triggering check
   - Look for the RASP/security indicators in logs
3. Read the relevant decompiled source to understand the check logic
4. Generate a Frida script that specifically disables that check
5. Run the script and capture new crash output
6. If still crashing: repeat from step 1 (new crash = new check to bypass)
7. If running: proceed to Step 7.4

How to identify protection mechanisms from crash data:

| Crash Pattern | Likely Cause | Where to Look in Decompiled Code | |---|---|---| | System.exit(0) in stack trace | RASP calling System.exit() | Search for System.exit and Process.killProcess calls | | SecurityException | Permission or integrity check | Search for the exception class in decompiled code | | SIGABRT from native code | Native anti-tamper (frida detection, lib integrity) | Check .so libraries loaded by the app, search for dlopen, ptrace, frida strings | | App starts then immediately closes (no crash) | finish() called on Activity, or System.exit() in onCreate | Read the launcher Activity's onCreate(), look for conditional finish() calls | | RootBeer, SafetyNet, Play Integrity in logs | Root/integrity detection SDK | Search for the SDK's package in

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.