30 lines
1.0 KiB
Bash
30 lines
1.0 KiB
Bash
#!/bin/bash
|
|
|
|
if [ ! -f "xapktoapk.sign.properties" -a ! -f "xapktoapk.keystore" ]; then
|
|
echo "xapktoapk.sign.properties and xapktoapk.keystore not found, create a configuration with a randomly generated key."
|
|
PASSWORD="$(LC_ALL=C tr -dc '[:alnum:]' < /dev/urandom | head -c20)"
|
|
echo "Generated password: $PASSWORD"
|
|
keytool \
|
|
-genkey \
|
|
-v \
|
|
-keystore xapktoapk.keystore \
|
|
-alias xapktoapk \
|
|
-keyalg RSA \
|
|
-keysize 2048 \
|
|
-validity 10000 \
|
|
-storepass "$PASSWORD" \
|
|
-keypass "$PASSWORD" \
|
|
-dname "CN=xapktoapk, OU=xapktoapk, O=xapktoapk, L=xapktoapk, S=xapktoapk, C=US"
|
|
cat <<-EOF > xapktoapk.sign.properties
|
|
sign.enabled=true
|
|
sign.keystore.file=/xapktoapk/xapktoapk.keystore
|
|
sign.keystore.password=$PASSWORD
|
|
sign.key.alias=xapktoapk
|
|
sign.key.password=$PASSWORD
|
|
EOF
|
|
fi
|
|
|
|
#wget https://gitea.tryton.geeraert.eu/pi-ux-ce/revanced_manager/raw/commit/6fdf15fa37e63ccbbdfdc52a2f191b2eafd816a2/data/spotify.xapk -o /tmp/spotify.xapk
|
|
python xapktoapk.py /tmp/spotify.xapk
|
|
#python xapktoapk.py "$@"
|