Skip to content

fix(fdroid): stream index-v1.jar with mirror failover, IzzyOnDroid, disk cache, and reactive UI merge - #9

Merged
GothwadTech merged 1 commit into
mainfrom
arena/89921424-storeapp
Oct 18, 2026
Merged

GothwadTech merged 1 commit into
mainfrom
arena/89921424-storeapp

Conversation

@GothwadTech

Copy link
Copy Markdown
Owner

Summary

Fixes the F-Droid catalogue integration so that thousands of open-source apps and games load reliably across Home, Apps, Games, Categories, Top Charts, and Search, modeled directly after Droid-ify (IndexDownloader.kt, RepositoryUpdater.kt, V1Syncable.kt, IndexV1Parser.kt, IndexConverter.kt) and the official F-Droid client (IndexV1Updater.kt, AppV1.kt, KnownRepos.kt).

Root Causes Fixed

  1. Use index-v1.jar (~8.8 MB compressed ZIP/JAR) instead of raw index-v1.json (~40+ MB) with a 120s timeout
    • Both Droid-ify and official F-Droid fetch <repo>/index-v1.jar and extract index-v1.json from the JAR archive. Previously, FdroidCatalog fetched raw uncompressed index-v1.json (~40+ MB) with a hard .callTimeout(120, TimeUnit.SECONDS), which killed the download mid-stream on any connection averaging under ~350 KB/s.
  2. Prevent UI coroutine cancellation from aborting in-flight F-Droid syncs
    • FdroidCatalog.catalog() previously executed the network download directly inside the caller's coroutine while holding a Mutex. When a tab switch or re-refresh cancelled the first caller's coroutine, the download was aborted for all waiting screens. Downloads now run in FdroidCatalog's own SupervisorJob() + Dispatchers.IO scope.
  3. Add official F-Droid HTTPS mirror failover + IzzyOnDroid companion repository + disk caching
    • Races official F-Droid HTTPS mirrors (f-droid.org, de.freedif.org, mirror.cyberbits.eu, ftp.fau.de, mirrors.dotsrc.org, ftp.agdsn.de, mirror.fcix.net, mirror.freedif.org, ftp.gwdg.de, ftp.lysator.liu.se) using a staggered Happy-Eyeballs strategy so a slow primary server never blocks loading.
    • Syncs the standard IzzyOnDroid F-Droid repository (https://apt.izzysoft.de/fdroid/repo/index-v1.jar, ~1.6 MB) in parallel and emits progressively via catalogFlow as soon as the fastest repo or disk cache is ready, then upgrades seamlessly when both repos finish (~4,700+ unique apps).
    • Persists verified .jar indexes in cacheDir/fdroid/ for instant (<500ms) startup on subsequent launches.
  4. Fix HomeScreen shelf filtering, reactive StoreViewModel state merging, and category aliases
    • Fixed firstPartyPackages in HomeScreen.kt so merged source == "F-Droid" apps do not filter themselves out of the "Open-source picks" shelf.
    • Added observeFdroidUpdates() in StoreViewModel so home, apps, games, charts, categoryApps, and searchResults automatically re-merge whenever fdroidUpdates emits.
    • Added device ABI (nativecode vs Build.SUPPORTED_ABIS) + suggestedVersionCode selection, lastUpdated descending sorting, HTML tag/entity cleanup, ISO-8601 timestamps, multi-locale icon/screenshot resolution, and full category alias matching.
    • Added F-Droid mirror failover in ApkDownloadService when downloading F-Droid APKs.

Test Plan

  • Added unit tests in FdroidIndexTest.kt for .jar ZIP archive streaming (parseSource and parseFile), index-v2.json parsing, nativecode ABI filtering, lastUpdated sorting, HTML description cleanup, screenshot URL resolution, and category alias matching.

…isk cache, and reactive UI merge

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@GothwadTech
GothwadTech merged commit a8cd50a into main Oct 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant