From 6b1bd79e2fc40087f35d31d50f8b2943e229d967 Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Mon, 17 Dec 2018 23:41:24 +0200 Subject: [PATCH] OpenLieroX: fixed opening app from Chrome notification --- .../ballfield/AndroidAppSettings.cfg | 2 +- .../openlierox/AndroidAppSettings.cfg | 6 +++--- project/jni/application/openlierox/java.patch | 19 +++++++++++++------ .../jni/application/openlierox/project.patch | 13 +++++++++---- project/jni/application/openlierox/src | 2 +- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/project/jni/application/ballfield/AndroidAppSettings.cfg b/project/jni/application/ballfield/AndroidAppSettings.cfg index 65b292ea7..56ad0e328 100644 --- a/project/jni/application/ballfield/AndroidAppSettings.cfg +++ b/project/jni/application/ballfield/AndroidAppSettings.cfg @@ -67,7 +67,7 @@ SwVideoMode=y SdlVideoResize=y # Application resizing will keep 4:3 aspect ratio, with black bars at sides (y)/(n) -SdlVideoResizeKeepAspect=y +SdlVideoResizeKeepAspect=n # Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer InhibitSuspend=y diff --git a/project/jni/application/openlierox/AndroidAppSettings.cfg b/project/jni/application/openlierox/AndroidAppSettings.cfg index 2afd5597a..dff7bcbdd 100644 --- a/project/jni/application/openlierox/AndroidAppSettings.cfg +++ b/project/jni/application/openlierox/AndroidAppSettings.cfg @@ -7,10 +7,10 @@ AppName="OpenLieroX" AppFullName=openlierox.net # Application version code (integer) -AppVersionCode=10580525 +AppVersionCode=10580526 # Application user-visible version name (string) -AppVersionName="0.58rc5a25" +AppVersionName="0.58rc5a26" # 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 @@ -269,7 +269,7 @@ MultiABI='armeabi-v7a arm64-v8a x86 x86_64' # arm64-v8a x86 x86_64 # Optional shared libraries to compile - removing some of them will save space # MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed # Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2 -CompiledLibraries="sdl_image sdl_mixer xml2 curl gd jpeg vorbis ogg lzma mad" +CompiledLibraries="sdl_image sdl_mixer xml2 curl ssl crypto gd jpeg vorbis ogg lzma mad" # Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n) CustomBuildScript=n diff --git a/project/jni/application/openlierox/java.patch b/project/jni/application/openlierox/java.patch index dbfef06b0..91c852a9e 100644 --- a/project/jni/application/openlierox/java.patch +++ b/project/jni/application/openlierox/java.patch @@ -11,9 +11,9 @@ index 9e6150a..09ade66 100644 if( Globals.TouchscreenKeyboardTheme == 4 ) nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.retro)); if( Globals.TouchscreenKeyboardTheme == 5 ) ---- /dev/null 2018-04-10 21:06:44.327303421 +0300 -+++ b/project/java/RunFromOtherApp.java 2018-05-17 22:21:46.816651827 +0300 -@@ -0,0 +1,108 @@ +--- /dev/null 2018-12-13 18:37:19.876000065 +0200 ++++ Connect.java 2018-12-17 21:16:01.027001714 +0200 +@@ -0,0 +1,115 @@ +/* +Simple DirectMedia Layer +Java source code (C) 2009-2014 Sergii Pylypenko @@ -105,7 +105,7 @@ index 9e6150a..09ade66 100644 +import android.content.ComponentName; + + -+public class RunFromOtherApp extends Activity ++public class Connect extends Activity +{ + @Override + protected void onCreate(Bundle savedInstanceState) @@ -114,9 +114,16 @@ index 9e6150a..09ade66 100644 + + Intent main = new Intent(this, MainActivity.class); + main.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); -+ if( getIntent().getScheme() != null && getIntent().getScheme().equals("openlierox") ) ++ if( getIntent().getScheme() != null && getIntent().getScheme().equals("openlierox") && getIntent().getData() != null && getIntent().getData().getHost().equals("connect") ) + { -+ main.putExtra(RestartMainActivity.SDL_RESTART_PARAMS, getIntent().getData().getHost() + ":" + getIntent().getData().getPort()); ++ main.putExtra(RestartMainActivity.SDL_RESTART_PARAMS, getIntent().getData().getPath().replace("/","").replace("!",":")); ++ } ++ if( getIntent().getScheme() != null && getIntent().getScheme().equals("https") && getIntent().getData() != null && getIntent().getData().getPath().contains("connect") ) ++ { ++ if( getIntent().getData().getQueryParameter("a") != null ) ++ main.putExtra(RestartMainActivity.SDL_RESTART_PARAMS, getIntent().getData().getQueryParameter("a").replace("!",":")); ++ else ++ main.putExtra(RestartMainActivity.SDL_RESTART_PARAMS, getIntent().getData().getPath().replace("/connect/","").replace("!",":")); + } + startActivity(main); + finish(); diff --git a/project/jni/application/openlierox/project.patch b/project/jni/application/openlierox/project.patch index 429ee0549..4405f07ba 100644 --- a/project/jni/application/openlierox/project.patch +++ b/project/jni/application/openlierox/project.patch @@ -1,21 +1,26 @@ --- a/project/AndroidManifest.xml 2018-05-17 22:12:08.421817275 +0300 +++ a/project/AndroidManifest.xml 2018-05-17 22:14:05.186301554 +0300 -@@ -27,6 +27,19 @@ +@@ -27,6 +27,24 @@ -+ + -+ -+ + + ++ + + ++ ++ ++ ++ ++ ++ +