From 36a6e04c0feace9e363da5070a9ccc7852e8877c Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 16 Oct 2020 20:04:23 +0530 Subject: [PATCH 1/2] Add play and fdroid build flavors --- app/build.gradle | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index e3fb7a4a7..b08f172b1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,7 +61,6 @@ android { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - signingConfig signingConfigs.release } debug { applicationIdSuffix '.debug' @@ -81,6 +80,21 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + flavorDimensions "version" + productFlavors { + productFlavors { + play { + dimension "version" + signingConfig signingConfigs.release + } + fdroid { + dimension "version" + // applicationIdSuffix ".fdroid" + versionNameSuffix ' (F-Droid)' + + } + } + } } dependencies { From 06705da9291779e4d82143406bc3d1771f35d0d9 Mon Sep 17 00:00:00 2001 From: George Zacharia Date: Fri, 16 Oct 2020 20:10:14 +0530 Subject: [PATCH 2/2] Allow Pro version on f-droid build flavor too --- app/src/main/java/com/kabouzeid/gramophone/App.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/kabouzeid/gramophone/App.java b/app/src/main/java/com/kabouzeid/gramophone/App.java index 8d1d0b3d1..b527c2c73 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/App.java +++ b/app/src/main/java/com/kabouzeid/gramophone/App.java @@ -69,7 +69,10 @@ public void onBillingInitialized() { } public static boolean isProVersion() { - return BuildConfig.DEBUG || app.billingProcessor.isPurchased(PRO_VERSION_PRODUCT_ID); + if (BuildConfig.DEBUG || BuildConfig.FLAVOR.equals("fdroid")) { + return true; + } + return app.billingProcessor.isPurchased(PRO_VERSION_PRODUCT_ID); } private static OnProVersionChangedListener onProVersionChangedListener;