// F-Droid builds (MUSICSHARE_FOSS=1) get their updates from F-Droid, so they mustn't be able to // install packages themselves: remove the permissions the updater module (modules/updater) adds. const { AndroidConfig, withAndroidManifest } = require('expo/config-plugins'); const PERMISSIONS = ['android.permission.REQUEST_INSTALL_PACKAGES', 'android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION']; module.exports = function withoutSelfUpdate(config) { return withAndroidManifest(config, (cfg) => { const manifest = AndroidConfig.Manifest.ensureToolsAvailable(cfg.modResults).manifest; const existing = manifest['uses-permission'] ?? []; manifest['uses-permission'] = [ ...existing.filter((p) => !PERMISSIONS.includes(p.$['android:name'])), ...PERMISSIONS.map((name) => ({ $: { 'android:name': name, 'tools:node': 'remove' } })), ]; return cfg; }); };