Get the repo ready for F-Droid
CI / check (push) Canceled after 0s

- License: AGPL-3.0-or-later (LICENSE, every package.json, README).
- MUSICSHARE_FOSS=1 builds leave out the only closed-source code, Google's
  ML Kit / Play Services barcode scanner bundled by expo-camera; the scan
  screen then decodes small camera snapshots with jsQR instead.
- Expo modules build from source rather than from precompiled AARs, as
  F-Droid requires (that's also what makes the scanner switch take effect).
  Verified: a FOSS build contains no ML Kit or Play Services classes.
- Release builds default to the production server, and come out unsigned
  without our upload key (F-Droid signs with its own). versionCode 1.
- Store listing in fastlane/metadata/android, a draft fdroiddata recipe in
  fdroid/, and docs/FDROID.md with the submission steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzFywujuH9TiuXbr9vjoX8
This commit is contained in:
2026-10-06 15:26:59 -04:00
co-authored by Claude Opus 5.5
parent 773e6f0e3f
commit a4dad724ad
23 changed files with 522 additions and 14 deletions
+10 -4
View File
@@ -10,11 +10,17 @@ import type { ConfigContext, ExpoConfig } from 'expo/config';
export default ({ config }: ConfigContext): ExpoConfig => {
const apiUrl = process.env.EXPO_PUBLIC_API_URL ?? '';
const localHttp = apiUrl.startsWith('http://');
// F-Droid (MUSICSHARE_FOSS=1): no closed-source libraries. The only one is the Google ML Kit /
// Play Services barcode scanner expo-camera bundles; the scan screen decodes QR codes in JS instead.
const foss = process.env.MUSICSHARE_FOSS === '1';
type Plugin = NonNullable<ExpoConfig['plugins']>[number];
const plugins = (config.plugins ?? []).map(
(plugin): Plugin =>
foss && Array.isArray(plugin) && plugin[0] === 'expo-camera' ? ['expo-camera', { ...plugin[1], barcodeScannerEnabled: false }] : plugin,
);
return {
...(config as ExpoConfig),
plugins: [
...(config.plugins ?? []),
['expo-build-properties', { android: { usesCleartextTraffic: localHttp } }],
],
extra: { ...config.extra, foss },
plugins: [...plugins, ['expo-build-properties', { android: { usesCleartextTraffic: localHttp } }] satisfies Plugin],
};
};