You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
744 B
46 lines
744 B
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
ALIAS=release
|
|
COMMON_NAME=AppVenture
|
|
STORE_FILE=releases.jks
|
|
STORE_FILE_HEX=releases.hex
|
|
STORE_PASS=$1
|
|
VALIDITY=10000
|
|
|
|
if [ -z "$STORE_PASS" ]; then
|
|
echo "Usage: ./genkeystore <storepass>"
|
|
exit 1
|
|
fi
|
|
|
|
echo
|
|
echo "Using keytool to generate a keystore"
|
|
|
|
keytool -genkey -v \
|
|
-keystore "$STORE_FILE" \
|
|
-storepass "$STORE_PASS" \
|
|
-keyalg RSA -keysize 2048 \
|
|
-validity "$VALIDITY" \
|
|
-alias "$ALIAS" \
|
|
-dname "CN=$COMMON_NAME"
|
|
|
|
echo
|
|
echo "Exporting hex keystore"
|
|
|
|
xxd -ps "$STORE_FILE" > "$STORE_FILE_HEX"
|
|
|
|
echo
|
|
echo "Here's the environmental variables you need to set:"
|
|
|
|
echo
|
|
echo "store_file"
|
|
cat "$STORE_FILE_HEX"
|
|
|
|
echo
|
|
echo "store_password"
|
|
echo "$STORE_PASS"
|
|
|
|
echo
|
|
echo "key_alias"
|
|
echo "$ALIAS"
|