mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-11 18:12:23 +01:00
Fixes #22861 GitHub Actions CI uses ephemeral debug keystore resulting in APKs being signed differently each time. This results in user not having trust in where the builds come from and Android rejecting the update due to mismatched keys. This commit introduces a script to (re)create a keystore to be used for signing APKs in GitHub Actions, sets environment variables for CI job with generated key and modifies gradle project to consume those variables. I have generated the keystore with aforementioned script and set secrects in the main repository with both the keystore password and keystore contents.
49 lines
1.3 KiB
Bash
Executable File
49 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# OpenRCT2 Android Keystore Creation Script
|
|
# This script creates a sample keystore for signing Android APKs
|
|
|
|
set -e
|
|
|
|
# Configuration - modify these values as needed
|
|
KEYSTORE_FILE="openrct2-release-key.keystore"
|
|
KEY_ALIAS="openrct2"
|
|
KEY_ALGORITHM="RSA"
|
|
KEY_SIZE="2048"
|
|
VALIDITY_DAYS="10950" # 30 years
|
|
|
|
# Certificate details
|
|
CERT_DNAME="CN=OpenRCT2 Team, OU=Development, O=OpenRCT2 Team"
|
|
|
|
if [ -z "$KEYSTORE_PASSWORD" ]; then
|
|
echo "Error: KEYSTORE_PASSWORD environment variable must be set"
|
|
echo "Usage: KEYSTORE_PASSWORD='your_secure_password' $0"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Creating OpenRCT2 release keystore..."
|
|
echo "File: $KEYSTORE_FILE"
|
|
echo "Alias: $KEY_ALIAS"
|
|
echo "Algorithm: $KEY_ALGORITHM $KEY_SIZE"
|
|
echo "Validity: $VALIDITY_DAYS days"
|
|
echo "DN: $CERT_DNAME"
|
|
|
|
# Create the keystore
|
|
keytool -genkeypair \
|
|
-keystore "$KEYSTORE_FILE" \
|
|
-alias "$KEY_ALIAS" \
|
|
-keyalg "$KEY_ALGORITHM" \
|
|
-keysize "$KEY_SIZE" \
|
|
-validity "$VALIDITY_DAYS" \
|
|
-dname "$CERT_DNAME" \
|
|
-storetype PKCS12 \
|
|
-storepass "$KEYSTORE_PASSWORD" \
|
|
-keypass "$KEYSTORE_PASSWORD" \
|
|
-noprompt
|
|
|
|
echo "Keystore created successfully: $KEYSTORE_FILE"
|
|
|
|
# Verify the keystore
|
|
echo ""
|
|
echo "Keystore information:"
|
|
keytool -list -v -keystore "$KEYSTORE_FILE" -storepass "$KEYSTORE_PASSWORD"
|