diff options
author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2020-07-03 19:02:17 +0300 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-07-08 09:14:36 +0000 |
commit | fe4084150d010671ec998b3ef0549a474850560c (patch) | |
tree | d9bb2b38939e028cf3c9dc1bfd6e34c93df1a0c7 /src/android/jar/src | |
parent | e2265965083343aa85ce0eb33f8d7b0f4d4620bb (diff) |
Android: check for debug mode before fetching extraappparams
In pre Qt 5.14, the assets folder used to have the file
"--Added-by-androiddeployqt--/debugger.command", that indicate debug
mode, however, in Qt 5.14+ the assets are compressed into one file, so
this current check is obsolete. Qt Creator uses extraappparams to pass
QML debugger args, without it the debugger won't start.
Task-number: QTCREATORBUG-24155
Change-Id: Ib3037f4dc8c55af6932d598c6491a046efe13033
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
(cherry picked from commit eacf83594a5bf063665fdecc6c438673dc9f2cf6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/android/jar/src')
-rw-r--r-- | src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java | 12 |
1 files changed, 6 insertions, 6 deletions
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 613a2fefc6..4e4e32d9f9 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; @@ -694,12 +695,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 { @@ -717,6 +715,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(); } |