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

Format:APK

From ReverseEngineering.wiki
Format
Platforms Platform:Android
Magic 50 4B 03 04 (ZIP)
Extensions .apk
On this wiki Facts · Code · Notes · Topics

Android application package (.apk; split sets .apks/.xapk): a ZIP holding AndroidManifest.xml (binary XML), classes*.dex, resources.arsc, res/, lib/<abi>/*.so, assets/ and signatures (META-INF and the APK Signing Block).

Layout

  • AndroidManifest.xml: binary XML, see Format:AXML.
  • classes.dex, classes2.dex ...: Format:DEX (multidex).
  • resources.arsc: Format:resources.arsc; res/**: compiled resources (binary XML layouts, PNG, 9-patch) whose names are often obfuscated to res/a1.xml.
  • lib/<abi>/lib*.so: native libraries (Format:ELF (Executable and Linkable Format)); may be stored uncompressed and page-aligned so they can be mapped directly.
  • assets/**: raw files, unmodified.
  • META-INF/MANIFEST.MF, *.SF, *.RSA|*.DSA|*.EC: v1 (JAR) signature. The v2+ signature is not a ZIP entry: it is the Format:APK Signing Block between the last entry and the central directory.

Parsing pitfalls

The Android installer reads the central directory; tools differ on malformed ZIPs (duplicate names, wrong local header sizes, bogus compression methods). Locate the End Of Central Directory record (50 4B 05 06) from the end of the file. The apk-parser and androguard parsers handle these cases (see the repositories on Format:APK Signing Block and Format:AXML).

Related

On-device compiled forms: Format:OAT, Format:VDEX, Format:ART image.

See also

Code & repositories

  • https://github.com/androguard/apk-parser @ 6cb8fd1dfcb4f650db1ec4d12faf3ae0bce027fe · license: Apache-2.0
    APK parser (manifest, signatures, resources)
    Tested on: source read, not run: source reading · checked 2026-10-18; last activity 2026-10-12