From edc024e826d41a98cb7779e9834e83d7ea5da171 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Wed, 10 Aug 2022 00:02:59 +0300 Subject: Android: handle quoted args passed to an app Currently, arguments passed to the app through applicationArguments extra bundle treat every space as an argument separator. This then doesn't handle the case where an argument is a space separated quoted multi-word. This is more apparent when androidtestrunner is passing test arguments to the app where an argument can be a test case with a data tag that contains a space, which then is treated as two separate tag names. This change makes sure that androidtestrunner quotes each argument, and the app doesn't split the arguments list by spaces, but rather passed the argument string directly to c++ where QProcess::splitCommand() is used to get the correct set of arguments that will be passed to main(). Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-104730 Change-Id: I45d8ca979d90f2a383c84623f0eb2eec29bba727 Reviewed-by: Dimitrios Apostolou Reviewed-by: Ville Voutilainen --- src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/android/java/src') diff --git a/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java b/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java index 66ba029ace..71595fb9fd 100644 --- a/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java +++ b/src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java @@ -399,7 +399,7 @@ public abstract class QtLoader { } if (appParams != null) - loaderParams.putString(APPLICATION_PARAMETERS_KEY, appParams.replace(' ', '\t').trim()); + loaderParams.putString(APPLICATION_PARAMETERS_KEY, appParams); loadApplication(loaderParams); return; -- cgit v1.2.3