Move '--sign' argument to the end of the androiddeployqt command

The '--sign' argument may and may not accept two follow arguments
to specify signing path and alias from the command line. This
functionality breaks the parsing of command line arguments that
follow the '--sign' argument and expect that '--sign' is used with
no follow arguments. It does make sense to check if the arguments
passed after the --sign staring with '--' to make sure that '--sign'
with no arguments is meant to be used.

Pick-to: 6.4 6.5
Fixes: QTBUG-109619
Change-Id: I4ee7fe953e5378c00760d84ec58f9e89e4348944
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Alexey Edelev 2022-12-23 13:54:28 +01:00
parent 644036b597
commit 9c56a77027
2 changed files with 10 additions and 3 deletions

View File

@ -475,8 +475,8 @@ function(qt6_android_add_apk_target target)
--apk "${apk_final_file_path}"
--depfile "${dep_file_path}"
--builddir "${relative_to_dir}"
${sign_apk}
${extra_args}
${sign_apk}
COMMENT "Creating APK for ${target}"
DEPENDS "${target}" "${deployment_file}" ${extra_deps}
DEPFILE "${dep_file_path}"
@ -493,9 +493,10 @@ function(qt6_android_add_apk_target target)
--input ${deployment_file}
--output ${apk_final_dir}
--apk ${apk_final_file_path}
${sign_apk}
${extra_args}
${sign_apk}
COMMENT "Creating APK for ${target}"
VERBATIM
)
endif()

View File

@ -428,6 +428,7 @@ Options parseOptions()
const QString storeAlias = qEnvironmentVariable("QT_ANDROID_KEYSTORE_ALIAS");
if (keyStore.isEmpty() || storeAlias.isEmpty()) {
options.helpRequested = true;
fprintf(stderr, "Package signing path and alias values are not specified.\n");
} else {
fprintf(stdout,
"Using package signing path and alias values found from the "
@ -435,9 +436,14 @@ Options parseOptions()
options.keyStore = keyStore;
options.keyStoreAlias = storeAlias;
}
} else {
} else if (!arguments.at(i + 1).startsWith("--"_L1) &&
!arguments.at(i + 2).startsWith("--"_L1)) {
options.keyStore = arguments.at(++i);
options.keyStoreAlias = arguments.at(++i);
} else {
options.helpRequested = true;
fprintf(stderr, "Package signing path and alias values are not "
"specified.\n");
}
// Do not override if the passwords are provided through arguments