diff --git a/ChangeAppSettings.sh b/ChangeAppSettings.sh index 4a6405c92..0f3fdba41 100755 --- a/ChangeAppSettings.sh +++ b/ChangeAppSettings.sh @@ -1,11 +1,27 @@ #!/bin/sh + +CHANGE_APP_SETTINGS_VERSION=1 +AUTO= + +if [ "X$1" = "X-a" ]; then + AUTO=1 +fi + . ./AppSettings.cfg +if [ "$CHANGE_APP_SETTINGS_VERSION" != "$AppSettingVersion" ]; then + AUTO= +fi + +LibSdlVersionOld=$LibSdlVersion +CompiledLibrariesOld=$CompiledLibraries + var="" +if [ -z "$AUTO" ]; then + echo -n "\n===== libSDL on Android configuration =====\n\nIf you will supply empty string as answer the previous value will be used\n" -LibSdlVersionOld=$LibSdlVersion echo -n "\nlibSDL version to use (1.2 or 1.3) ($LibSdlVersion): " read var if [ -n "$var" ] ; then @@ -103,7 +119,6 @@ grep 'Available libraries:' project/jni/Application.mk grep 'depends on' project/jni/Application.mk echo -n "Current: $CompiledLibraries\n\n: " read var -CompiledLibrariesOld=$CompiledLibraries if [ -n "$var" ] ; then CompiledLibraries="$var" fi @@ -132,9 +147,12 @@ if [ -n "$ReadmeText1" ] ; then ReadmeText="$ReadmeText1" fi +fi # AUTO + echo cat /dev/null > AppSettings.cfg +echo AppSettingVersion=$CHANGE_APP_SETTINGS_VERSION >> AppSettings.cfg echo LibSdlVersion=$LibSdlVersion >> AppSettings.cfg echo AppName=\"$AppName\" >> AppSettings.cfg echo AppFullName=$AppFullName >> AppSettings.cfg diff --git a/RecompileAllApps.sh b/RecompileAllApps.sh new file mode 100755 index 000000000..e839a405a --- /dev/null +++ b/RecompileAllApps.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +KEYSTORE=~/.ssh/android.keystore +ALIAS=pelya +APPS_SKIP="src jooleem_0.1.4 lbreakout2-2.6.1 teeworlds glxgears" + +echo -n "Enter password for keystore at $KEYSTORE alias $ALIAS: " +stty -echo +read PASSWORD +stty echo + +echo + +# First edit app settings if their format was changed +for APP1 in project/jni/application/*/AppSettings.cfg; do + APP=`echo $APP1 | sed 's@project/jni/application/\([^/]*\)/.*@\1@'` + if echo $APPS_SKIP | grep $APP > /dev/null ; then + continue + fi + rm project/jni/application/src + ln -s $APP project/jni/application/src + echo + echo ===== Settings for $APP ===== + ./ChangeAppSettings.sh + rm -f $APP.apk +done + +for APP1 in project/jni/application/*/AppSettings.cfg; do + APP=`echo $APP1 | sed 's@project/jni/application/\([^/]*\)/.*@\1@'` + if echo $APPS_SKIP | grep $APP > /dev/null ; then + continue + fi + rm -f project/jni/application/src + ln -s $APP project/jni/application/src + ./ChangeAppSettings.sh -a + echo Compiling $APP + OLDPATH="`pwd`" + ( cd project && nice -n5 ndk-build -j2 V=1 && ant release && \ + jarsigner -keystore "$KEYSTORE" -keypath "$PASSWORD" bin/DemoActivity-unsigned.apk $ALIAS && \ + zipalign 4 bin/DemoActivity-unsigned.apk ../$APP.apk && cd .. ) || exit 1 +done diff --git a/project/AndroidManifest.xml b/project/AndroidManifest.xml index d0e2f53ed..6ca59e8a4 100644 --- a/project/AndroidManifest.xml +++ b/project/AndroidManifest.xml @@ -1,8 +1,8 @@