Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 45d6479

Browse files
authored
Merge pull request #111 from gilbsgilbs/fdroid-build-flavor
Add F-Droid build flavor.
2 parents 6d616ab + e1cc030 commit 45d6479

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

app/build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,25 @@ android {
2828
debuggable true
2929
}
3030
}
31+
32+
flavorDimensions "type"
33+
productFlavors {
34+
"default" {
35+
dimension "type"
36+
buildConfigField "boolean", "ENABLE_AUTO_UPDATER", "true"
37+
}
38+
39+
fdroid {
40+
dimension "type"
41+
applicationIdSuffix ".fdroid"
42+
43+
// Need to disable auto-updater for F-Droid flavor because their inclusion policy
44+
// forbids downloading blobs from third-party websites (and F-Droid APK isn't signed
45+
// with our keys, so the APK wouldn't install anyways).
46+
buildConfigField "boolean", "ENABLE_AUTO_UPDATER", "false"
47+
}
48+
}
49+
3150
compileOptions {
3251
sourceCompatibility JavaVersion.VERSION_1_8
3352
targetCompatibility JavaVersion.VERSION_1_8

app/src/main/java/com/fox2code/mmm/AppUpdateManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ private AppUpdateManager() {
6363

6464
// Return true if should show a notification
6565
public boolean checkUpdate(boolean force) {
66+
if (!BuildConfig.ENABLE_AUTO_UPDATER)
67+
return false;
6668
if (!force && this.peekShouldUpdate())
6769
return true;
6870
long lastChecked = this.lastChecked;

0 commit comments

Comments
 (0)