openlierox: support openlierox:// data scheme

This commit is contained in:
Sergii Pylypenko
2018-05-17 22:41:24 +03:00
parent 5e0cf567cb
commit d7a074409e
5 changed files with 137 additions and 4 deletions

View File

@@ -7,10 +7,10 @@ AppName="OpenLieroX"
AppFullName=openlierox.net
# Application version code (integer)
AppVersionCode=10580418
AppVersionCode=10580421
# Application user-visible version name (string)
AppVersionName="0.58rc4a18"
AppVersionName="0.58rc4a21"
# 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

View File

@@ -11,3 +11,114 @@ 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 @@
+/*
+Simple DirectMedia Layer
+Java source code (C) 2009-2014 Sergii Pylypenko
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+package openlierox.net;
+
+import android.app.Activity;
+import android.app.Service;
+import android.content.Context;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.view.MotionEvent;
+import android.view.KeyEvent;
+import android.view.Window;
+import android.view.WindowManager;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+import android.widget.EditText;
+import android.text.Editable;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.FrameLayout;
+import android.graphics.drawable.Drawable;
+import android.graphics.Color;
+import android.content.res.Configuration;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.Intent;
+import android.view.View.OnKeyListener;
+import android.view.MenuItem;
+import android.view.Menu;
+import android.view.Gravity;
+import android.text.method.TextKeyListener;
+import java.util.LinkedList;
+import java.io.SequenceInputStream;
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.FileOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.zip.*;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+import java.util.Set;
+import android.text.SpannedString;
+import java.io.BufferedReader;
+import java.io.BufferedInputStream;
+import java.io.InputStreamReader;
+import android.view.inputmethod.InputMethodManager;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.os.Handler;
+import android.os.Message;
+import android.os.SystemClock;
+import java.util.concurrent.Semaphore;
+import android.content.pm.ActivityInfo;
+import android.view.Display;
+import android.util.DisplayMetrics;
+import android.text.InputType;
+import android.util.Log;
+import android.view.Surface;
+import android.app.ProgressDialog;
+import android.app.KeyguardManager;
+import android.view.ViewTreeObserver;
+import android.graphics.Rect;
+import android.net.Uri;
+import android.content.ComponentName;
+
+
+public class RunFromOtherApp extends Activity
+{
+ @Override
+ protected void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+
+ 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") )
+ {
+ main.putExtra(RestartMainActivity.SDL_RESTART_PARAMS, getIntent().getData().getHost() + ":" + getIntent().getData().getPort());
+ }
+ startActivity(main);
+ finish();
+ }
+}

View File

@@ -0,0 +1,22 @@
--- 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 @@
<category android:name="tv.ouya.intent.category.GAME" /> <!-- For that one user who still got an OUYA in his living room and won't throw it away just because someone else decides that it's dead -->
</intent-filter>
</activity>
+ <activity android:name=".RunFromOtherApp"
+ android:label="@string/app_name"
+ android:launchMode="standard"
+ android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection"
+ android:windowSoftInputMode="stateUnspecified">
+ <intent-filter>
+ <action android:name="android.intent.action.RUN" />
+ <action android:name="android.intent.action.MAIN" />
+ <action android:name="android.intent.action.VIEW" />
+ <category android:name="android.intent.category.DEFAULT"/>
+ <data android:scheme="openlierox"/>
+ </intent-filter>
+ </activity>
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" /> <!-- Samsung's multiwindow -->
<activity android:name=".RestartMainActivity"
android:label="@string/app_name"

View File

@@ -244,7 +244,7 @@ NDK_TOOLCHAIN_VERSION=clang
# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
# Available architectures: armeabi armeabi-v7a x86 mips arm64-v8a x86_64
MultiABI=armeabi-v7a # 'armeabi-v7a x86 arm64-v8a x86_64'
MultiABI=x86 # 'armeabi-v7a x86 arm64-v8a 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