# f-droid/fdroidclient architecture

> Architecture diagram of the GitHub repository f-droid/fdroidclient, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/f-droid/fdroidclient
- Repository: https://github.com/f-droid/fdroidclient

## Overview

#### 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: [`app/src/main/kotlin/org/fdroid/ui/Main.kt`](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/ui/Main.kt) (Compose UI shell), [`app/src/main/kotlin/org/fdroid/MainActivity.kt`](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/MainActivity.kt) (Main activity), [`libs/database/src/main/java/org/fdroid/repo/RepoFetcher.kt`](https://github.com/f-droid/fdroidclient/blob/master/libs/database/src/main/java/org/fdroid/repo/RepoFetcher.kt) (Repository fetcher), [`app/src/main/kotlin/org/fdroid/install/AppInstallManager.kt`](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/install/AppInstallManager.kt) (App install manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Android app"]
  node_manifest["Manifest entry<br/>Android entry"]
  node_application["App application<br/>Android application<br/>[App.kt]"]
  node_activity["Main activity<br/>Activity host<br/>[MainActivity.kt]"]
  node_ui_shell["Compose UI shell<br/>presentation<br/>[Main.kt]"]
  node_intent_router["Intent router<br/>navigation boundary<br/>[IntentRouter.kt]"]
  node_navigator["Navigator<br/>navigation state<br/>[Navigator.kt]"]
end

subgraph group_catalogue["Catalogue pipeline"]
  node_repo_worker["Repository update worker<br/>scheduled orchestration"]
  node_repo_fetcher["Repository fetcher<br/>repository client<br/>[RepoFetcher.kt]"]
  node_index_verifier["Index verifier<br/>signature verification"]
  node_database[("Offline catalogue database<br/>Room database<br/>[FDroidDatabase.kt]")]
  node_app_dao["App DAO<br/>catalogue access<br/>[AppDao.kt]"]
  node_search["Search manager<br/>local search<br/>[SearchManager.kt]"]
end

subgraph group_delivery["Delivery and lifecycle"]
  node_download_module["Android download bindings<br/>DI module<br/>[DownloadModule.kt]"]
  node_http_downloader["HTTP downloader<br/>network delivery<br/>[HttpDownloader.kt]"]
  node_mirror_chooser["Mirror chooser<br/>download routing<br/>[MirrorChooser.kt]"]
  node_install_manager["App install manager<br/>install lifecycle"]
  node_session_installer["Session installer<br/>Android package install"]
  node_update_worker["App update worker<br/>background updates<br/>[AppUpdateWorker.kt]"]
end

subgraph group_optional["Full variant"]
  node_full_features["Nearby and IPFS features<br/>full-only features"]
  node_build_variants["Gradle variants<br/>build composition<br/>[build.gradle.kts]"]
end

node_repo_endpoints(("Repository endpoints<br/>external services"))
node_android_platform(("Android platform<br/>platform APIs"))

node_manifest -->|"launches"| node_application
node_application -->|"initializes"| node_activity
node_activity -->|"hosts"| node_ui_shell
node_activity -->|"receives intents"| node_intent_router
node_intent_router -->|"routes"| node_navigator
node_navigator -->|"drives screens"| node_ui_shell
node_ui_shell -->|"queries"| node_search
node_search -->|"searches"| node_app_dao
node_app_dao -->|"reads and writes"| node_database
node_repo_worker -->|"refreshes through"| node_repo_fetcher
node_repo_fetcher -->|"uses"| node_download_module
node_download_module -->|"binds"| node_http_downloader
node_http_downloader -->|"uses routing"| node_mirror_chooser
node_mirror_chooser -->|"downloads from"| node_repo_endpoints
node_repo_fetcher -->|"submits indexes"| node_index_verifier
node_index_verifier -->|"applies verified data"| node_database
node_ui_shell -->|"requests install"| node_install_manager
node_install_manager -->|"downloads APKs"| node_http_downloader
node_install_manager -->|"hands off APK"| node_session_installer
node_session_installer -->|"uses package APIs"| node_android_platform
node_update_worker -->|"checks catalogue"| node_database
node_update_worker -->|"notifies through"| node_android_platform
node_build_variants -.->|"enables in full"| node_full_features
node_full_features -.->|"peer and gateway access"| node_repo_endpoints

