Skip to content

[release/11.0.1xx] [Xamarin.Installer.Build.Tasks] Validate OpenJDK downloads - #13212

Merged
jonathanpeppers merged 1 commit into
release/11.0.1xxfrom
simonrozsival-backport-pr-13172-release-11-0-1xx
Oct 20, 2026
Merged

jonathanpeppers merged 1 commit into
release/11.0.1xxfrom
simonrozsival-backport-pr-13172-release-11-0-1xx

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Backport of #13172 to release/11.0.1xx.

Add signature verification to the InstallAndroidDependencies target before it extracts and installs a downloaded Microsoft OpenJDK archive. Report XA5305 and stop installation if verification fails.

Backport notes: InstallAndroidDependencies.cs conflicted because release/11.0.1xx has older cancellation handling than main. The conflict was resolved by keeping the release branch's cancellation style around the new VerifyJavaArchiveAsync call. The Execute catch was widened from TaskCanceledException to OperationCanceledException, because the verification code throws OperationCanceledException on cancellation.

Validation

Not built or tested locally: no .NET SDK is available in this environment. Relying on CI.


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

Add signature verification to the `InstallAndroidDependencies` target before it extracts and installs a downloaded Microsoft OpenJDK archive. Report `XA5305` and stop installation if verification fails.

(cherry picked from commit 11e7609)
Copilot AI balanced review requested due to automatic review settings October 20, 2026 09:12

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

Security-sensitive verification and the cancellation backport require human review, including production-path rejection coverage and release-branch validation.

1 open issue
1 file not reviewed
  • src/Xamarin.Installer.Build.Tasks/Properties/Resources.Designer.cs: Generated file
What changed in this PR

Backports OpenJDK signature verification to release/11.0.1xx, protecting dependency installation before archive extraction.

Changes:

  • Adds signature verification, trusted-key configuration, and XA5305 diagnostics.
  • Adapts cancellation handling and pools download buffers.
  • Adds verification tests and maintenance documentation.
File Description
src/​Xamarin.Installer.Build.Tasks/​Xamarin.Installer.Common.targets Forwards verification settings.
src/​Xamarin.Installer.Build.Tasks/​Tasks/​InstallAndroidDependencies.cs Verifies downloads before installation.
src/​Xamarin.Installer.Build.Tasks/​README.md Documents testing and key maintenance.
src/​Xamarin.Installer.Build.Tasks/​Properties/​Resources.resx Adds XA5305 error text.
src/​Xamarin.Installer.Build.Tasks/​Properties/​Resources.Designer.cs Exposes XA5305 resource.
src/​Xamarin.Installer.Build.Tasks/​Properties/​AssemblyInfo.cs Enables internal access for tests.
src/​Xamarin.Installer.Build.Tasks/​OpenJdkSignatureVerifier.cs Implements signature and trusted-key verification.
src/​Xamarin.Android.Build.Tasks/​Tests/​Xamarin.Android.Build.Tests/​Xamarin.Android.Build.Tests.csproj References installer tasks.
src/​Xamarin.Android.Build.Tasks/​Tests/​Xamarin.Android.Build.Tests/​Tasks/​OpenJdkSignatureTests.cs Adds verification and installation tests.
Documentation/​docs-mobile/​TOC.yml Links XA5305 documentation.
Documentation/​docs-mobile/​messages/​xa5305.md Explains verification failures and remedies.
Documentation/​docs-mobile/​messages/​index.md Lists XA5305.
Documentation/​docs-mobile/​building-apps/​build-targets.md Documents installation verification.

Review effort: Balanced

Comment on lines +346 to +347
if (!await VerifyJavaArchiveAsync (installationContext.HttpClient, jdkToInstall, cancellationToken))
return false;

@jonathanpeppers jonathanpeppers 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.

Test failures are unrelated.

@jonathanpeppers
jonathanpeppers merged commit 550cb5b into release/11.0.1xx Oct 20, 2026
42 of 45 checks passed
@jonathanpeppers
jonathanpeppers deleted the simonrozsival-backport-pr-13172-release-11-0-1xx branch October 20, 2026 13:11
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants