Skip to content

[installer] Remove Kajabity Java properties dependency - #13120

Merged
jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-kajabity-dependency-investigation
Oct 13, 2026
Merged

jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-kajabity-dependency-investigation

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Fixes #13117. Follow-up to #13113.

Changes

Replace the vendored Kajabity reader with a compact, in-tree Java-properties helper and migrate the SDK/JDK installer consumers to dictionaries. Preserve Latin-1 decoding, escaped keys/values, continuations, duplicate-key handling, and legacy quirks such as permissive Unicode digits and trailing-backslash behavior.

Remove all four Kajabity types, their third-party notice, the stale Guardian/analysis suppressions, and the now-unused System.Text.Encoding.CodePages package/version property. Add parsing and SDK/JDK discovery regression tests.

AndroidUtilities.ReadAndroidProperties() now returns Dictionary<string, string> instead of the removed third-party type. Malformed escapes retain the logged, resource-backed InvalidOperationException wrapper, with FormatException replacing the deleted custom inner exception.

Validation

  • Compared against the original compiled parser using 111,800 differential cases, including randomized bytes and buffer-boundary inputs: all parsed values and failure messages matched.
  • Full Android SDK tools suite: 457 passed, 16 skipped. An initial transient access-denied error moving an extracted JDK directory passed both an isolated retry and the complete suite rerun.
dotnet test tests\Xamarin.Android.Tools.AndroidSdk-Tests\Xamarin.Android.Tools.AndroidSdk-Tests.csproj --no-build --no-restore -v minimal -p:AndroidToolsDisableMultiTargeting=false -p:DotNetTargetFrameworkVersion=10.0
  • Downstream installer tasks build: passed, 0 warnings and 0 errors; also builds the installer and shared dependencies for netstandard2.0.
dotnet build src\Xamarin.Installer.Build.Tasks\Xamarin.Installer.Build.Tasks.csproj -v minimal -p:AndroidToolsDisableMultiTargeting=false -p:DotNetTargetFrameworkVersion=10.0
  • Confirmed no Kajabity types in the compiled installer, no encoding package in the restore graph, 15 matching third-party notice entries/sections, valid Guardian suppression JSON, and a clean git diff --check.
  • Independent Claude Sonnet 5.5 and Gemini 3.8 Flash reviews found no blocking correctness issues; the stale Guardian suppression they identified is removed.

Replace the vendored parser with a compact dictionary-based helper while
preserving legacy parsing behavior. Update SDK/JDK consumers and regression
tests, remove the unused encoding package, and clean up third-party notices
and stale Guardian suppressions.

Fixes #13117

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 03f2cd7b-cd70-4bcd-84c2-f73aebe4840b
Copilot AI balanced review requested due to automatic review settings October 13, 2026 14:04

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.

🟢 Approval recommended

The replacement, consumer migration, dependency cleanup, and regression coverage are coherent; only an optional boundary-test suggestion remains.

1 open finding
What changed in this PR

Replaces the vendored Kajabity Java-properties parser with an in-tree implementation while preserving installer compatibility and resolving #13117.

Changes:

  • Adds Latin-1 Java-properties parsing and regression coverage.
  • Migrates SDK/JDK consumers to generic dictionaries.
  • Removes Kajabity sources, package metadata, notices, and suppressions.
File Description
THIRD-PARTY-NOTICES.TXT Removes the Kajabity notice.
tests/​.../​AndroidSdkInstallerTests.cs Tests SDK/JDK property discovery.
tests/​.../​AndroidPropertiesTests.cs Covers parser compatibility and errors.
src/​.../​LocalSDK/​LocalSDKRepository.cs Uses dictionary-backed properties.
src/​.../​Kajabity.Tools.Java/​ParseException.cs Removes the custom exception.
src/​.../​Kajabity.Tools.Java/​JavaPropertyWriter.cs Removes the unused writer.
src/​.../​Kajabity.Tools.Java/​JavaPropertyReader.cs Removes the vendored parser.
src/​.../​Kajabity.Tools.Java/​JavaProperties.cs Removes the vendored collection.
src/​.../​JavaDependencyInstaller.cs Migrates JDK release parsing.
src/​.../​Extensions.Properties.cs Adapts property conversion to dictionaries.
src/​.../​Common/​BasePackage.cs Migrates package revision detection.
src/​.../​AndroidUtilities.cs Implements the replacement parser.
src/​.../​AndroidSDKInstaller.cs Migrates SDK version discovery.
src/​.../​AndroidExtensions.cs Updates revision extensions for dictionaries.
src/​.../​Xamarin.Installer.AndroidSDK.csproj Removes the encoding package reference.
src/​.../​GlobalSuppressions.cs Removes a stale Kajabity suppression.
Directory.Build.props Removes the unused package version.
.gdn/​policheck/​source.gdnsuppress Removes the obsolete Guardian suppression.

🧠 Review effort: Balanced

Add file-backed regression cases splitting Unicode escapes and CRLF
continuations across the StreamReader buffer boundary.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 03f2cd7b-cd70-4bcd-84c2-f73aebe4840b
@jonathanpeppers
jonathanpeppers merged commit eb621a7 into main Oct 13, 2026
41 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-kajabity-dependency-investigation branch October 13, 2026 20:06
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 13, 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.

Investigate whether Kajabity/Kajabity.Tools.Java can be removed

3 participants