Files
chrisandClaude Opus 5.5 5cbde5e7f9 The Android app updates itself from our Gitea releases; feed cards fade in instead of bouncing
- API: GET /app/android/latest reads the latest Gitea release (ANDROID_RELEASES_URL, optional token for a
  private repo) with the APK's SHA-256 from SHA256SUMS; GET /app/android/apk/:name streams that APK.
- App (modules/updater): downloads in the background, checks the SHA-256, and installs through
  PackageInstaller: quietly once when leaving the app (Android 12+), otherwise from the feed banner or
  Settings > App version. F-Droid builds leave it out and drop the install permissions.
- CI: the release notes come from the fastlane changelog; the app shows the part above ---.
- Settings: Create-account and Link Spotify buttons for Last.fm and ListenBrainz.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 12:34:04 -04:00

32 lines
1.4 KiB
TypeScript

import type { ConfigContext, ExpoConfig } from 'expo/config';
/**
* app.json holds the real config; this only adds build-time switches.
*
* Local test builds point at a dev server over plain http://, which Android
* blocks by default in release builds. Allow cleartext only when the API URL
* itself is http://, so store builds (https) stay locked down.
*/
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),
extra: { ...config.extra, foss },
plugins: [
...plugins,
['expo-build-properties', { android: { usesCleartextTraffic: localHttp } }] satisfies Plugin,
// F-Droid delivers updates itself; only our own builds install them (modules/updater).
...(foss ? ['./plugins/withoutSelfUpdate'] : []),
],
};
};