SuperTux: put a data archive inside the assetpack archive, there's no other way

This commit is contained in:
Sergii Pylypenko
2022-01-10 00:47:46 +02:00
parent 292775eb07
commit 8edb321123
5 changed files with 13 additions and 30 deletions

View File

@@ -1 +1,2 @@
/data.zip
/AndroidData/assetpack

View File

@@ -1 +0,0 @@
../supertux/data

View File

@@ -0,0 +1,11 @@
#!/bin/sh
mkdir -p AndroidData/assetpack
[ -e AndroidData/assetpack/data.zip ] && exit 0
cd supertux/data || exit 1
sed 's/@LOGO_FILE@/logo_final.sprite/g' levels/misc/menu.stl.in > levels/misc/menu.stl
if [ -e $HOME/.local/share/supertux2/tilecache ]; then
mkdir -p tilecache
cp -f $HOME/.local/share/supertux2/tilecache/* tilecache/
fi
zip -r -9 ../../AndroidData/assetpack/data.zip .

View File

@@ -1,28 +0,0 @@
#!/bin/sh
# Set path to your Android keystore and your keystore alias here, or put them in your environment
PASS=
[ -n "$ANDROID_UPLOAD_KEYSTORE_PASS" ] && PASS="-storepass:env ANDROID_UPLOAD_KEYSTORE_PASS"
[ -n "$ANDROID_UPLOAD_KEYSTORE_PASS_FILE" ] && PASS="-storepass:file $ANDROID_UPLOAD_KEYSTORE_PASS_FILE"
cd ../../../../
APPNAME=`grep AppName AndroidAppSettings.cfg | sed 's/.*=//' | tr -d '"' | tr " '/" '---'`
APPVER=`grep AppVersionName AndroidAppSettings.cfg | sed 's/.*=//' | tr -d '"' | tr " '/" '---'`
rm -rf supertux-tmp
mkdir -p supertux-tmp
cd supertux-tmp
unzip ../$APPNAME-$APPVER.aab || exit 1
rm -rf META-INF
mv assetpack/assets/* assetpack/
rm ../$APPNAME-$APPVER.aab
zip -r ../$APPNAME-$APPVER.aab .
cd ..
rm -rf supertux-tmp
# Sign with the new certificate
echo Using keystore $ANDROID_UPLOAD_KEYSTORE_FILE and alias $ANDROID_UPLOAD_KEYSTORE_ALIAS
stty -echo
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $ANDROID_UPLOAD_KEYSTORE_FILE $PASS $APPNAME-$APPVER.aab $ANDROID_UPLOAD_KEYSTORE_ALIAS || exit 1
stty echo
echo