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 { 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;