diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index a7c5802c43..c8bf7dc534 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -45,6 +45,7 @@ import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.pm.ActivityInfo; +import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.AssetManager; @@ -711,12 +712,9 @@ public class QtActivityDelegate Bundle extras = m_activity.getIntent().getExtras(); if (extras != null) { try { - // do NOT remove !!!! - final String dc = "--Added-by-androiddeployqt--/debugger.command"; - new BufferedReader(new InputStreamReader(m_activity.getAssets().open(dc))).readLine(); - // do NOT remove !!!! - // The previous lines are needed to check if the debug mode is enabled. - // We are not allowed to use extraenvvars or extraappparams in a non debuggable environment. + final boolean isDebuggable = (m_activity.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; + if (!isDebuggable) + throw new Exception(); if (extras.containsKey("extraenvvars")) { try { @@ -734,6 +732,8 @@ public class QtActivityDelegate } } } catch (Exception e) { + Log.e(QtNative.QtTAG, "Not in debug mode! It is not allowed to use " + + "extra arguments in non-debug mode."); // This is not an error, so keep it silent // e.printStackTrace(); }