How f-droid/fdroidclient works
Purpose and entry points
F-Droid Client is an Android client for the F-Droid free-software repository system: it discovers repository catalogues, downloads APKs, and delegates installation to Android. The application starts through the manifest/application/activity stack at app/src/main/AndroidManifest.xml, app/src/main/kotlin/org/fdroid/App.kt, and app/src/main/kotlin/org/fdroid/MainActivity.kt.
App shell and presentation
The primary UI is Kotlin/Jetpack Compose, organized around navigation, screen-level ViewModels/presenters, and feature screens for discovery, details, repositories, search, and installed apps. MainActivity hosts the shell; intent routing and navigation state form an inbound boundary for Android intents and deep links.
Paths: app/src/main/kotlin/org/fdroid/ui/Main.kt, app/src/main/kotlin/org/fdroid/ui/navigation/IntentRouter.kt, app/src/main/kotlin/org/fdroid/ui/navigation/Navigator.kt.
Repository ingestion pipeline
Repository management is the core catalogue pipeline: configured/default repositories are added or preloaded, remote index data is fetched, parsed and signature-verified, then applied into local data. App-level scheduling/state is separated from reusable repository/index mechanics.
Paths: app/src/main/kotlin/org/fdroid/repo/RepoUpdateWorker.kt, libs/database/src/main/java/org/fdroid/repo/RepoFetcher.kt, libs/index/src/androidMain/kotlin/org/fdroid/index/JarIndexVerifier.kt.
Persistent catalogue and search boundary
A local Android database is the authoritative offline store for repositories, apps, versions, preferences, and search records. DAOs and schema migrations isolate UI/domain consumers from index-format and network details. Search operates over this stored catalogue, with local search history managed separately.
Paths: libs/database/src/main/java/org/fdroid/database/FDroidDatabase.kt, libs/database/src/main/java/org/fdroid/database/AppDao.kt, app/src/main/kotlin/org/fdroid/search/SearchManager.kt.
Network and artifact delivery
Reusable multiplatform download code provides request, HTTP, proxy, DNS, mirror selection, and digest-verification capabilities; Android app bindings configure it for repo indexes, APKs, icons, and local files. This is the boundary to repository servers, mirrors, IPFS gateways in the full variant, and device network state.
Paths: libs/download/src/commonMain/kotlin/org/fdroid/download/MirrorChooser.kt, libs/download/src/androidMain/kotlin/org/fdroid/download/HttpDownloader.kt, app/src/main/kotlin/org/fdroid/download/DownloadModule.kt.
Install and update lifecycle
Downloaded APKs pass through file sharing and Android package-install/session APIs. Install state, broadcasts, notifications, cache cleanup, installed-app detection, and update checks form a long-running lifecycle; background workers identify and notify app updates. F-Droid itself remains subject to Android’s unknown-sources/install authorization model.
Paths: app/src/main/kotlin/org/fdroid/install/AppInstallManager.kt, app/src/main/kotlin/org/fdroid/install/SessionInstallManager.kt, app/src/main/kotlin/org/fdroid/updates/AppUpdateWorker.kt.
Build variants and optional peer distribution
Gradle builds an Android app plus reusable core, download, index, and database libraries. basic and full source sets define materially different products: full adds nearby repository/app exchange (Bluetooth, Wi‑Fi/Bonjour, local HTTP), QR support, IPFS settings, and panic features; nightly overlays customize builds. Dependency injection modules indicate Hilt-based runtime composition.
Paths: app/build.gradle.kts, app/src/full/java/org/fdroid/fdroid/nearby/LocalRepoService.java, app/src/full/kotlin/org/fdroid/ui/ipfs/IpfsManager.kt.
Operational integrations
The app interacts primarily with arbitrary F-Droid repository endpoints and Android platform services; no backend owned by this repository is present. CI is GitLab-based, translations integrate with Weblate, and release/catalog defaults are bundled assets.
Paths: .gitlab-ci.yml, app/src/main/assets/default_repos.json, app/src/main/kotlin/org/fdroid/db/DatabaseModule.kt.
Main entry points: Main.kt Compose UI shell · MainActivity.kt Main activity · RepoFetcher.kt Repository fetcher · AppInstallManager.kt App install manager
Components 22
Android app
- Manifest entry
app/src/main/AndroidManifest.xml - App application
app/src/main/kotlin/org/fdroid/App.kt - Main activity
app/src/main/kotlin/org/fdroid/MainActivity.kt - Compose UI shell · Hosts feature screens and navigation state.
app/src/main/kotlin/org/fdroid/ui/Main.kt - Intent router · Routes Android intents and deep links.
app/src/main/kotlin/org/fdroid/ui/navigation/IntentRouter.kt - Navigator
app/src/main/kotlin/org/fdroid/ui/navigation/Navigator.kt
Catalogue pipeline
- Repository update worker · Coordinates configured repository refreshes.
app/src/main/kotlin/org/fdroid/repo/RepoUpdateWorker.kt - Repository fetcher
libs/database/src/main/java/org/fdroid/repo/RepoFetcher.kt - Index verifier · Parses and verifies signed repository indexes.
libs/index/src/androidMain/kotlin/org/fdroid/index/JarIndexVerifier.kt - Offline catalogue database · Authoritative store for repositories, apps, versions, and preferences.
libs/database/src/main/java/org/fdroid/database/FDroidDatabase.kt - App DAO
libs/database/src/main/java/org/fdroid/database/AppDao.kt - Search manager · Searches the stored catalogue and manages history.
app/src/main/kotlin/org/fdroid/search/SearchManager.kt
Delivery and lifecycle
- Android download bindings · Configures reusable delivery for indexes, APKs, icons, and files.
app/src/main/kotlin/org/fdroid/download/DownloadModule.kt - HTTP downloader
libs/download/src/androidMain/kotlin/org/fdroid/download/HttpDownloader.kt - Mirror chooser · Selects mirrors and supports digest-verified retrieval.
libs/download/src/commonMain/kotlin/org/fdroid/download/MirrorChooser.kt - App install manager
app/src/main/kotlin/org/fdroid/install/AppInstallManager.kt - Session installer · Delegates APK installation through Android sessions.
app/src/main/kotlin/org/fdroid/install/SessionInstallManager.kt - App update worker · Detects updates and drives notifications.
app/src/main/kotlin/org/fdroid/updates/AppUpdateWorker.kt
Full variant
- Nearby and IPFS features · Adds peer exchange, QR, IPFS settings, and panic capabilities.
app/src/full/java/org/fdroid/fdroid/nearby/LocalRepoService.java - Gradle variants · Builds basic/full Android products and reusable libraries.
app/build.gradle.kts
Other components
- Repository endpoints · Arbitrary F-Droid repositories, mirrors, and optional gateways.
- Android platform · Provides package installation, broadcasts, and device state.
Connections 24
- Manifest entry → App application: launches
- App application → Main activity: initializes
- Main activity → Compose UI shell: hosts
- Main activity → Intent router: receives intents
- Intent router → Navigator: routes
- Navigator → Compose UI shell: drives screens
- Compose UI shell → Search manager: queries
- Search manager → App DAO: searches
- App DAO → Offline catalogue database: reads and writes
- Repository update worker → Repository fetcher: refreshes through
- Repository fetcher → Android download bindings: uses
- Android download bindings → HTTP downloader: binds
- HTTP downloader → Mirror chooser: uses routing
- Mirror chooser → Repository endpoints: downloads from
- Repository fetcher → Index verifier: submits indexes
- Index verifier → Offline catalogue database: applies verified data
- Compose UI shell → App install manager: requests install
- App install manager → HTTP downloader: downloads APKs
- App install manager → Session installer: hands off APK
- Session installer → Android platform: uses package APIs
- App update worker → Offline catalogue database: checks catalogue
- App update worker → Android platform: notifies through
- Gradle variants → Nearby and IPFS features: enables in full
- Nearby and IPFS features → Repository endpoints: peer and gateway access