Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gradle keystore configuration
apply plugin: ...
def debugKeystorePropertiesFile = rootProject.file("env/debug-keystore.properties");
def debugKeystoreProperties = new Properties()
debugKeystoreProperties.load(new FileInputStream(debugKeystorePropertiesFile))
def releaseKeystorePropertiesFile = rootProject.file("env/release-keystore.properties");
def releaseKeystoreProperties = new Properties()
if(releaseKeystorePropertiesFile.exists()) {
releaseKeystoreProperties.load(new FileInputStream(releaseKeystorePropertiesFile))
}
android {
...
signingConfigs {
debug {
storeFile file("$rootDir\\env\\debug-keystore.jks")
storePassword debugKeystoreProperties['storePassword']
keyAlias debugKeystoreProperties['keyAlias']
keyPassword debugKeystoreProperties['keyPassword']
}
release {
storeFile file("$rootDir\\env\\release-keystore.jks")
storePassword releaseKeystoreProperties['storePassword']
keyAlias releaseKeystoreProperties['keyAlias']
keyPassword releaseKeystoreProperties['keyPassword']
}
}
buildTypes {
debug {
...
signingConfig signingConfigs.debug
}
release {
...
signingConfig signingConfigs.release
}
}
...
}
keyPassword=YOURDEBUGPASSWORD
storePassword=YOURDEBUGPASSWORD
keyAlias=key0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment