From d524f3042583d75a383d2a686587e15ab5c62fac Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Sat, 10 Sep 2022 17:10:48 +0100 Subject: [PATCH] adding build script for generating signed foss releases --- tools/generate-fdroid-release.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tools/generate-fdroid-release.sh diff --git a/tools/generate-fdroid-release.sh b/tools/generate-fdroid-release.sh new file mode 100755 index 0000000..bf4d074 --- /dev/null +++ b/tools/generate-fdroid-release.sh @@ -0,0 +1,21 @@ +#! /bin/bash +set -e + +WORKING_DIR=app/build/outputs/apk/release +UNSIGNED=$WORKING_DIR/app-foss-release-unsigned.apk +ALIGNED_UNSIGNED=$WORKING_DIR/app-foss-release-unsigned-aligned.apk +SIGNED=$WORKING_DIR/app-foss-release-signed.apk + +ZIPALIGN=$(find "$ANDROID_HOME" -iname zipalign -print -quit) +APKSIGNER=$(find "$ANDROID_HOME" -iname apksigner -print -quit) + +./gradlew clean assembleRelease -Pfoss -Punsigned --no-daemon --no-configuration-cache --no-build-cache + +$ZIPALIGN -v -p 4 $UNSIGNED $ALIGNED_UNSIGNED + +$APKSIGNER sign \ + --ks .secrets/fdroid.keystore \ + --ks-key-alias key0 \ + --ks-pass pass:$1 \ + --out $SIGNED \ + $ALIGNED_UNSIGNED