2017-12-13 22:44:56 -05:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
|
|
|
android {
|
2022-08-21 19:41:54 -04:00
|
|
|
compileSdkVersion 33
|
2017-12-13 22:44:56 -05:00
|
|
|
defaultConfig {
|
2025-01-22 21:30:49 +03:00
|
|
|
applicationId "org.maintainteam.hypatia"
|
|
|
|
resValue "string", "app_name", "Hypatia"
|
2023-12-26 19:26:33 -05:00
|
|
|
minSdkVersion 16
|
2022-08-21 19:41:54 -04:00
|
|
|
targetSdkVersion 32
|
2024-11-30 13:56:39 -05:00
|
|
|
versionCode 314
|
|
|
|
versionName "3.14"
|
2025-02-05 00:16:52 -03:00
|
|
|
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
|
2017-12-16 15:02:10 -05:00
|
|
|
}
|
2017-12-13 22:44:56 -05:00
|
|
|
buildTypes {
|
2017-12-16 15:09:34 -05:00
|
|
|
debug {
|
2025-01-22 21:30:49 +03:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2017-12-16 15:09:34 -05:00
|
|
|
minifyEnabled true
|
2017-12-16 15:54:12 -05:00
|
|
|
zipAlignEnabled true
|
2025-01-22 21:30:49 +03:00
|
|
|
|
2017-12-16 15:09:34 -05:00
|
|
|
}
|
2017-12-13 22:44:56 -05:00
|
|
|
release {
|
2017-12-16 15:09:34 -05:00
|
|
|
shrinkResources true
|
|
|
|
minifyEnabled true
|
2017-12-16 15:54:12 -05:00
|
|
|
zipAlignEnabled true
|
2023-12-28 22:18:35 -05:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
2017-12-13 22:44:56 -05:00
|
|
|
}
|
|
|
|
}
|
2022-08-21 19:41:54 -04:00
|
|
|
lint {
|
2021-09-20 16:36:04 -04:00
|
|
|
abortOnError false
|
|
|
|
}
|
2024-04-21 14:08:07 -04:00
|
|
|
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'
|
|
|
|
}
|
2017-12-13 22:44:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2023-04-24 18:09:49 -04:00
|
|
|
implementation 'commons-io:commons-io:2.5'
|
2023-12-28 22:05:45 -05:00
|
|
|
implementation 'org.bouncycastle:bcpg-jdk15to18:1.77'
|
2023-12-21 19:44:40 -05:00
|
|
|
implementation 'com.google.guava:guava:33.0.0-jre'
|
2018-06-03 13:49:37 -04:00
|
|
|
}
|
2025-01-22 21:30:49 +03:00
|
|
|
|
|
|
|
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 ""
|
|
|
|
}
|
|
|
|
}
|