diff --git a/app/build.gradle b/app/build.gradle index 7311a536..d1cad90c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,6 +18,20 @@ android { } } + flavorDimensions "version" + productFlavors { + alpha { + applicationIdSuffix ".alpha" + versionNameSuffix " (alpha)" + } + beta { + applicationIdSuffix ".beta" + versionNameSuffix " (beta)" + } + prod { + } + } + buildTypes { release { minifyEnabled false @@ -27,6 +41,7 @@ android { applicationIdSuffix ".debug" } } + externalNativeBuild { cmake { path "CMakeLists.txt" @@ -62,9 +77,13 @@ android { output -> def abiName = output.getFilter(com.android.build.OutputFile.ABI) output.versionCodeOverride = abiCodes.get(abiName, 0) + 10 * variant.versionCode + //def flavor = output.getFilter(flavor) if (abiName == null) abiName = "universal" - def v = "${variant.versionName}".replaceFirst(" .*\$", "").replace(".", "x") + def v = "${variant.versionName}".replaceFirst(" '.*' ?", "") + .replace(".", "x") + .replace("(", "-") + .replace(")", "") outputFileName = "$rootProject.ext.apkName-" + v + "_" + abiName + ".apk" } } diff --git a/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java b/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java index 3c78f016..42bb8b85 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java +++ b/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java @@ -76,10 +76,14 @@ import okhttp3.HttpUrl; import timber.log.Timber; public class Helper { + static private final String FLAVOR_SUFFIX = + (BuildConfig.FLAVOR.equals("prod") ? "" : "." + BuildConfig.FLAVOR) + + (BuildConfig.DEBUG ? "-debug" : ""); + static public final String CRYPTO = "XMR"; - static private final String WALLET_DIR = "monerujo" + (BuildConfig.DEBUG ? "-debug" : ""); - static private final String HOME_DIR = "monero" + (BuildConfig.DEBUG ? "-debug" : ""); + static private final String WALLET_DIR = "monerujo" + FLAVOR_SUFFIX; + static private final String HOME_DIR = "monero" + FLAVOR_SUFFIX; static public int DISPLAY_DIGITS_INFO = 5;