Skip to content

feat: Support Zstandard-compressed assemblies on Android (.NET 11) - #5575

Open
jamescrosswell wants to merge 8 commits into
feat/assemblystore-v4from
feat/assemblystore-zstd
Open

jamescrosswell wants to merge 8 commits into
feat/assemblystore-v4from
feat/assemblystore-zstd

Conversation

@jamescrosswell

Copy link
Copy Markdown
Collaborator

Stacked on #5574 — review that first; this PR's diff is only the Zstandard change.

.NET 11 compresses assemblies in the Android assembly store with Zstandard instead of LZ4 (dotnet/android#11730). The 12-byte header (magic / descriptor index / uncompressed length) is unchanged; only the magic (XALZXAZS) and the codec differ.

Closes #5346

Summary

  • ArchiveUtils.TryDecompressLZ4TryDecompress, which recognises both magics and dispatches to LZ4 or Zstandard.
  • Zstandard uses the BCL's System.IO.Compression.ZstandardDecoder on net11.0 — no new package dependency.
  • On net10.0 a XAZS payload throws NotSupportedException with a clear message instead of handing compressed bytes to PEReader (which failed with an obscure BadImageFormatException). Only .NET 11 apps produce XAZS, and those resolve the net11.0 build, so this is defensive.
  • New ArchiveUtilsTests round-trip a real PE image through uncompressed, LZ4, Zstandard and MemorySlice inputs.

Notes

🤖 Generated with Claude Code

jamescrosswell and others added 2 commits September 14, 2026 13:16
.NET 11 compresses assemblies with Zstandard (XAZS) instead of LZ4 (XALZ).
The 12-byte header is unchanged, so only the magic and the codec differ.
Zstandard uses the BCL ZstandardDecoder on net11.0; the net10.0 build
throws NotSupportedException, since only .NET 11 apps produce XAZS.

Refs #5346

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.79%. Comparing base (4ee11d6) to head (082cf3e).

Additional details and impacted files
@@                    Coverage Diff                    @@
##           feat/assemblystore-v4    #5575      +/-   ##
=========================================================
+ Coverage                  74.74%   74.79%   +0.05%     
=========================================================
  Files                        515      515              
  Lines                      18896    18902       +6     
  Branches                    3686     3689       +3     
=========================================================
+ Hits                       14123    14138      +15     
+ Misses                      3893     3887       -6     
+ Partials                     880      877       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Assembly.Location is empty on Android, so the static initializer threw and
every test in the class failed on the device runs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jamescrosswell
jamescrosswell marked this pull request as ready for review September 15, 2026 03:48
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Sep 15, 2026
@jamescrosswell
jamescrosswell added this pull request to stack #5581 September 15, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

public API Additions/modifications to, or removals from, the public API surface area. risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants