AxmlNet 1.0.0
dotnet add package AxmlNet --version 1.0.0
NuGet\Install-Package AxmlNet -Version 1.0.0
<PackageReference Include="AxmlNet" Version="1.0.0" />
<PackageVersion Include="AxmlNet" Version="1.0.0" />
<PackageReference Include="AxmlNet" />
paket add AxmlNet --version 1.0.0
#r "nuget: AxmlNet, 1.0.0"
#:package AxmlNet@1.0.0
#addin nuget:?package=AxmlNet&version=1.0.0
#tool nuget:?package=AxmlNet&version=1.0.0
AxmlNet
AxmlNet is a high-performance .NET Standard 2.1 library designed to decode Android Binary XML (AXML) files and extract them directly from APK or APKS (Split APK) containers. It supports both binary and plain text XML files with advanced format detection and optimized performance.
🚀 Features
- Smart Decoding: Automatically detects and decodes Binary AXML or plain text XML formats transparently.
- APK & APKS Support: Extract XML files seamlessly from standard
.apkfiles and.apks(Split APK) bundles. - Specialized Manifest Extraction: Dedicated
ApkManifestExtractorfor robust extraction and conversion ofAndroidManifest.xmlfiles, including handling multi-APK split containers. - High-Performance Sniffing: Utilizes
ReadOnlySpan<byte>andBinaryPrimitivesfor zero-allocation, fast header parsing and format identification.
📦 Installation
Install via the .NET CLI:
dotnet add package AxmlNet
🛠 Usage Examples
1. ApkManifestExtractor
Extract and convert manifests from APK or APKS containers, including all splits in a .apks bundle:
// Extract all manifests (for example, from an .apks split APK bundle)
var manifests = ApkManifestExtractor.ExtractBinaryManifests("app.apks");
foreach (var manifest in manifests)
{
Console.WriteLine($"Manifest extracted from: {manifest.SourceName}");
string xml = manifest.ConvertToXml();
Console.WriteLine(xml);
}
// Extract and convert the main manifest from a single APK file
string mainManifestXml = ApkManifestExtractor.ConvertManifestToXml("app.apk");
Console.WriteLine(mainManifestXml);
2. ApkBinaryXmlExtractor
Extract any XML file (layouts, configs) from an APK or APKS:
string xmlContent = ApkBinaryXmlExtractor.GetXmlContent("app.apk", "res/xml/network_security_config.xml");
Console.WriteLine(xmlContent);
3. AxmlConverter
Manually convert a binary AXML stream to a formatted XML string:
using var stream = File.OpenRead("binary_layout.xml");
var options = new AxmlConverterOptions { Indent = true, WriteXmlDeclaration = true };
string xml = AxmlConverter.ConvertToXmlString(stream, options);
Console.WriteLine(xml);
🔍 Technical Details
Binary Header Validation
The library identifies Binary AXML files by validating the Android resource chunk header (ResChunk_header):
- Chunk Type:
0x0003(RES_XML_TYPE) - Header Size:
0x0008 - Data Integrity: The internal
totalSizefield is checked to ensure consistency with the actual byte stream length.
Encoding Heuristics
For non-binary files, AxmlNet applies a heuristic approach to determine the text encoding:
- Attempts to detect standard Byte Order Marks (BOM) for UTF-8 and UTF-16 (LE/BE).
- If BOM is absent, analyzes the first 512 bytes for null-byte frequency.
- If null bytes exceed 10% within the sample, assumes UTF-16 LE encoding; otherwise, defaults to UTF-8.
⚙️ Requirements
- .NET Standard 2.1
- Dependencies:
System.Memory,System.IO.Compression
<p align="center"><i>Licensed under the MIT License.</i></p>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 130 | 2/14/2026 |