summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kdab.com>2018-12-03 12:28:12 +0200
committerJani Heikkinen <jani.heikkinen@qt.io>2018-12-03 11:15:26 +0000
commit13ed06640c6cf32ea8c784c896c6bf017053edb3 (patch)
tree5356402611783dd58f456b8811cfd6b51b171b79
parent61373dff502fd222f68ed84c90bcc1822c4498e6 (diff)
[Android] Fix the ability to override environment and argumentsv5.12.0
This mechanism should only be enabled only for debug deployments, but the check was removed by accident in ca139228abdd522a76b2750aed607440568eb7f3. Fixes: QTBUG-72230 Fixes: QTBUG-72132 Change-Id: I3378436e93314fdf254919aed066f1284a4581b3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java7
1 files changed, 7 insertions, 0 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 8f218d34f0..74b515ef5b 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -674,6 +674,13 @@ 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.
+
if (extras.containsKey("extraenvvars")) {
try {
m_environmentVariables += "\t" + new String(Base64.decode(extras.getString("extraenvvars"), Base64.DEFAULT), "UTF-8");