forked from qt-creator/qt-creator
Android: set release flag when building and deploying apk
...in Release builds Signed Release builds are now deployed correctly by giving androiddeployqt the --release flag during the Deployment step for Release builds. Unsigned Release apks are now correctly built under the release directory by giving androiddeployqt the --release flag during the Build step for Release builds instead of determining build type from whether or not the package is signed. Fixes: QTCREATORBUG-28163 Change-Id: I319bc95325c88fb84a5997c9237df65eb7983c0e Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
@@ -608,14 +608,16 @@ bool AndroidBuildApkStep::init()
|
|||||||
if (m_buildAAB)
|
if (m_buildAAB)
|
||||||
arguments << "--aab" << "--jarsigner";
|
arguments << "--aab" << "--jarsigner";
|
||||||
|
|
||||||
|
if (buildType() == BuildConfiguration::Release) {
|
||||||
|
arguments << "--release";
|
||||||
|
}
|
||||||
|
|
||||||
QStringList argumentsPasswordConcealed = arguments;
|
QStringList argumentsPasswordConcealed = arguments;
|
||||||
|
|
||||||
if (m_signPackage) {
|
if (m_signPackage) {
|
||||||
arguments << "--release"
|
arguments << "--sign" << m_keystorePath.toString() << m_certificateAlias
|
||||||
<< "--sign" << m_keystorePath.toString() << m_certificateAlias
|
|
||||||
<< "--storepass" << m_keystorePasswd;
|
<< "--storepass" << m_keystorePasswd;
|
||||||
argumentsPasswordConcealed << "--release"
|
argumentsPasswordConcealed << "--sign" << "******"
|
||||||
<< "--sign" << "******"
|
|
||||||
<< "--storepass" << "******";
|
<< "--storepass" << "******";
|
||||||
if (!m_certificatePasswd.isEmpty()) {
|
if (!m_certificatePasswd.isEmpty()) {
|
||||||
arguments << "--keypass" << m_certificatePasswd;
|
arguments << "--keypass" << m_certificatePasswd;
|
||||||
|
@@ -261,6 +261,9 @@ bool AndroidDeployQtStep::init()
|
|||||||
|
|
||||||
m_androiddeployqtArgs.addArg("--gradle");
|
m_androiddeployqtArgs.addArg("--gradle");
|
||||||
|
|
||||||
|
if (buildType() == BuildConfiguration::Release)
|
||||||
|
m_androiddeployqtArgs.addArgs({"--release"});
|
||||||
|
|
||||||
if (androidBuildApkStep && androidBuildApkStep->signPackage()) {
|
if (androidBuildApkStep && androidBuildApkStep->signPackage()) {
|
||||||
// The androiddeployqt tool is not really written to do stand-alone installations.
|
// 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
|
// This hack forces it to use the correct filename for the apk file when installing
|
||||||
|
Reference in New Issue
Block a user