Format:Xamarin and .NET for Android assembly store
| Magic | XABA (58 41 42 41, store) / XALZ (58 41 4C 5A, LZ4 assembly) |
|---|---|
| Extensions | assemblies.blob, assemblies.<abi>.blob, libassembly-store.so |
| Endianness | little |
| License | MIT (dotnet/android) |
| Website | https://github.com/dotnet/android |
| On this wiki | Facts · Code · Notes · Topics |
How Xamarin.Android, .NET MAUI and .NET for Android pack managed assemblies in an APK: assemblies.blob / libassembly-store.so with the magic XABA, and per-assembly LZ4 compression with the magic XALZ (XAZS for Zstandard).
Identification
A Xamarin.Android, .NET MAUI or .NET for Android app is C# compiled to .NET assemblies (PE files with ECMA-335 metadata, see Format:.NET metadata (ECMA-335)). A native disassembler only sees the Mono or CoreCLR runtime, libmonodroid.so and friends. The managed code lives in the assembly store, not in classes.dex.
Store layout (XABA)
From Documentation/project-docs/AssemblyStores.md (dotnet/android): little-endian; header of 5 u32: magic 0x41424158 (bytes 58 41 42 41, "XABA"), format version (the doc states 3 as current), entry count, index entry count, index size. Then the index (entries: u32 CRC32 hash of the name, u32 descriptor index, u8 ignore flag; usually 2x entry count because each assembly is listed with and without extension), the descriptor table (7 u32 per assembly: mapping index, data offset, data size, debug data offset/size, config data offset/size), then name strings (u32 length + UTF-8) and the assembly bytes. Older versions (v1/v2) split a main index store from per-ABI stores; the reader code under .github/skills/read-assembly-store in the repo handles V1 and V2.
Where it lives depends on the build:
- old Mono-based:
assemblies/assemblies.blobplusassemblies.<abi>.blobin the APK, or looseassemblies/*.dllwhen not packed; - later:
lib/<abi>/libassemblies.<abi>.blob.so; - current main (CoreCLR host):
lib/<abi>/libassembly-store.so, an ELF wrapper whose loadable sectionpayloadis referenced by the exported symbol_assembly_store; the extracted payload starts withXABA.
Extract: unzip the APK, take the file for your ABI, for the .so wrapper use llvm-objcopy --dump-section=payload=payload.bin libassembly-store.so, then read the descriptors. The dotnet/android repo ships C# reader scripts (read-assembly-store, extract-android-assemblies skills) and the community tool pyxamstore handles the older stores (Unverified).
The version word
The second header word is not a plain counter. In src/native/clr/include/xamarin-app.hh (dotnet/android 93b63f5a6cd6, lines 11-30) it is format version | 64-bit flag | ABI: bit 31 (0x80000000) is set for 64-bit builds, bits 16-23 hold the ABI (0x00010000 aarch64, 0x00020000 arm, 0x00030000 x86-64, 0x00040000 x86) and the low bits hold the format version, 3 at that commit. So an arm64-v8a store written by that tool chain has the version word 0x80010003 (bytes 03 00 01 80). AssemblyStoreGenerator.cs (lines 54-62) defines the same constants for the writer. The Mono-based tool chain at the tag 35.0.92 (commit be1cab923267) used 2 | 64-bit flag | ABI (src/native/xamarin-app-stub/xamarin-app.hh line 37), so the same file can be XABA version 2 (Mono) or 3 (CoreCLR host). The readers under tools/assembly-store-reader-mk2 have StoreReader_V1.cs and StoreReader_V2.cs; a V3 reader is in the repository's read-assembly-store skill: Unverified here.
Compressed assemblies (XALZ)
Each assembly in the store may be compressed: 12-byte header with magic 0x5A4C4158 (58 41 4C 5A, "XALZ", LZ4), a u32 descriptor index, a u32 uncompressed length, then one raw LZ4 block (Format:LZ4). Which magic a build uses depends on the host runtime: the Mono-based tag 35.0.92 defines only COMPRESSED_DATA_MAGIC = 0x5A4C4158 ('XALZ', src/native/xamarin-app-stub/xamarin-app.hh line 15, also AssemblyCompression.cs line 47), while the CoreCLR host at main (93b63f5a6cd6, src/native/clr/include/xamarin-app.hh line 8) defines COMPRESSED_DATA_MAGIC = 0x535A4158 ('XAZS', Zstandard) and no XALZ constant; both use the same 12-byte CompressedAssemblyHeader {magic, descriptor_index, uncompressed_length}. Unverified: that XAZS payloads are a single Zstandard frame (read the CoreCLR host decompression code). After decompression you get a normal PE: open it in a .NET decompiler (dnSpy, ILSpy). If the first bytes of an extracted .dll are XALZ instead of MZ, it is still compressed.
Notes
Apps may also be AOT-compiled (ReadyToRun or Mono AOT in libaot-<assembly>.dll.so) or NativeAOT; then IL may be missing or stripped. Unverified: Mono AOT naming. See Technique:Cross-platform app frameworks, Platform:Android, Format:APK.
Code & repositories
- https://github.com/dotnet/android @
93b63f5a6cd6774acdf7c58f1d4f1fb69d91f76e· license: MIT
.NET for Android (xamarin-android): assembly store docs and C# store readers.
Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-10-18