GDBSafe mode that disables some dangerous operations
This commit is contained in:
parent
7c44e6451a
commit
6f5e809507
2 changed files with 16 additions and 3 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit b7627d1a64dc3307cddc57f7964abcac30ae13a3
|
Subproject commit 9558d126d551d41d09cbd1fb7b5712eec42f9508
|
|
@ -58,6 +58,7 @@ public class XashActivity extends Activity {
|
||||||
public static boolean mEnginePaused = false;
|
public static boolean mEnginePaused = false;
|
||||||
public static Vibrator mVibrator;
|
public static Vibrator mVibrator;
|
||||||
public static boolean fMouseShown = true;
|
public static boolean fMouseShown = true;
|
||||||
|
public static boolean fGDBSafe = false;
|
||||||
|
|
||||||
private static boolean mHasVibrator;
|
private static boolean mHasVibrator;
|
||||||
private int mReturingWithResultCode = 0;
|
private int mReturingWithResultCode = 0;
|
||||||
|
@ -445,7 +446,13 @@ public class XashActivity extends Activity {
|
||||||
String gamelibdir = getStringExtraFromIntent(intent, "gamelibdir", enginedir);
|
String gamelibdir = getStringExtraFromIntent(intent, "gamelibdir", enginedir);
|
||||||
String gamedir = getStringExtraFromIntent(intent, "gamedir", "valve");
|
String gamedir = getStringExtraFromIntent(intent, "gamedir", "valve");
|
||||||
String basedir = getStringExtraFromIntent(intent, "basedir", mPref.getString("basedir","/sdcard/xash/"));
|
String basedir = getStringExtraFromIntent(intent, "basedir", mPref.getString("basedir","/sdcard/xash/"));
|
||||||
|
String gdbsafe = intent.getStringExtra("gdbsafe");
|
||||||
|
if( gdbsafe != null )
|
||||||
|
fGDBSafe = true;
|
||||||
|
if( Debug.isDebuggerConnected() )
|
||||||
|
fGDBSafe = true;
|
||||||
|
if( fGDBSafe )
|
||||||
|
Log.e(TAG, "GDBSafe mode enabled!");
|
||||||
mArgv = argv.split(" ");
|
mArgv = argv.split(" ");
|
||||||
|
|
||||||
setenv("XASH3D_BASEDIR", basedir, true);
|
setenv("XASH3D_BASEDIR", basedir, true);
|
||||||
|
@ -788,6 +795,8 @@ public class XashActivity extends Activity {
|
||||||
|
|
||||||
public static void setIcon(String path)
|
public static void setIcon(String path)
|
||||||
{
|
{
|
||||||
|
if( fGDBSafe )
|
||||||
|
return;
|
||||||
Log.v(TAG,"setIcon("+path+")");
|
Log.v(TAG,"setIcon("+path+")");
|
||||||
if( sdk < 5 )
|
if( sdk < 5 )
|
||||||
return;
|
return;
|
||||||
|
@ -801,7 +810,7 @@ public class XashActivity extends Activity {
|
||||||
((NotificationManager) mSingleton.getApplicationContext()
|
((NotificationManager) mSingleton.getApplicationContext()
|
||||||
.getSystemService(Context.NOTIFICATION_SERVICE)).notify(100,XashService.notification);
|
.getSystemService(Context.NOTIFICATION_SERVICE)).notify(100,XashService.notification);
|
||||||
}
|
}
|
||||||
catch( Exception e)
|
catch( Exception e )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -942,6 +951,8 @@ class EngineSurface extends SurfaceView implements SurfaceHolder.Callback, View.
|
||||||
|
|
||||||
public void engineThreadWait()
|
public void engineThreadWait()
|
||||||
{
|
{
|
||||||
|
if( XashActivity.fGDBSafe )
|
||||||
|
return;
|
||||||
Log.v(TAG, "engineThreadWait()");
|
Log.v(TAG, "engineThreadWait()");
|
||||||
synchronized(mPauseLock)
|
synchronized(mPauseLock)
|
||||||
{
|
{
|
||||||
|
@ -958,6 +969,8 @@ class EngineSurface extends SurfaceView implements SurfaceHolder.Callback, View.
|
||||||
|
|
||||||
public void engineThreadNotify()
|
public void engineThreadNotify()
|
||||||
{
|
{
|
||||||
|
if( XashActivity.fGDBSafe )
|
||||||
|
return;
|
||||||
Log.v(TAG, "engineThreadNotify()");
|
Log.v(TAG, "engineThreadNotify()");
|
||||||
synchronized(mPauseLock)
|
synchronized(mPauseLock)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue