Skip to content

Prepare the Android app for F-Droid - #1

Draft
Vakarux12 wants to merge 3 commits into
mainfrom
worktree-fdroid-release
Draft

Prepare the Android app for F-Droid#1
Vakarux12 wants to merge 3 commits into
mainfrom
worktree-fdroid-release

Conversation

@Vakarux12

@Vakarux12 Vakarux12 commented Jul 22, 2026

Copy link
Copy Markdown
Member

F-Droid refuses to build anything that pulls in a proprietary library, and the app depended on Firebase Cloud Messaging. This splits the build so there is a variant it can ship.

Flavors

Flavor Push Ships to
foss none, the notification list is polled F-Droid
full Firebase Cloud Messaging GitHub releases, Play

OrangMessagingService and the FCM manifest entries moved to src/full/, and src/foss/ gets a PushRegistrar with the same API that does nothing. No shared code had to change, SessionViewModel still injects PushRegistrar without knowing which one it got. Verified that app-foss-release-unsigned.apk contains zero Firebase or Play Services classes in its dex and declares no FCM service, while the full flavor still has both.

Store listing

fastlane/metadata/android/en-US/ at the repo root, which F-Droid reads directly from this repo on every build: title, summary, description, changelogs/1.txt, a 512px icon, a 1024x500 feature graphic and two phone screenshots. Editing the listing is a normal commit from now on.

It has to sit at the repo root rather than next to the app: fdroidserver 2.4.5 only globs build/<pkg>/fastlane/metadata/android/<locale> and build/<pkg>/src/<flavor>/fastlane/..., so an android/app/fastlane/ copy would be silently ignored.

Signing

Release builds are now unsigned when there is no keystore.properties, instead of falling back to the debug key. F-Droid strips the signingConfigs block out of build.gradle.kts before building, which left the old fallback pointing at a block that no longer existed, and it wants an unsigned APK to sign with its own key anyway.

Also

-dontwarn com.google.errorprone.annotations.**, because Tink (transitively from androidx.security-crypto) references annotations that are compile-only. R8 failed on this, so no minified release build was succeeding before this change, on either flavor.

Verification

Ran the real F-Droid toolchain locally against tag v1.0.0 (fdroidserver 2.4.5): fdroid readmeta, fdroid lint and fdroid rewritemeta are clean, fdroid build checks out the tag, passes the source scanner and produces the APK, and fdroid update generates an index carrying the correct name, summary, description, icon, feature graphic, both screenshots, changelog and category.

Follow-ups

  • The fdroiddata recipe builds tag v1.0.0, which points at the head of this branch. Please merge with a merge commit, or re-tag after merging, so the tag keeps pointing at a real commit.
  • The server address is still compile-time only (API_BASE_URL), so self-hosters cannot use the published APK without rebuilding. Worth a runtime setting later.

F-Droid will not build an app that pulls in proprietary libraries, so
Firebase Cloud Messaging now lives in a `full` flavor only. The `foss`
flavor keeps the same PushRegistrar API as a no-op and relies on the
existing notification poll, and it is the one F-Droid builds.

Also adds the fastlane store listing at the repo root (title, summary,
description, changelog, icon, feature graphic) which F-Droid reads
directly from this repo, and a -dontwarn for the errorprone annotations
Tink references, which was breaking every minified release build.
F-Droid strips the signingConfigs block out of build.gradle.kts before it
builds, so the fallback to signingConfigs.getByName("debug") was both a
dangling reference and the wrong outcome: it wants an unsigned APK to sign
with its own key. Now assembleFossRelease produces
app-foss-release-unsigned.apk, which is the first name it looks for.
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