Files
OpenRCT2-Web/scripts/create-android-keystore
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.3 KiB
Bash
Raw Normal View History

#!/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"