From 657797f7a06de9c5297952896421fc94a360b848 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 18 Nov 2014 12:08:31 +0100 Subject: [PATCH] Android: Fix installing signed packages This works around missing support for standalone installations of signed packages in androiddeployqt. The tool will use its arguments to decide what the package to install is named, so the arguments need to match the ones used to build the package. In particular, we need to tell it that we are creating a signed package. This is intended as a temporary solution. The tool should be fixed to support this use case properly, but the changes needed there were deemed too risky at this point in the release cycle, so we apply the work-around for now. Task-number: QTCREATORBUG-13431 Change-Id: I03163582979715e7daa389c49bf10a88b5879db7 Reviewed-by: Daniel Teske Reviewed-by: BogDan Vatra --- src/plugins/android/androiddeployqtstep.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index 82ad8929f4e..8f0d6d512fd 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -258,6 +258,16 @@ bool AndroidDeployQtStep::init() } if (androidBuildApkStep->useGradle()) Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("--gradle")); + + if (androidBuildApkStep->signPackage()) { + // The androiddeployqt tool is not really written to do stand-alone installations. + // This hack forces it to use the correct filename for the apk file when installing + // as a temporary fix until androiddeployqt gets the support. Since the --sign is + // only used to get the correct file name of the apk, its parameters are ignored. + Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("--sign")); + Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("foo")); + Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("bar")); + } } else { m_uninstallPreviousPackageRun = true; pp->setCommand(AndroidConfigurations::currentConfig().adbToolPath().toString());