Repository navigation
[release/11.0.1xx] [Xamarin.Installer.AndroidSDK] Stop on archive checksum failures - #13234
Conversation
…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
There was a problem hiding this comment.
🔵 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
|
@dalexsoto review |
dalexsoto
left a comment
There was a problem hiding this comment.
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.

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.csdoes 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 existingSharpZipLibVersion. 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.mdworkflow documentation, and in particular should include: