Skip to content

Instantly share code, notes, and snippets.

@nguyentruongtho
Created December 13, 2014 07:44
Show Gist options
  • Save nguyentruongtho/44caf1ebe0ca87ede1e8 to your computer and use it in GitHub Desktop.
Save nguyentruongtho/44caf1ebe0ca87ede1e8 to your computer and use it in GitHub Desktop.
// signing.properties
STORE_FILE=../app.jks
STORE_PASSWORD=**pass**
KEY_ALIAS=**key**
KEY_PASSWORD=**pass**
// app.gradle
File propFile = file('signing.properties');
if (propFile.exists()) {
def Properties props = new Properties()
props.load(new FileInputStream(propFile))
if (props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
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 {
android.buildTypes.release.signingConfig = null
}
} else {
android.buildTypes.release.signingConfig = null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment