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: default avatarDaniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: default avatarBogDan Vatra <bogdan@kde.org>
parent cb30a1ae
......@@ -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");
}
apkPath += QLatin1String("release.apk");
else
apkPath += QLatin1String("debug.apk");
return target->activeBuildConfiguration()->buildDirectory()
.appendPath(QLatin1String(Android::Constants::ANDROID_BUILDDIRECTORY))
.appendPath(apkPath);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment