apply plugin: 'com.android.application' android { compileSdkVersion 33 defaultConfig { applicationId "org.maintainteam.hypatia" resValue "string", "app_name", "Hypatia" minSdkVersion 16 targetSdkVersion 32 versionCode 314 versionName "3.14" resConfigs 'en', 'ar', 'bg', 'cs', 'de', 'es', 'et', 'fi', 'fr', 'gl', 'hr', 'in', 'it', 'ja', 'pt', 'pt-rBR', 'ro', 'ru', 'sk', 'ta', 'tr', 'uk', 'zh-rCN', 'zh-rTW' // currently disabled locales due to insufficient translation: af, pl, el } buildTypes { debug { debuggable true // suffix the app id and the app name with git branch name def workingBranch = getGitWorkingBranch() def normalizedWorkingBranch = workingBranch.replaceFirst("^[^A-Za-z]+", "").replaceAll("[^0-9A-Za-z]+", "") if (normalizedWorkingBranch.isEmpty() || workingBranch == "master" || workingBranch == "dev" || workingBranch == "stable") { // default values when branch name could not be determined or is master, dev or stable applicationIdSuffix ".debug" resValue "string", "app_name", "Hypatia Debug" } else { applicationIdSuffix ".debug." + normalizedWorkingBranch resValue "string", "app_name", "Hypatia " + workingBranch } minifyEnabled true zipAlignEnabled true } release { shrinkResources true minifyEnabled true zipAlignEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } lint { abortOnError false } packagingOptions { exclude 'org/bouncycastle/pqc/crypto/picnic/lowmcL1.bin.properties' exclude 'org/bouncycastle/pqc/crypto/picnic/lowmcL3.bin.properties' exclude 'org/bouncycastle/pqc/crypto/picnic/lowmcL5.bin.properties' exclude 'org/bouncycastle/x509/CertPathReviewerMessages.properties' exclude 'org/bouncycastle/x509/CertPathReviewerMessages_de.properties' } } dependencies { implementation 'commons-io:commons-io:2.5' implementation 'org.bouncycastle:bcpg-jdk15to18:1.77' implementation 'com.google.guava:guava:33.0.0-jre' } static String getGitWorkingBranch() { try { def gitProcess = "git rev-parse --abbrev-ref HEAD".execute() gitProcess.waitFor() if (gitProcess.exitValue() == 0) { return gitProcess.text.trim() } else { // not a git repository return "" } } catch (IOException ignored) { // git was not found return "" } }