Last active
December 1, 2015 17:01
-
-
Save RowlandOti/6f33d5f5d1a56700c54a to your computer and use it in GitHub Desktop.
Automated Signing of *.*.apk file in Android Studio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def Properties props = new Properties() | |
def propFile = file('../signing.properties') | |
if (propFile.canRead()){ | |
props.load(new FileInputStream(propFile)) | |
if (props!=null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') && | |
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) { | |
println 'RELEASE BUILD SIGNING' | |
android.signingConfigs.release.storeFile = file(props['STORE_FILE']) | |
android.signingConfigs.release.storePassword = props['STORE_PASSWORD'] | |
android.signingConfigs.release.keyAlias = props['KEY_ALIAS'] | |
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD'] | |
} else { | |
println 'RELEASE BUILD NOT FOUND SIGNING PROPERTIES' | |
android.buildTypes.release.signingConfig = null | |
} | |
}else { | |
println 'RELEASE BUILD NOT FOUND SIGNING FILE' | |
android.buildTypes.release.signingConfig = null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment