Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
044005a
Scaffolding for the new app
grendello Jul 3, 2025
171832c
Slight IAspect changes + some flesh for the skeleton
grendello Jul 4, 2025
c0dc6c3
A few steps more
grendello Jul 7, 2025
db9479a
Assembly stores progress
grendello Jul 7, 2025
619e542
Oops, forgot to add this one, doh
grendello Jul 8, 2025
8b25899
Progressing with assembly stores + shared libraries
grendello Jul 8, 2025
3b6f5f6
More assembly store code
grendello Jul 9, 2025
698a568
AssemblyStore + Assembly reading
grendello Jul 10, 2025
88370c8
Oops, forgot to commit this one
grendello Jul 11, 2025
cfe4891
More assembly store + assemblies
grendello Jul 11, 2025
726397f
Android binary XML parser (for in-package AndroidManifest.xml)
grendello Jul 14, 2025
84bf388
Android manifest almost finished (protobuf missing) + native bits
grendello Jul 15, 2025
e34cbcb
NativeAOT detection support
grendello Sep 22, 2025
0efea36
Let's do some reporting
grendello Sep 23, 2025
ee84275
More info about shared libraries
grendello Sep 24, 2025
c3c0791
More NAOT goodies
grendello Sep 24, 2025
bf54445
Moving on with reporters
grendello Sep 25, 2025
b199b1a
Application package reporter continued
grendello Sep 25, 2025
c943d8a
libxamarin-app.so reporter (beginnings)
grendello Sep 26, 2025
45a09e6
Some more basic app info from the manifest
grendello Sep 26, 2025
b2e71aa
Revamp shared libraries aspect states, lighter now
grendello Sep 26, 2025
b3d639b
Various odds and ends
grendello Sep 26, 2025
51c9699
TODOs
grendello Sep 26, 2025
8f81bf9
Add protobuf generated code to read AAB manifest
grendello Oct 7, 2025
d76dd7d
Protobuf appears to work, next step: conversion to System.Xml
grendello Oct 7, 2025
bc66cdd
Load manifest from protobuf
grendello Oct 8, 2025
fd5abba
Markdown rendering.
grendello Oct 9, 2025
9a37a68
Beginnings of a unified output presenter
grendello Oct 10, 2025
d3cc01a
Rendering is a mess, need a different way to do it. TBC tomorrow
grendello Oct 13, 2025
dea328f
New markdown construction class. Rendering TBD.
grendello Oct 15, 2025
9035768
Markdown rendering works now
grendello Oct 15, 2025
27f76e3
Tweak
grendello Oct 16, 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