AlphaOmega.ApkReader 2.0.10

dotnet add package AlphaOmega.ApkReader --version 2.0.10
                    
NuGet\Install-Package AlphaOmega.ApkReader -Version 2.0.10
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AlphaOmega.ApkReader" Version="2.0.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AlphaOmega.ApkReader" Version="2.0.10" />
                    
Directory.Packages.props
<PackageReference Include="AlphaOmega.ApkReader" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AlphaOmega.ApkReader --version 2.0.10
                    
#r "nuget: AlphaOmega.ApkReader, 2.0.10"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AlphaOmega.ApkReader@2.0.10
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AlphaOmega.ApkReader&version=2.0.10
                    
Install as a Cake Addin
#tool nuget:?package=AlphaOmega.ApkReader&version=2.0.10
                    
Install as a Cake Tool

Apk Reader

Auto build NuGet NuGet Downloads

Android APK analysis library. Reads:

  • AndroidManifest.xml (binary AXML → strongly typed model)
  • resources.arsc (resource table)
  • classes*.dex (Dalvik/DEX structures)
  • JAR V1 (MANIFEST.MF / *.SF) & APK V2+ signature block metadata
  • Generic files inside the ZIP/APK container

Target frameworks: .NET Framework 2.0, .NET Standard 2.0, .NET 8

Installation

NuGet:

Install-Package AlphaOmega.ApkReader
# or
dotnet add package AlphaOmega.ApkReader

Quick usage

using System;
using System.IO;
using AlphaOmega.Debug;
using AlphaOmega.Debug.Dex; // If you process dex

String apkPath = "app.apk";
using(ApkFile apk = new ApkFile(apkPath))
{
    if(!apk.IsValid)
    {
        Console.WriteLine("Invalid APK structure");
        return;
    }

    // Manifest (strongly typed)
    if(apk.AndroidManifest != null)
    {
        Console.WriteLine("Package: {0}", apk.AndroidManifest.Package);
        Console.WriteLine("Version: {0} ({1})", apk.AndroidManifest.VersionName, apk.AndroidManifest.VersionCode);
        Console.WriteLine("App Label: {0}", apk.AndroidManifest.Application.Label);
    }

    // Permissions
    foreach(String perm in apk.UsesPermission)
        Console.WriteLine("Permission: {0}", perm);

    // Resources
    if(apk.Resources != null)
        Console.WriteLine("Resource entries: {0}", apk.Resources.ResourceMap.Count);

    // Enumerate files
    foreach(String filePathInApk in apk.EnumerateFiles())
    {
        if(Path.GetExtension(filePathInApk).Equals(".dex", StringComparison.OrdinalIgnoreCase))
        {
            using(Stream stream = apk.GetFile(filePathInApk, checkSignature:true)?.Let(b => new MemoryStream(b)))
            {
                if(stream != null)
                using(DexFile dex = new DexFile(new StreamLoader(stream)))
                {
                    Console.WriteLine("Dex: strings={0} types={1} methods={2}",
                        dex.StringIdItems.Length,
                        dex.TypeIdItems.Length,
                        dex.MethodIdItems.Length);
                }
            }
        }
    }
}

// Helper extension (optional)
static class Extensions
{
    public static T Let<TIn,T>(this TIn value, Func<TIn,T> selector) => selector(value);
}

Main types

  • ApkFile – entry point for reading APK internals
  • AxmlFile – raw binary Android XML file parser
  • AndroidManifest – strongly typed manifest (sections map to resources where needed)
  • ArscFile – resources.arsc reader (header + resource table)
  • DexFile – Dalvik/DEX format reader (map list, string/type/proto/field/method/class structures, code items, try/catch handlers)
  • ApkSignature – APK signatures (V1 JAR manifest + V2+ signature block). Extracts issuer certificate (V2) where available
  • MfFile – JAR file integrity validation (MANIFEST.MF)

Signatures & Validation

  • V1 (JAR): validates file hashes via MANIFEST.MF
  • V2+: reads APK Signature Block (see Android docs)
  • Use apk.Signatures to access schemes. Example:
var sig = apk.Signatures;
bool hasV1 = sig.V1SchemeBlock.Manifest != null;
var certs = sig.V2SchemeBlock?.SignerCertificates; // May be null

Getting file bytes

byte[] manifestBytes = apk.GetFile("AndroidManifest.xml", checkSignature:true);
byte[] dexBytes = apk.GetFile("classes.dex");

checkSignature:true performs hash validation against V1 manifest when possible.

Projects using this package

Component relationships

flowchart TD
    ApkFile[ApkFile] --> AxmlFile[AxmlFile]
    ApkFile --> AndroidManifest[AndroidManifest]
    ApkFile --> ArscFile[ArscFile]
    ApkFile --> DexFile[DexFile]
    ApkFile --> ApkSignature[ApkSignature]
    ApkSignature --> MfFile[MfFile]
    ApkSignature --> V1Scheme[V1 Scheme JAR]
    ApkSignature --> V2Scheme[V2+ Scheme Block]
    AndroidManifest --> AxmlFile
    AndroidManifest --> ArscFile

Supported structures (summary)

  • ApkFile
    • XmlFile – AndroidManifest.xml (raw AXML)
    • Resources – resources.arsc
    • AndroidManifest – typed manifest
  • ApkSignature
    • Signature block, V1 / V2 metadata, issuer certificate extraction (needs broader testing)
  • ArscFile
    • Header
    • ResourceMap (id, value(s))
  • MfFile
    • JAR integrity (MANIFEST.MF / *.SF)
  • AxmlFile
    • Typed sections mapped to resources
  • DexFile (Dalvik format)
    • map_list, STRING_ID_ITEM / STRING_DATA_ITEM, TYPE_ID_ITEM, TYPE_LIST
    • PROTO_ID_ITEM, FIELD_ID_ITEM, METHOD_ID_ITEM
    • CLASS_DEF_ITEM + CLASS_DATA_ITEM (encoded_field / encoded_method)
    • CODE_ITEM (bytecode payload)
    • try_item, encoded_catch_handler_list, encoded_type_addr_pair

Performance notes

Lazy loading: manifest, resources and signature blocks load only when first accessed. Large files: prefer stream constructor to avoid copying bytes.

Limitations / TODO

  • More exhaustive V2/V3 signature validation
  • Resource value convenience helpers
  • Multi-dex convenience enumeration
  • Unit tests coverage expansion
  • .NET Framework 2.0 version contains the reference to SharpZipLib 0.86.0 with vulnerabilities. Upgrade when possible.

Development

Clone and build:

git clone https://github.com/DKorablin/ApkReader.git
cd ApkReader
# Build (uses multi-target project)
dotnet build
Product 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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net20 is compatible.  net35 was computed.  net40 was computed.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on AlphaOmega.ApkReader:

Repository Stars
deemoun/PulseAPK-Core
PulseAPK Core: Cross-Platform tool for working with APK files: Decompilation, Analysis, Building
Version Downloads Last Updated
2.0.10 1,668 2/23/2026
2.0.9 1,899 10/28/2025
2.0.5 2,560 8/30/2023
1.0.8415.36134 594 1/15/2023