Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Platform:Android

From ReverseEngineering.wiki
Platform
On this wiki Facts · Code · Notes · Topics

Google's mobile OS: apps ship as APK (ZIP) files holding DEX bytecode, binary XML manifest, resources.arsc and per-ABI native ELF libraries; the runtime (ART) compiles DEX to OAT/VDEX/ART files.

Overview

An Android app is an Format:APK (a ZIP). Java/Kotlin code is in classes.dex, classes2.dex... (Format:DEX); the manifest is binary XML (Format:AXML); resources are indexed in Format:resources.arsc; native code lives in lib/<abi>/*.so as Format:ELF (Executable and Linkable Format) files. The package is signed with JAR signatures in META-INF and/or the Format:APK Signing Block (v2, v3, v4).

Runtime artifacts

ART (Android Runtime) compiles apps ahead of time into Format:OAT (an ELF wrapper around compiled code), Format:VDEX (verification data and DEX copies) and Format:ART image (heap image) files, found next to the APK or under /data/dalvik-cache and /system.

Native libraries and JNI

ABI directories: armeabi-v7a, arm64-v8a, x86, x86_64 (older: armeabi, mips). A native Java method bar in class com.example.Foo is bound either by symbol name Java_com_example_Foo_bar (dots become _, a literal _ becomes _1, ; becomes _2, [ becomes _3, non-ASCII becomes _0xxxx; overloaded methods append __ and the mangled argument signature) or dynamically from JNI_OnLoad through RegisterNatives (then no exported symbol names exist; look for the JNINativeMethod table {name, signature, fnPtr}). System.loadLibrary("foo") loads libfoo.so.

Full topic page: Platform:Android/Native libraries and JNI (JNIEnv table, JNINativeMethod, signatures, libc++ __ndk1, .note.android.ident).

Reversing checklist

  • Unzip (entries may carry odd flags or duplicate names to confuse tools).
  • Decode the manifest (Format:AXML) for package name, permissions, components, minSdkVersion.
  • Disassemble DEX, then follow native methods to the .so.

Tools: apktool, androguard, jadx, LIEF (source repositories on Format:AXML and Format:APK Signing Block).

Topics

  • Native libraries and JNI — How native code in an Android app is built and bound: lib/<abi>/*.so, JNI_OnLoad and RegisterNatives, Java_ symbol mangling, JNI type signatures, the JNIEnv…
  • App packaging — The ways an Android app is delivered besides one APK: App Bundles, split APKs, .apks/XAPK/APKM archives, OBB expansion files, Play Asset Delivery packs, APEX…

Code & repositories

  • https://android.googlesource.com/platform/libnativehelper @ aef2939781fc0b57b4477df7160935cdf5697919 · license: Apache-2.0 (read from NOTICE)
    AOSP libnativehelper: jni.h (JNIEnv and JavaVM tables, JNINativeMethod, JNI constants) and JNIHelp.h helpers such as jniRegisterNativeMethods.
    Tested on: source read, not run: read only · checked 2026-10-18; last activity 2024-12-20
  • https://android.googlesource.com/platform/bionic @ 731631f300090436d7f5df80d50b6275c8c60a93 · license: unknown
    AOSP bionic C library; crtbrand.S defines the .note.android.ident note and crt_pad_segment.S the .note.android.pad_segment note.
    Tested on: source read, not run: read only · checked 2026-10-18; last activity 2025-03-26
  • https://android.googlesource.com/platform/ndk @ c4bdd155116a9b42767534b35e93f83a91e4a06f · license: Apache-2.0 (read from NOTICE)
    Android NDK source tree: build-system maintainer docs (ABIs, triples, libc++ static and shared) and per-release changelogs.
    Tested on: source read, not run: read only · checked 2026-10-18; last activity 2025-03-28
  • https://github.com/google/bundletool @ 586a43a450712a1067f3d92cf7574dee68226302 · license: Apache-2.0
    Official AAB tool; protobuf schemas for BundleConfig, targeting and the .apks toc.pb
    Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2025-12-15; Note: the latest release ships binaries; the wiki links only the source, never the binaries
  • https://github.com/Aefyr/SAI @ 55505d231b1390e824d1cc0c8f4fa35fd4677105 · license: GPL-3.0
    Split APKs Installer (GPL-3.0): XAPK manifest.json and APKM info.json readers
    Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2024-06-03; Note: the latest release ships binaries; the wiki links only the source, never the binaries

See also