Skip to content

Instantly share code, notes, and snippets.


Andrii Chubko qwertyfinger

View GitHub Profile
qwertyfinger / Dependencies.kt
Last active Jan 8, 2019
Android Gradle setup template with the common dependencies and settings
View Dependencies.kt
// This file is placed in buildSrc module
package buildsrc
object BuildConfig {
val buildTools = "28.0.3"
val minSdk = 17
# Encrypt Release key
openssl enc -aes-256-cbc -md sha256 -in app-release.jks -out app-release.aes -pass pass:yourPassword
# Encrypt Google Services key
openssl enc -aes-256-cbc -md sha256 -in google-services.json -out google-services.aes -pass pass:yourPassword
# Encrypt Play publishing key
openssl enc -aes-256-cbc -md sha256 -in play-publish-account.json -out play-publish-account.aes -pass pass:yourPassword
View signing\
# Decrypt Release key
openssl aes-256-cbc -md sha256 -d -in signing/app-release.aes -out signing/app-release.jks -k $ENCRYPT_KEY
# Decrypt Google Services key
openssl aes-256-cbc -md sha256 -d -in signing/google-services.aes -out app/google-services.json -k $ENCRYPT_KEY
View ftl-tests\
if [ "$GCLOUD_SERVICE_KEY" = "" ]; then
echo "GCLOUD_SERVICE_KEY env variable is empty. Exiting."
exit 1
# Export to secrets file
echo $GCLOUD_SERVICE_KEY | base64 -di > gcloud-service-key.json
View ftl-tests\
test_apk() {
gcloud firebase test android run \
--type instrumentation \
--app $2 \
qwertyfinger / DimensionUtils.kt
Last active Aug 30, 2021
dp to px to sp extension functions
View DimensionUtils.kt
@Dimension(unit = Dimension.DP)
fun Number.pxToDp(): Float {
return toFloat() / Resources.getSystem().displayMetrics.density
@Dimension(unit = Dimension.SP)
fun Number.pxToSp(): Float {
return toFloat() / Resources.getSystem().displayMetrics.scaledDensity