mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-05 19:08:23 +00:00
Disable self-updater for F-Droid builds via IS_FDROID_BUILD flag
Add IS_FDROID_BUILD BuildConfig field (default false). The F-Droid workflow (create-release.yml) flips it to true via sed before building, alongside the existing permission removal step. Amber.kt gates the ZapstoreUpdater instantiation on this flag so F-Droid APKs never attempt to check for or download updates. https://claude.ai/code/session_01NmFcCFmEbY7NMradkEU5bv
This commit is contained in:
@@ -29,9 +29,10 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: Remove self-update permission for F-Droid build
|
||||
- name: Prepare F-Droid build (no self-update)
|
||||
run: |
|
||||
sed -i '/android.permission.REQUEST_INSTALL_PACKAGES/d' app/src/main/AndroidManifest.xml
|
||||
sed -i 's/buildConfigField "boolean", "IS_FDROID_BUILD", "false"/buildConfigField "boolean", "IS_FDROID_BUILD", "true"/' app/build.gradle
|
||||
|
||||
- name: Build APK
|
||||
run: ./gradlew assembleRelease --stacktrace
|
||||
|
||||
@@ -15,6 +15,8 @@ android {
|
||||
versionCode 184
|
||||
versionName "6.0.0-pre1"
|
||||
|
||||
buildConfigField "boolean", "IS_FDROID_BUILD", "false"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
|
||||
@@ -132,7 +132,7 @@ class Amber :
|
||||
// This runs on the foreground only
|
||||
val profileSubscription = ProfileSubscription(client, this, applicationIOScope)
|
||||
|
||||
val zapstoreUpdater: ZapstoreUpdater? = if (!BuildFlavorChecker.isOfflineFlavor()) {
|
||||
val zapstoreUpdater: ZapstoreUpdater? = if (!BuildFlavorChecker.isOfflineFlavor() && !BuildConfig.IS_FDROID_BUILD) {
|
||||
ZapstoreUpdater(client, applicationIOScope)
|
||||
} else {
|
||||
null
|
||||
|
||||
Reference in New Issue
Block a user