Android security implementation Phase 0-3 finalization part 1
This commit is contained in:
+35
-34
@@ -1,39 +1,39 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'org.jetbrains.kotlin.android'
|
||||
|
||||
def appVersion = new groovy.json.JsonSlurper().parse(file("../../package.json")).version
|
||||
def appVersionParts = appVersion.tokenize('.').collect { it.toInteger() }
|
||||
def releaseStoreFile = System.getenv('EP_MAIL_ANDROID_STORE_FILE')
|
||||
def releaseStorePassword = System.getenv('EP_MAIL_ANDROID_STORE_PASSWORD')
|
||||
def releaseKeyAlias = System.getenv('EP_MAIL_ANDROID_KEY_ALIAS')
|
||||
def releaseKeyPassword = System.getenv('EP_MAIL_ANDROID_KEY_PASSWORD')
|
||||
def releaseSigningValues = [releaseStoreFile, releaseStorePassword, releaseKeyAlias, releaseKeyPassword]
|
||||
def hasAnyReleaseSigningValue = releaseSigningValues.any { it != null && !it.isBlank() }
|
||||
def hasCompleteReleaseSigning = releaseSigningValues.every { it != null && !it.isBlank() }
|
||||
|
||||
if (hasAnyReleaseSigningValue && !hasCompleteReleaseSigning) {
|
||||
throw new GradleException('Android release signing requires EP_MAIL_ANDROID_STORE_FILE, EP_MAIL_ANDROID_STORE_PASSWORD, EP_MAIL_ANDROID_KEY_ALIAS, and EP_MAIL_ANDROID_KEY_PASSWORD.')
|
||||
}
|
||||
if (hasCompleteReleaseSigning && !new File(releaseStoreFile).isAbsolute()) {
|
||||
throw new GradleException('EP_MAIL_ANDROID_STORE_FILE must be an absolute path.')
|
||||
}
|
||||
def appVersion = new groovy.json.JsonSlurper().parse(file("../../package.json")).version
|
||||
def appVersionParts = appVersion.tokenize('.').collect { it.toInteger() }
|
||||
def releaseStoreFile = System.getenv('EP_MAIL_ANDROID_STORE_FILE')
|
||||
def releaseStorePassword = System.getenv('EP_MAIL_ANDROID_STORE_PASSWORD')
|
||||
def releaseKeyAlias = System.getenv('EP_MAIL_ANDROID_KEY_ALIAS')
|
||||
def releaseKeyPassword = System.getenv('EP_MAIL_ANDROID_KEY_PASSWORD')
|
||||
def releaseSigningValues = [releaseStoreFile, releaseStorePassword, releaseKeyAlias, releaseKeyPassword]
|
||||
def hasAnyReleaseSigningValue = releaseSigningValues.any { it != null && !it.isBlank() }
|
||||
def hasCompleteReleaseSigning = releaseSigningValues.every { it != null && !it.isBlank() }
|
||||
|
||||
if (hasAnyReleaseSigningValue && !hasCompleteReleaseSigning) {
|
||||
throw new GradleException('Android release signing requires EP_MAIL_ANDROID_STORE_FILE, EP_MAIL_ANDROID_STORE_PASSWORD, EP_MAIL_ANDROID_KEY_ALIAS, and EP_MAIL_ANDROID_KEY_PASSWORD.')
|
||||
}
|
||||
if (hasCompleteReleaseSigning && !new File(releaseStoreFile).isAbsolute()) {
|
||||
throw new GradleException('EP_MAIL_ANDROID_STORE_FILE must be an absolute path.')
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "studio.daybreak.mail"
|
||||
compileSdk = rootProject.ext.compileSdkVersion
|
||||
buildFeatures {
|
||||
buildConfig true
|
||||
}
|
||||
if (hasCompleteReleaseSigning) {
|
||||
signingConfigs {
|
||||
release {
|
||||
storeFile file(releaseStoreFile)
|
||||
storePassword releaseStorePassword
|
||||
keyAlias releaseKeyAlias
|
||||
keyPassword releaseKeyPassword
|
||||
}
|
||||
}
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig true
|
||||
}
|
||||
if (hasCompleteReleaseSigning) {
|
||||
signingConfigs {
|
||||
release {
|
||||
storeFile file(releaseStoreFile)
|
||||
storePassword releaseStorePassword
|
||||
keyAlias releaseKeyAlias
|
||||
keyPassword releaseKeyPassword
|
||||
}
|
||||
}
|
||||
}
|
||||
packaging {
|
||||
resources {
|
||||
pickFirsts += "META-INF/NOTICE.md"
|
||||
@@ -54,11 +54,11 @@ android {
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
if (hasCompleteReleaseSigning) signingConfig signingConfigs.release
|
||||
}
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
if (hasCompleteReleaseSigning) signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
@@ -80,6 +80,7 @@ dependencies {
|
||||
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
||||
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
|
||||
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
|
||||
implementation 'androidx.biometric:biometric:1.1.0'
|
||||
implementation project(':capacitor-android')
|
||||
implementation 'com.sun.mail:android-mail:1.6.7'
|
||||
implementation 'com.sun.mail:android-activation:1.6.7'
|
||||
|
||||
Reference in New Issue
Block a user