Last active
November 22, 2024 19:55
-
Star
(119)
You must be signed in to star a gist -
Fork
(25)
You must be signed in to fork a gist
-
-
Save gabrielemariotti/6856974 to your computer and use it in GitHub Desktop.
Use signing.properties file which controls which keystore to use to sign the APK with gradle.
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
android { | |
signingConfigs { | |
release | |
} | |
buildTypes { | |
release { | |
signingConfig signingConfigs.release | |
} | |
} | |
} | |
def 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('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 { | |
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 | |
} |
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
STORE_FILE=/path/to/your.keystore | |
STORE_PASSWORD=yourkeystorepass | |
KEY_ALIAS=projectkeyalias | |
KEY_PASSWORD=keyaliaspassword |
thanks!
Awesome! Thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great solution @gabrielemariotti thanks for sharing this!
This is how I did it: zdavatz/generika_android@e16af6f