[Android] Fix the ability to override environment and arguments

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>
This commit is contained in:
BogDan Vatra 2018-12-03 12:28:12 +02:00 committed by Jani Heikkinen
parent 61373dff50
commit 13ed06640c

View File

@ -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");