Skip to content

Add manifest feed parsing for SDK/JDK download resolution (move from android-platform-support) #12068

Open

Description

@rmarinho

Summary

Add manifest feed parsing to Xamarin.Android.Tools.AndroidSdk so that consumers can resolve SDK/JDK download URLs and checksums from the Xamarin Android Manifest Feed and Google's repository without hardcoding URLs.

Background

The android-platform-support (internal) repository has XamarinRepository and GoogleV2Repository classes that parse:

  • Xamarin Android Manifest Feed (https://aka.ms/AndroidManifestFeed/d{version}) — JDK archives, platform-tools, command-line tools, emulator with per-platform/architecture URLs and SHA-1 checksums
  • Google SDK Repository (https://dl.google.com/android/repository/repository2-3.xml) — SDK platforms, build-tools, system images, add-ons with SHA-1 checksums

It also includes LocalManifestProvider for offline/CI manifest caching.

This is a prerequisite for the JDK installation (#270) and SDK bootstrap (#271) features — both need manifest feed parsing to resolve download URLs and verify checksums.

Proposed API Surface

  • ManifestFeed.LoadAsync(feedUrl) — download and parse a manifest feed
  • ManifestFeed.ResolvePackage(packageId, os, arch) — get download URL + SHA-1 for a specific package
  • ManifestFeed.GetJdkVersions() — list available JDK versions with download info
  • ManifestFeed.Cache(localPath) — cache manifest for offline use

Key Requirements

  • No hardcoded download URLs — all URLs come from manifest feeds
  • SHA-1 checksum verification — every download must be verified against manifest checksums
  • Manifest caching — support offline/CI scenarios with cached manifests
  • Cross-platform — resolve correct URLs for Windows/macOS/Linux and x64/aarch64

Consumer

Related

Activity

  1. added
    enhancement
    on Feb 19, 2026
  2. rmarinho commented on Feb 23, 2026

    @rmarinho
    MemberAuthor

    Priority Note

    This issue is a critical prerequisite for:

    Current state in MAUI DevTools work

    I've implemented sdkmanager/avdmanager/adb/emulator wrappers (see #12069, #12071, #12070), but they all assume the tools already exist. Without manifest feed parsing, we cannot:

    1. Bootstrap an SDK from scratch (download cmdline-tools)
    2. Install JDK automatically (download OpenJDK)
    3. Verify downloads with SHA-1 checksums

    Reference implementation

    The android-platform-support repo has working manifest parsing:

    • XamarinRepository — parses Xamarin Android Manifest Feed
    • GoogleV2Repository — parses Google SDK repository XML
    • LocalManifestProvider — caching for offline/CI

    Suggested implementation order

    1. This issue ([Xamarin.Android.Build.Tasks] Warning when building Forms app: MSB324 7 Found conflicts between different versions of the same dependent assembly #273) — manifest feed parsing
    2. Add SDK bootstrap and sdkmanager wrapper (move from android-platform-support) android-tools#271 — complete SDK bootstrap using manifest
    3. Add JDK installation support (move from android-platform-support) android-tools#270 — JDK installation using manifest
    4. Add SDK license acceptance support (move from android-platform-support) #12067 — complete license management

    Would be happy to help implement this if there's alignment on the approach.

  3. rmarinho commented on Feb 23, 2026

    @rmarinho
    MemberAuthor

    Implementation Update

    I've implemented the manifest feed parsing as part of the MAUI DevTools consolidation work. Here's what's been added:

    New Classes in Xamarin.Android.Tools.AndroidSdk

    ManifestFeed/

    • AndroidManifestFeedParser - Downloads and parses Xamarin manifest feed XML
    • ManifestDownloader - Downloads archives with SHA-1 verification
    • SdkBootstrapper - Bootstrap SDK by downloading cmdline-tools from manifest
    • JdkInstaller - Install JDK from manifest with version selection

    Models:

    • ManifestArchive - Archive with URL, SHA-1, OS/arch targeting
    • ManifestPackage - SDK packages (cmdline-tools, platform-tools, etc.)
    • JdkManifestPackage - JDK packages with vendor info
    • AndroidManifest - Parsed manifest result

    API Surface

    // Parse manifest (with optional caching for offline use)
    var parser = new AndroidManifestFeedParser(httpClient, cacheDirectory);
    var manifest = await parser.LoadAsync();
    
    // Get cmdline-tools for current system
    var archive = manifest.CmdlineTools.First().GetBestArchiveForCurrentSystem();
    // archive.Url = download URL
    // archive.Checksum = SHA-1 for verification
    
    // Bootstrap SDK (download cmdline-tools)
    var bootstrapper = new SdkBootstrapper();
    await bootstrapper.BootstrapAsync(""/path/to/sdk"");
    
    // Install JDK
    var installer = new JdkInstaller();
    var jdks = await installer.DiscoverAsync();  // List available JDKs
    var result = await installer.InstallAsync(17, ""/path/to/jdk"");  // Install JDK 17

    Features Implemented

    ✅ Download and parse Xamarin manifest feed (https://aka.ms/AndroidManifestFeed/d{version})
    ✅ Manifest caching for offline/CI scenarios
    ✅ Per-platform/architecture archive resolution
    ✅ SHA-1 checksum verification before extraction
    ✅ JDK version discovery and installation
    ✅ SDK bootstrap (cmdline-tools download)

    Not Yet Implemented

    ❌ Google SDK repository parsing (repository2-3.xml) - lower priority since Xamarin manifest has what we need
    ❌ License text retrieval API

    This implementation is in a local branch. Would be happy to create a PR if the approach looks good.

  4. added
    android-tools
    on Jul 13, 2026
  5. added
    needs-triage
    on Jul 13, 2026
  6. removed
    needs-triage
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

android-toolsenhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions