diff --git a/changeAppSettings.sh b/changeAppSettings.sh index 64778975c..beebe5a7e 100755 --- a/changeAppSettings.sh +++ b/changeAppSettings.sh @@ -310,9 +310,12 @@ echo "# API is defined in file SDL_android.h: int SDL_ANDROID_OpenAudioRecording echo "# This option will add additional permission to Android manifest (y)/(n)" >> AndroidAppSettings.cfg echo AppRecordsAudio=$AppRecordsAudio >> AndroidAppSettings.cfg echo >> AndroidAppSettings.cfg -echo "# Application needs to access SD card. Always disable it, unless you want to access user photos and downloads. (y) / (n)" >> AndroidAppSettings.cfg +echo "# Application needs read/write access SD card. Always disable it, unless you want to access user photos and downloads. (y) / (n)" >> AndroidAppSettings.cfg echo AccessSdCard=$AccessSdCard >> AndroidAppSettings.cfg echo >> AndroidAppSettings.cfg +echo "# Application needs to read it's own OBB file. Enable this if you are using Play Store expansion files. (y) / (n)" >> AndroidAppSettings.cfg +echo ReadObbFile=$ReadObbFile >> AndroidAppSettings.cfg +echo >> AndroidAppSettings.cfg echo "# Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n)" >> AndroidAppSettings.cfg echo AccessInternet=$AccessInternet >> AndroidAppSettings.cfg echo >> AndroidAppSettings.cfg @@ -867,8 +870,15 @@ esac if [ "$AccessSdCard" = "y" ]; then $SEDI "/==NOT_EXTERNAL_STORAGE==/ d" project/AndroidManifest.xml + $SEDI "/==READ_OBB==/ d" project/AndroidManifest.xml else - $SEDI "/==EXTERNAL_STORAGE==/ d" project/AndroidManifest.xml # Disabled by default + if [ "$ReadObbFile" = "y" ]; then + $SEDI "/==EXTERNAL_STORAGE==/ d" project/AndroidManifest.xml # Disabled by default + $SEDI "/==NOT_EXTERNAL_STORAGE==/ d" project/AndroidManifest.xml + else + $SEDI "/==EXTERNAL_STORAGE==/ d" project/AndroidManifest.xml # Disabled by default + $SEDI "/==READ_OBB==/ d" project/AndroidManifest.xml + fi fi if [ "$AccessInternet" = "n" ]; then diff --git a/project/AndroidManifestTemplate.xml b/project/AndroidManifestTemplate.xml index e9bdddd2b..451250835 100644 --- a/project/AndroidManifestTemplate.xml +++ b/project/AndroidManifestTemplate.xml @@ -62,7 +62,10 @@ - + + + + diff --git a/project/java/Settings.java b/project/java/Settings.java index 06e097c38..2a9665eaa 100644 --- a/project/java/Settings.java +++ b/project/java/Settings.java @@ -660,6 +660,9 @@ public class Settings nativeSetEnv( "ANDROID_PACKAGE_PATH", p.getPackageCodePath() ); nativeSetEnv( "ANDROID_MY_OWN_APP_FILE", p.getPackageResourcePath() ); // This may be different from p.getPackageCodePath() on multi-user systems, but should still be the same .apk file nativeSetEnv( "ANDROID_OBB_DIR", Environment.getExternalStorageDirectory().getAbsolutePath() + "/Android/obb/" + p.getPackageName() ); + try { + nativeSetEnv( "ANDROID_OBB_DIR", p.getObbDir().getAbsolutePath() ); + } catch (Exception eeeeeee) {} try { nativeSetEnv( "ANDROID_APP_NAME", p.getString(p.getApplicationInfo().labelRes) ); } catch (Exception eeeeee) {} diff --git a/project/jni/application/supertux/AndroidAppSettings.cfg b/project/jni/application/supertux/AndroidAppSettings.cfg index f93e2307f..39e3e7b8d 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=05118 +AppVersionCode=05119 # Application user-visible version name (string) -AppVersionName="0.5.1.18" +AppVersionName="0.5.1.19" # 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, other downloads should be selected by user from startup config menu @@ -54,8 +54,8 @@ NeedGles2=n # you need this option only if you're developing 3-d app (y) or (n) NeedGles3= -# Use glshim library for provide OpenGL 1.x functionality to OpenGL ES accelerated cards (y) or (n) -UseGlshim= +# Use gl4es library for provide OpenGL 1.x functionality to OpenGL ES accelerated cards (y) or (n) +UseGl4es= # Application uses software video buffer - you're calling SDL_SetVideoMode() without SDL_HWSURFACE and without SDL_OPENGL, # this will allow small speed optimization. Enable this even when you're using SDL_HWSURFACE. (y) or (n) @@ -177,15 +177,21 @@ AppUsesMultitouch=n # This option will add additional permission to Android manifest (y)/(n) AppRecordsAudio=n -# Application needs to access SD card. Always disable it, unless you want to access user photos and downloads. (y) / (n) +# Application needs read/write access SD card. Always disable it, unless you want to access user photos and downloads. (y) / (n) AccessSdCard=n +# Application needs to read it's own OBB file. Enable this if you are using Play Store expansion files. (y) / (n) +ReadObbFile=y + # Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n) AccessInternet=y # Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n) ImmersiveMode=y +# Hide Android system mouse cursor image when USB mouse is attached (y) or (n) - the app must draw it's own mouse cursor +HideSystemMousePointer= + # Application implements Android-specific routines to put to background, and will not draw anything to screen # between SDL_ACTIVEEVENT lost / gained notifications - you should check for them # rigth after SDL_Flip(), if (n) then SDL_Flip() will block till app in background (y) or (n) @@ -222,9 +228,18 @@ RedefinedKeysScreenKbNames="Jump Action" TouchscreenKeysTheme=3 # Redefine gamepad keys to SDL keysyms, button order is: -# A B X Y L1 R1 L2 R2 LThumb RThumb +# A B X Y L1 R1 L2 R2 LThumb RThumb Start Select Up Down Left Right LThumbUp LThumbDown LThumbLeft LThumbRight RThumbUp RThumbDown RThumbLeft RThumbRight RedefinedKeysGamepad="SPACE LCTRL SPACE LCTRL SPACE LCTRL SPACE LCTRL SPACE LCTRL" +# Redefine keys for the second gamepad, same as the first gamepad if not set: +RedefinedKeysSecondGamepad="" + +# Redefine keys for the third gamepad, same as the first gamepad if not set: +RedefinedKeysThirdGamepad="" + +# Redefine keys for the fourth gamepad, same as the first gamepad if not set: +RedefinedKeysFourthGamepad="" + # How long to show startup menu button, in msec, 0 to disable startup menu StartupMenuButtonTimeout=3000 @@ -251,7 +266,7 @@ NDK_TOOLCHAIN_VERSION=clang APP_PLATFORM= # Specify architectures to compile, 'all' or 'y' to compile for all architectures. -# Available architectures: armeabi armeabi-v7a x86 mips arm64-v8a +# Available architectures: armeabi-v7a x86 mips arm64-v8a MultiABI='armeabi-v7a x86 x86_64 arm64-v8a' # Optional shared libraries to compile - removing some of them will save space @@ -263,13 +278,13 @@ CompiledLibraries="sdl_image boost_filesystem boost_system crypto ssl curl opena CustomBuildScript=n # Aditional CFLAGS for application -AppCflags='-DSUPERTUX_GLES=1 -Ijni/openal/include/AL -Ijni/boost/include -frtti -fexceptions -DHAVE_SDL=1 -O3' # -flto=thin +AppCflags='-DSUPERTUX_GLES=1 -Ijni/openal/include/AL -Ijni/boost/include -frtti -fexceptions -DHAVE_SDL=1 -O3' # Aditional C++-specific compiler flags for application, added after AppCflags AppCppflags='-std=gnu++11 -include limits' # Additional LDFLAGS for application -AppLdflags='-frtti -fexceptions -O3' # -flto=thin -flto-jobs=8 +AppLdflags='-frtti -fexceptions -O3' # If application has headers with the same name as system headers, this option tries to fix compiler flags to make it compilable AppOverlapsSystemHeaders=n @@ -299,3 +314,6 @@ AdmobBannerSize= # Google Play Game Services application ID, required for cloud saves to work GooglePlayGameServicesId= +# The app will open files with following extension, file path will be added to commandline params +AppOpenFileExtension='' +