Skip to content

[release/11.0.1xx] [Xamarin.Installer.AndroidSDK] Stop on archive checksum failures - #13234

Merged
jonathanpeppers merged 1 commit into
release/11.0.1xxfrom
jonathanpeppers-checksum-backport-to-11
Oct 22, 2026
Merged

jonathanpeppers merged 1 commit into
release/11.0.1xxfrom
jonathanpeppers-checksum-backport-to-11

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Backport of #13204, squash commit 000586a.

The installer detects invalid downloaded archives but does not set haveArchiveIssues. Installation can therefore continue without checksum verification during extraction. Reject the complete requested component set before extraction if any downloaded archive fails validation. Preserve both exception and log-and-return modes.

Add the private $(_AndroidIgnoreSdkArchiveChecksumErrors) override. It permits checksum failures only and reports continued installation with a High-importance message. Host checks remain in place, including the existing system-image exception. JDK validation is unchanged.

Release conflict resolution: AndroidSdkInstallerTests.cs does not exist on this branch. Add only the checksum regression tests from the original change, not unrelated discovery tests from main. Add the required installer project reference and use the existing SharpZipLibVersion. Production changes applied without conflicts.

Validation:

  • dotnet test tests\Xamarin.Android.Tools.AndroidSdk-Tests\Xamarin.Android.Tools.AndroidSdk-Tests.csproj -v minimal -p:AndroidToolsDisableMultiTargeting=false -p:DotNetTargetFrameworkVersion=10.0 — passed: 420, skipped: 19, failed: 0. The first attempt hit a file lock while the task build ran in parallel; the rerun above passed after that build finished.
  • dotnet test tests\Xamarin.Android.Tools.AndroidSdk-Tests\Xamarin.Android.Tools.AndroidSdk-Tests.csproj -c Release -v minimal -p:AndroidToolsDisableMultiTargeting=false -p:DotNetTargetFrameworkVersion=10.0 --filter FullyQualifiedName~AndroidSdkInstallerTests — passed: 26, skipped: 0, failed: 0.
  • dotnet build src\Xamarin.Installer.Build.Tasks\Xamarin.Installer.Build.Tasks.csproj -v minimal — passed, 0 warnings and 0 errors.
  • [xml]$targets = Get-Content src\Xamarin.Installer.Build.Tasks\Xamarin.Installer.Common.targets — passed XML parsing.
  • git diff --cached --check — passed before commit.
  • git rev-list --count origin/release/11.0.1xx..HEAD — 1.

Pull Request
title and
description
should follow the
commit-messages.md workflow documentation, and in particular should include:

  • Useful description of why the change is necessary.
  • Links to issues fixed
  • Unit tests

…cksum failures

Backport #13204 from 000586a.

Reject all requested SDK components before extraction when a downloaded
archive fails validation.  Keep both error modes and the system-image
host exception.  Add the private checksum override and a visible notice;
the override does not bypass host checks.

Add the checksum regression tests as a new file on this release branch
and reference the installer project.  Exclude unrelated discovery tests
from main.

Context: #13204

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 4a41c251-5cd4-4964-8190-39c7a6bc692f
Copilot AI balanced review requested due to automatic review settings October 21, 2026 21:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The security-sensitive checksum override warrants human sign-off, especially because its interaction with the system-image host exemption lacks regression coverage.

1 open issue
What changed in this PR

Backports #13204 to the release branch so Android SDK installation rejects the entire requested component set before extraction when archive validation fails.

Changes:

  • Preserves exception and log-and-return modes, plus the existing system-image host exemption.
  • Adds a private checksum override with a high-importance notice; JDK validation remains unchanged.
  • Adds focused checksum regression tests and the dependencies needed for real archive extraction.
File Description
tests/​Xamarin.Android.Tools.AndroidSdk-Tests/​Xamarin.Android.Tools.AndroidSdk-Tests.csproj Adds installer and SharpZipLib references.
tests/​Xamarin.Android.Tools.AndroidSdk-Tests/​AndroidSdkInstallerTests.cs Tests checksum rejection, overrides, extraction, and host validation.
src/​Xamarin.Installer.Build.Tasks/​Xamarin.Installer.Common.targets Passes the private override to the installer task.
src/​Xamarin.Installer.Build.Tasks/​Tasks/​InstallAndroidDependencies.cs Forwards the override and exposes high-importance notices.
src/​Xamarin.Installer.AndroidSDK/​Xamarin.Installer.AndroidSDK/​AndroidSDKInstaller.cs Stops installation on invalid archives and limits the override to checksum failures.

Review effort: Balanced

@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Oct 22, 2026
@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The five-file release backport rejects the requested SDK component set before extraction when archive validation fails, in both exception and log-and-return modes. The checksum-only override remains private and disabled by default, preserves the host/JDK validation boundaries, and forwards the intended high-importance notice. The release-specific fixture, project references and source-to-pack/import wiring are consistent.

The resolved optional system-image regression suggestion remains an accepted align-with-main scope decision, not a renewed blocker.

Static source review of 87961a003007db40793b07c6ae8e5d6233f46019 against release/11.0.1xx at 45a9343ac20aa7e3239a1dc45806b771193163a9, using the explicit current-target source projection. The observed merge object has an older target parent; this approval does not certify latest-target installed, native or shipping execution.

@jonathanpeppers
jonathanpeppers merged commit 9c1c157 into release/11.0.1xx Oct 22, 2026
45 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-checksum-backport-to-11 branch October 22, 2026 17:45
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants