Files
musicshare/docs/FDROID.md
T
chrisandClaude Opus 5.5 3b39910f13 Build the Android app on our own Gitea runner
Pushing a v* tag builds the normal and FOSS APKs, signed with the upload
key, and attaches them to a Gitea release; a manual run on a branch
uploads a test build to the repo's packages. Everything runs on the
Gitea server: a builder image with the Android SDK, an act_runner
registered only for this repo, and plain shell steps (no third-party
actions). The build itself is apps/mobile/scripts/build-android.sh, the
same script for hand builds. Setup steps are in docs/ANDROID-CI.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 21:28:52 -04:00

3.1 KiB

Releasing on F-Droid

The Android app can be built with no closed-source code: MUSICSHARE_FOSS=1 leaves out Google's ML Kit / Play Services barcode scanner that expo-camera normally bundles, and the QR scanner then decodes camera snapshots with jsQR instead (apps/mobile/src/lib/qrSnapshot.ts). Everything else in the app is already open source. Expo's native modules are built from source rather than from Expo's precompiled AARs (expo.autolinking.android.buildFromSource in apps/mobile/package.json), which F-Droid requires and which is also what lets the scanner be switched off. Release builds without our signing key come out unsigned, which is what F-Droid wants: it signs with its own key.

What's in the repo for this

  • LICENSE: AGPL-3.0 (also set in every package.json).
  • fastlane/metadata/android/en-US/: the store listing F-Droid shows (title, descriptions, icon, changelogs, screenshots).
  • fdroid/tech.chrisedwards.musicshare.yml: a draft of the build recipe for fdroiddata.
  • apps/mobile/app.config.ts: the MUSICSHARE_FOSS=1 switch (turns off expo-camera's ML Kit scanner).

Before submitting

  1. Publish the source somewhere public, such as Codeberg (popular with F-Droid apps) or GitHub, and put its URL in place of PUBLIC_REPO_URL in the recipe.
  2. Add screenshots: 2-8 portrait PNGs in fastlane/metadata/android/en-US/images/phoneScreenshots/ named 1.png, 2.png, and so on.
  3. Tag the release: git tag v1.0.0 && git push --tags. F-Droid builds from tags.
  4. Check the FOSS build yourself:
    cd apps/mobile
    MUSICSHARE_FOSS=1 CI=1 npx expo prebuild --platform android --clean --no-install
    cd android && ./gradlew :app:assembleRelease
    # nothing from Google's closed-source libraries should be inside:
    unzip -l app/build/outputs/apk/release/app-release*.apk | grep -iE 'mlkit|gms' || echo clean
    

Submitting

  1. Fork https://gitlab.com/fdroid/fdroiddata, copy the recipe to metadata/tech.chrisedwards.musicshare.yml.
  2. Test it with fdroid readmeta, fdroid lint tech.chrisedwards.musicshare and fdroid build -v -l tech.chrisedwards.musicshare (fdroidserver, or their Docker image).
  3. Open a merge request. Reviewers often ask for changes to how Node is installed or how npm dependencies are fetched for React Native apps; that's normal.

The listing will carry the NonFreeNet anti-feature, because the app can connect to Spotify, Apple Music, Last.fm and Plex. That's expected and doesn't block inclusion.

Releasing an update

  1. Bump version and android.versionCode in apps/mobile/app.json.
  2. Add fastlane/metadata/android/en-US/changelogs/<versionCode>.txt.
  3. Commit, tag v<version>, push the tag. F-Droid picks it up automatically (AutoUpdateMode). Our own server builds the signed APKs for the same tag (see docs/ANDROID-CI.md).

IzzyOnDroid (faster alternative)

IzzyOnDroid's repository lists apps from signed APKs attached to releases, usually within days, and F-Droid's client can add it. Attach the APK built with our key (or the FOSS build) to each release on the public repo and request inclusion at https://gitlab.com/IzzyOnDroid/repo.