From 292775eb07a83d46828909a5159bfc2efdc0de13 Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Sun, 9 Jan 2022 23:55:35 +0200 Subject: [PATCH] SuperTux: a script to repack app bundle to get rid of 'assets' directory --- .../supertux/AndroidAppSettings.cfg | 4 +-- .../supertux/repack-bundle-data.sh | 28 +++++++++++++++++++ project/jni/application/supertux/supertux | 2 +- 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100755 project/jni/application/supertux/repack-bundle-data.sh diff --git a/project/jni/application/supertux/AndroidAppSettings.cfg b/project/jni/application/supertux/AndroidAppSettings.cfg index 6e7710332..5451bdcd1 100644 --- a/project/jni/application/supertux/AndroidAppSettings.cfg +++ b/project/jni/application/supertux/AndroidAppSettings.cfg @@ -7,10 +7,10 @@ AppName="SuperTux" AppFullName=org.lethargik.supertux2 # Application version code (integer) -AppVersionCode=06321 +AppVersionCode=06322 # Application user-visible version name (string) -AppVersionName="0.6.3.21" +AppVersionName="0.6.3.22" # Specify path to download application data in zip archive in the form "Description|URL|MirrorURL^Description2|URL2|MirrorURL2^..." # If you'll start Description with '!' symbol it will be enabled by default, '!!' will also hide the entry from the menu, so it cannot be disabled diff --git a/project/jni/application/supertux/repack-bundle-data.sh b/project/jni/application/supertux/repack-bundle-data.sh new file mode 100755 index 000000000..c090f8ca1 --- /dev/null +++ b/project/jni/application/supertux/repack-bundle-data.sh @@ -0,0 +1,28 @@ +#!/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 diff --git a/project/jni/application/supertux/supertux b/project/jni/application/supertux/supertux index 1e6b85548..837501c7f 160000 --- a/project/jni/application/supertux/supertux +++ b/project/jni/application/supertux/supertux @@ -1 +1 @@ -Subproject commit 1e6b85548f443cd986e4a2fb35b143c53f1445d9 +Subproject commit 837501c7f341ef6b8a549ef58e5181f7f0403e89