Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
619e559
Scaffolding for the new app
grendello Jul 3, 2025
21fcd29
Slight IAspect changes + some flesh for the skeleton
grendello Jul 4, 2025
01552ab
A few steps more
grendello Jul 7, 2025
f4aeb90
Assembly stores progress
grendello Jul 7, 2025
092a3b9
Oops, forgot to add this one, doh
grendello Jul 8, 2025
cd48e36
Progressing with assembly stores + shared libraries
grendello Jul 8, 2025
aa69c97
More assembly store code
grendello Jul 9, 2025
7794263
AssemblyStore + Assembly reading
grendello Jul 10, 2025
27012b1
Oops, forgot to commit this one
grendello Jul 11, 2025
a7b37fa
More assembly store + assemblies
grendello Jul 11, 2025
d9b7b83
Android binary XML parser (for in-package AndroidManifest.xml)
grendello Jul 14, 2025
2239421
Android manifest almost finished (protobuf missing) + native bits
grendello Jul 15, 2025
757b630
NativeAOT detection support
grendello Sep 22, 2025
02bbaf5
Let's do some reporting
grendello Sep 23, 2025
9508e5e
More info about shared libraries
grendello Sep 24, 2025
594cc42
More NAOT goodies
grendello Sep 24, 2025
df30422
Moving on with reporters
grendello Sep 25, 2025
d154dfe
Application package reporter continued
grendello Sep 25, 2025
73f55f6
libxamarin-app.so reporter (beginnings)
grendello Sep 26, 2025
b6f3184
Some more basic app info from the manifest
grendello Sep 26, 2025
7a7c921
Revamp shared libraries aspect states, lighter now
grendello Sep 26, 2025
8d92dc4
Various odds and ends
grendello Sep 26, 2025
14095b0
TODOs
grendello Sep 26, 2025
f9b88e6
Add protobuf generated code to read AAB manifest
grendello Oct 7, 2025
a1c6a0d
Protobuf appears to work, next step: conversion to System.Xml
grendello Oct 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tools/apput/projects/.placeholder
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory will contain .csproj files to be used by 3rd parties (e.g. XABT tests)
60 changes: 60 additions & 0 deletions tools/apput/src/Android/ARSCHeader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System;
using System.IO;

namespace ApplicationUtility;

class ARSCHeader
{
// This is the minimal size such a header must have. There might be other header data too!
const long MinimumSize = 2 + 2 + 4;

readonly long start;
readonly uint size;
readonly ushort type;
readonly ushort headerSize;
readonly bool unknownType;

public AndroidManifestChunkType Type => unknownType ? AndroidManifestChunkType.Null : (AndroidManifestChunkType)type;
public ushort TypeRaw => type;
public ushort HeaderSize => headerSize;
public uint Size => size;
public long End => start + (long)size;

public ARSCHeader (Stream data, AndroidManifestChunkType? expectedType = null)
{
start = data.Position;
if (data.Length < start + MinimumSize) {
throw new InvalidDataException ($"Input data not large enough. Offset: {start}");
}

// Data in AXML is little-endian, which is fortuitous as that's the only format BinaryReader understands.
using BinaryReader reader = Utilities.GetReaderAndRewindStream (data, rewindStream: false);

// ushort: type
// ushort: header_size
// uint: size
type = reader.ReadUInt16 ();
headerSize = reader.ReadUInt16 ();

// Total size of the chunk, including the header
size = reader.ReadUInt32 ();

if (expectedType != null && type != (ushort)expectedType) {
throw new InvalidOperationException ($"Header type is not equal to the expected type ({expectedType}): got 0x{type:x}, expected 0x{(ushort)expectedType:x}");
}

unknownType = !Enum.IsDefined (typeof(AndroidManifestChunkType), type);

if (headerSize < MinimumSize) {
throw new InvalidDataException ($"Declared header size is smaller than required size of {MinimumSize}. Offset: {start}");
}

if (size < MinimumSize) {
throw new InvalidDataException ($"Declared chunk size is smaller than required size of {MinimumSize}. Offset: {start}");
}

if (size < headerSize) {
throw new InvalidDataException ($"Declared chunk size ({size}) is smaller than header size ({headerSize})! Offset: {start}");
}
}
}
Loading
Loading