Skip to content

Instantly share code, notes, and snippets.

View qwertyfinger's full-sized avatar

Andrii Chubko qwertyfinger

View GitHub Profile
@qwertyfinger
qwertyfinger / DimensionUtils.kt
Last active August 30, 2021 02:45
dp to px to sp extension functions
@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
}
#!/bin/sh
BUILD_ID=$1
TEST_DIR=$2
test_apk() {
RESULTS_DIR=$1_${BUILD_ID}
gcloud firebase test android run \
--type instrumentation \
--app $2 \
#!/bin/sh
if [ "$GCLOUD_SERVICE_KEY" = "" ]; then
echo "GCLOUD_SERVICE_KEY env variable is empty. Exiting."
exit 1
fi
# Export to secrets file
echo $GCLOUD_SERVICE_KEY | base64 -di > gcloud-service-key.json
#!/bin/sh
ENCRYPT_KEY=$1
# 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
# 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
@qwertyfinger
qwertyfinger / Dependencies.kt
Last active January 8, 2019 19:14
Android Gradle setup template with the common dependencies and settings
// This file is placed in buildSrc module
@file:Suppress("MayBeConstant")
package buildsrc
@Suppress("unused")
object BuildConfig {
val buildTools = "28.0.3"
val minSdk = 17