From ed2e963a15aa25bea500d30240151a44245e83d7 Mon Sep 17 00:00:00 2001
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Date: Fri, 21 Nov 2014 15:01:38 +0100
Subject: [PATCH] Android: Fix deployment of release builds with Qt 5.3 and
 earlier

Since unsigned packages are not deployable, we always make
packages signed with the debug key when there's no signing requested,
even if the native code is built as release. This was already
fixed for Qt 5.4, where we use androiddeployqt to deploy the apk,
but for earlier versions, we need to use the correct apk name.
We also need to use the apk name which is used by androiddeployqt
in Qt 5.3, which does not contain the "-signed" suffix.

Change-Id: I87f7936002946acd80bc245935c44cf148f9630d
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
---
 src/plugins/android/androidqtsupport.cpp | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/plugins/android/androidqtsupport.cpp b/src/plugins/android/androidqtsupport.cpp
index 6f99c57b924..a8d2f21d466 100644
--- a/src/plugins/android/androidqtsupport.cpp
+++ b/src/plugins/android/androidqtsupport.cpp
@@ -51,17 +51,11 @@ Utils::FileName Android::AndroidQtSupport::apkPath(ProjectExplorer::Target *targ
         apkPath = QLatin1String("/build/outputs/apk/android-build-");
     else
         apkPath = QLatin1String("/bin/QtApp-");
-    if (buildApkStep->buildConfiguration()->buildType() == ProjectExplorer::BuildConfiguration::Release) {
-        apkPath += QLatin1String("release-");
-        if (!buildApkStep->signPackage())
-            apkPath += QLatin1String("un");
-        apkPath += QLatin1String("signed.apk");
-    } else {
-        apkPath += QLatin1String("debug");
-        if (buildApkStep->signPackage())
-            apkPath += QLatin1String("-signed");
-        apkPath += QLatin1String(".apk");
-    }
+    if (buildApkStep->signPackage())
+        apkPath += QLatin1String("release.apk");
+    else
+        apkPath += QLatin1String("debug.apk");
+
     return target->activeBuildConfiguration()->buildDirectory()
             .appendPath(QLatin1String(Android::Constants::ANDROID_BUILDDIRECTORY))
             .appendPath(apkPath);
-- 
GitLab