Prepare the Android app for F-Droid#1
Draft
Vakarux12 wants to merge 3 commits into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
fossfullOrangMessagingServiceand the FCM manifest entries moved tosrc/full/, andsrc/foss/gets aPushRegistrarwith the same API that does nothing. No shared code had to change,SessionViewModelstill injectsPushRegistrarwithout knowing which one it got. Verified thatapp-foss-release-unsigned.apkcontains 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>andbuild/<pkg>/src/<flavor>/fastlane/..., so anandroid/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 thesigningConfigsblock out ofbuild.gradle.ktsbefore 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 lintandfdroid rewritemetaare clean,fdroid buildchecks out the tag, passes the source scanner and produces the APK, andfdroid updategenerates an index carrying the correct name, summary, description, icon, feature graphic, both screenshots, changelog and category.Follow-ups
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.API_BASE_URL), so self-hosters cannot use the published APK without rebuilding. Worth a runtime setting later.