- 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:
@@ -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],
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user