sign the release version of the app
This commit is contained in:
parent
a36f3743b8
commit
22b015937c
3 changed files with 32 additions and 0 deletions
|
|
@ -14,10 +14,15 @@ android {
|
|||
setProperty("archivesBaseName", "contacts")
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -42,3 +47,22 @@ dependencies {
|
|||
//debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
|
||||
//releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"
|
||||
}
|
||||
|
||||
Properties props = new Properties()
|
||||
def propFile = new File('signing.properties')
|
||||
if (propFile.canRead()) {
|
||||
props.load(new FileInputStream(propFile))
|
||||
|
||||
if (props != null && props.containsKey('STORE_FILE') && props.containsKey('KEY_ALIAS') && props.containsKey('PASSWORD')) {
|
||||
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
|
||||
android.signingConfigs.release.storePassword = props['PASSWORD']
|
||||
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
|
||||
android.signingConfigs.release.keyPassword = props['PASSWORD']
|
||||
} else {
|
||||
println 'signing.properties found but some entries are missing'
|
||||
android.buildTypes.release.signingConfig = null
|
||||
}
|
||||
} else {
|
||||
println 'signing.properties not found'
|
||||
android.buildTypes.release.signingConfig = null
|
||||
}
|
||||
|
|
|
|||
5
app/proguard-rules.pro
vendored
5
app/proguard-rules.pro
vendored
|
|
@ -0,0 +1,5 @@
|
|||
# Joda
|
||||
-dontwarn org.joda.convert.**
|
||||
-dontwarn org.joda.time.**
|
||||
-keep class org.joda.time.** { *; }
|
||||
-keep interface org.joda.time.** { *; }
|
||||
3
signing.properties_sample
Normal file
3
signing.properties_sample
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
STORE_FILE=/path/to/your.keystore
|
||||
KEY_ALIAS=projectkeyalias
|
||||
PASSWORD=yourpass
|
||||
Loading…
Reference in a new issue