click node_manifest "https://github.com/f-droid/fdroidclient/blob/master/app/src/main/AndroidManifest.xml"
click node_application "https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/App.kt"
click node_activity "https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/MainActivity.kt"
click node_ui_shell "https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/ui/Main.kt"
click node_intent_router "https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/ui/navigation/IntentRouter.kt"
click node_navigator "https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/ui/navigation/Navigator.kt"
click node_repo_worker "https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/repo/RepoUpdateWorker.kt"
click node_repo_fetcher "https://github.com/f-droid/fdroidclient/blob/master/libs/database/src/main/java/org/fdroid/repo/RepoFetcher.kt"
click node_index_verifier "https://github.com/f-droid/fdroidclient/blob/master/libs/index/src/androidMain/kotlin/org/fdroid/index/JarIndexVerifier.kt"
click node_database "https://github.com/f-droid/fdroidclient/blob/master/libs/database/src/main/java/org/fdroid/database/FDroidDatabase.kt"
click node_app_dao "https://github.com/f-droid/fdroidclient/blob/master/libs/database/src/main/java/org/fdroid/database/AppDao.kt"
click node_search "https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/search/SearchManager.kt"
click node_download_module "https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/download/DownloadModule.kt"
click node_http_downloader "https://github.com/f-droid/fdroidclient/blob/master/libs/download/src/androidMain/kotlin/org/fdroid/download/HttpDownloader.kt"
click node_mirror_chooser "https://github.com/f-droid/fdroidclient/blob/master/libs/download/src/commonMain/kotlin/org/fdroid/download/MirrorChooser.kt"
click node_install_manager "https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/install/AppInstallManager.kt"
click node_session_installer "https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/install/SessionInstallManager.kt"
click node_update_worker "https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/updates/AppUpdateWorker.kt"
click node_full_features "https://github.com/f-droid/fdroidclient/blob/master/app/src/full/java/org/fdroid/fdroid/nearby/LocalRepoService.java"
click node_build_variants "https://github.com/f-droid/fdroidclient/blob/master/app/build.gradle.kts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manifest,node_application,node_activity,node_ui_shell,node_intent_router,node_navigator toneBlue
class node_repo_worker,node_repo_fetcher,node_index_verifier,node_database,node_app_dao,node_search toneAmber
class node_download_module,node_http_downloader,node_mirror_chooser,node_install_manager,node_session_installer,node_update_worker toneMint
class node_full_features,node_build_variants toneRose
class node_repo_endpoints,node_android_platform toneNeutral
```

## Components

### Android app

- [Manifest entry](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/AndroidManifest.xml): Android entry · `app/src/main/AndroidManifest.xml`
- [App application](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/App.kt): Android application · `app/src/main/kotlin/org/fdroid/App.kt`
- [Main activity](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/MainActivity.kt): Activity host · `app/src/main/kotlin/org/fdroid/MainActivity.kt`
- [Compose UI shell](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/ui/Main.kt): presentation · Hosts feature screens and navigation state. · `app/src/main/kotlin/org/fdroid/ui/Main.kt`
- [Intent router](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/ui/navigation/IntentRouter.kt): navigation boundary · Routes Android intents and deep links. · `app/src/main/kotlin/org/fdroid/ui/navigation/IntentRouter.kt`
- [Navigator](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/ui/navigation/Navigator.kt): navigation state · `app/src/main/kotlin/org/fdroid/ui/navigation/Navigator.kt`

### Catalogue pipeline

- [Repository update worker](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/repo/RepoUpdateWorker.kt): scheduled orchestration · Coordinates configured repository refreshes. · `app/src/main/kotlin/org/fdroid/repo/RepoUpdateWorker.kt`
- [Repository fetcher](https://github.com/f-droid/fdroidclient/blob/master/libs/database/src/main/java/org/fdroid/repo/RepoFetcher.kt): repository client · `libs/database/src/main/java/org/fdroid/repo/RepoFetcher.kt`
- [Index verifier](https://github.com/f-droid/fdroidclient/blob/master/libs/index/src/androidMain/kotlin/org/fdroid/index/JarIndexVerifier.kt): signature verification · Parses and verifies signed repository indexes. · `libs/index/src/androidMain/kotlin/org/fdroid/index/JarIndexVerifier.kt`
- [Offline catalogue database](https://github.com/f-droid/fdroidclient/blob/master/libs/database/src/main/java/org/fdroid/database/FDroidDatabase.kt): Room database · Authoritative store for repositories, apps, versions, and preferences. · `libs/database/src/main/java/org/fdroid/database/FDroidDatabase.kt`
- [App DAO](https://github.com/f-droid/fdroidclient/blob/master/libs/database/src/main/java/org/fdroid/database/AppDao.kt): catalogue access · `libs/database/src/main/java/org/fdroid/database/AppDao.kt`
- [Search manager](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/search/SearchManager.kt): local search · Searches the stored catalogue and manages history. · `app/src/main/kotlin/org/fdroid/search/SearchManager.kt`

### Delivery and lifecycle

- [Android download bindings](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/download/DownloadModule.kt): DI module · Configures reusable delivery for indexes, APKs, icons, and files. · `app/src/main/kotlin/org/fdroid/download/DownloadModule.kt`
- [HTTP downloader](https://github.com/f-droid/fdroidclient/blob/master/libs/download/src/androidMain/kotlin/org/fdroid/download/HttpDownloader.kt): network delivery · `libs/download/src/androidMain/kotlin/org/fdroid/download/HttpDownloader.kt`
- [Mirror chooser](https://github.com/f-droid/fdroidclient/blob/master/libs/download/src/commonMain/kotlin/org/fdroid/download/MirrorChooser.kt): download routing · Selects mirrors and supports digest-verified retrieval. · `libs/download/src/commonMain/kotlin/org/fdroid/download/MirrorChooser.kt`
- [App install manager](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/install/AppInstallManager.kt): install lifecycle · `app/src/main/kotlin/org/fdroid/install/AppInstallManager.kt`
- [Session installer](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/install/SessionInstallManager.kt): Android package install · Delegates APK installation through Android sessions. · `app/src/main/kotlin/org/fdroid/install/SessionInstallManager.kt`
- [App update worker](https://github.com/f-droid/fdroidclient/blob/master/app/src/main/kotlin/org/fdroid/updates/AppUpdateWorker.kt): background updates · Detects updates and drives notifications. · `app/src/main/kotlin/org/fdroid/updates/AppUpdateWorker.kt`

### Full variant

- [Nearby and IPFS features](https://github.com/f-droid/fdroidclient/blob/master/app/src/full/java/org/fdroid/fdroid/nearby/LocalRepoService.java): full-only features · Adds peer exchange, QR, IPFS settings, and panic capabilities. · `app/src/full/java/org/fdroid/fdroid/nearby/LocalRepoService.java`
- [Gradle variants](https://github.com/f-droid/fdroidclient/blob/master/app/build.gradle.kts): build composition · Builds basic/full Android products and reusable libraries. · `app/build.gradle.kts`

### Other components

- **Repository endpoints**: external services · Arbitrary F-Droid repositories, mirrors, and optional gateways.
- **Android platform**: platform APIs · Provides package installation, broadcasts, and device state.

## Connections

- 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
