aboutsummaryrefslogtreecommitdiff
path: root/test-rig/build-apk.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test-rig/build-apk.sh')
-rwxr-xr-xtest-rig/build-apk.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/test-rig/build-apk.sh b/test-rig/build-apk.sh
new file mode 100755
index 0000000..18b3969
--- /dev/null
+++ b/test-rig/build-apk.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Smoke test: build a signed release APK from inside the rig using a
+# throwaway keystore. Validates that scripts/build-apk + the gradle
+# signingConfigs wiring still produces a valid signed apk.
+#
+# Output: /work/app/build/outputs/apk/release/app-release.apk
+# (and the keystore in /work/.tools/release-smoke.jks)
+
+set -eu
+
+KS="/work/.tools/release-smoke.p12"
+KS_PASS="changeit"
+KEY_ALIAS="scrcpy-android-smoke"
+
+mkdir -p /work/.tools
+
+if [ ! -f "$KS" ]; then
+ echo "build-apk.sh: generating throwaway keystore at $KS"
+ keytool -genkey -noprompt \
+ -keystore "$KS" -storetype PKCS12 \
+ -storepass "$KS_PASS" -keypass "$KS_PASS" \
+ -alias "$KEY_ALIAS" -keyalg RSA -keysize 2048 -validity 365 \
+ -dname "CN=scrcpy-android smoke, OU=test, O=local, C=US" \
+ >/dev/null
+fi
+
+export KEYSTORE_PATH="$KS"
+export KEYSTORE_PASS="$KS_PASS"
+export KEY_ALIAS="$KEY_ALIAS"
+export KEY_PASS="$KS_PASS"
+
+exec /work/scripts/build-apk