summaryrefslogtreecommitdiff
path: root/src/tools/androiddeployqt/main.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-11 09:29:17 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-11 09:29:17 +0200
commit4ee4fc18b4067b90efa46ca9baba74f53b54d9ec (patch)
treecc68622c9b85992d99a8373ab55471ee821a4ebf /src/tools/androiddeployqt/main.cpp
parentab28ff2207e8f33754c79793089dbf943d67736d (diff)
parentebb49c66aaf22ed55d62ff7bc3690fce00b7d8ba (diff)
downloadqtbase-4ee4fc18b4067b90efa46ca9baba74f53b54d9ec.tar.gz
Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into tqtc/lts-5.15-opensourcev5.15.8-lts-lgpl
Change-Id: I569a2246c9e8d70430e8c5405b9f3df2218078ee
Diffstat (limited to 'src/tools/androiddeployqt/main.cpp')
-rw-r--r--src/tools/androiddeployqt/main.cpp45
1 files changed, 24 insertions, 21 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index 6ed6822038..de746d2eb4 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -2465,7 +2465,7 @@ QString packagePath(const Options &options, PackageType pt)
path += QLatin1String(".aab");
}
}
- return shellQuote(path);
+ return path;
}
bool installApk(const Options &options)
@@ -2592,9 +2592,10 @@ bool jarSignerSignPackage(const Options &options)
auto signPackage = [&](const QString &file) {
fprintf(stdout, "Signing file %s\n", qPrintable(file));
fflush(stdout);
- QString command = jarSignerTool + QLatin1String(" %1 %2")
- .arg(file)
- .arg(shellQuote(options.keyStoreAlias));
+ QString command = jarSignerTool
+ + QLatin1String(" %1 %2")
+ .arg(shellQuote(file))
+ .arg(shellQuote(options.keyStoreAlias));
FILE *jarSignerCommand = openProcess(command);
if (jarSignerCommand == 0) {
@@ -2640,10 +2641,10 @@ bool jarSignerSignPackage(const Options &options)
}
zipAlignTool = QLatin1String("%1%2 -f 4 %3 %4")
- .arg(shellQuote(zipAlignTool),
- options.verbose ? QLatin1String(" -v") : QLatin1String(),
- packagePath(options, UnsignedAPK),
- packagePath(options, SignedAPK));
+ .arg(shellQuote(zipAlignTool),
+ options.verbose ? QLatin1String(" -v") : QLatin1String(),
+ shellQuote(packagePath(options, UnsignedAPK)),
+ shellQuote(packagePath(options, SignedAPK)));
FILE *zipAlignCommand = openProcess(zipAlignTool);
if (zipAlignCommand == 0) {
@@ -2708,10 +2709,11 @@ bool signPackage(const Options &options)
return pclose(zipAlignCommand) == 0;
};
- const QString verifyZipAlignCommandLine = QLatin1String("%1%2 -c 4 %3")
- .arg(shellQuote(zipAlignTool),
- options.verbose ? QLatin1String(" -v") : QLatin1String(),
- packagePath(options, UnsignedAPK));
+ const QString verifyZipAlignCommandLine =
+ QLatin1String("%1%2 -c 4 %3")
+ .arg(shellQuote(zipAlignTool),
+ options.verbose ? QLatin1String(" -v") : QLatin1String(),
+ shellQuote(packagePath(options, UnsignedAPK)));
if (zipalignRunner(verifyZipAlignCommandLine)) {
if (options.verbose)
@@ -2728,11 +2730,12 @@ bool signPackage(const Options &options)
if (options.verbose)
fprintf(stdout, "APK not aligned, aligning it for signing.\n");
- const QString zipAlignCommandLine = QLatin1String("%1%2 -f 4 %3 %4")
- .arg(shellQuote(zipAlignTool),
- options.verbose ? QLatin1String(" -v") : QLatin1String(),
- packagePath(options, UnsignedAPK),
- packagePath(options, SignedAPK));
+ const QString zipAlignCommandLine =
+ QLatin1String("%1%2 -f 4 %3 %4")
+ .arg(shellQuote(zipAlignTool),
+ options.verbose ? QLatin1String(" -v") : QLatin1String(),
+ shellQuote(packagePath(options, UnsignedAPK)),
+ shellQuote(packagePath(options, SignedAPK)));
if (!zipalignRunner(zipAlignCommandLine)) {
fprintf(stderr, "zipalign command failed.\n");
@@ -2757,8 +2760,7 @@ bool signPackage(const Options &options)
if (options.verbose)
apkSignerCommandLine += QLatin1String(" --verbose");
- apkSignerCommandLine += QLatin1String(" %1")
- .arg(packagePath(options, SignedAPK));
+ apkSignerCommandLine += QLatin1String(" %1").arg(shellQuote(packagePath(options, SignedAPK)));
auto apkSignerRunner = [&] {
FILE *apkSignerCommand = openProcess(apkSignerCommandLine);
@@ -2785,8 +2787,9 @@ bool signPackage(const Options &options)
if (!apkSignerRunner())
return false;
- apkSignerCommandLine = QLatin1String("%1 verify --verbose %2")
- .arg(shellQuote(apksignerTool), packagePath(options, SignedAPK));
+ apkSignerCommandLine =
+ QLatin1String("%1 verify --verbose %2")
+ .arg(shellQuote(apksignerTool), shellQuote(packagePath(options, SignedAPK)));
// Verify the package and remove the unsigned apk
return apkSignerRunner() && QFile::remove(packagePath(options, UnsignedAPK));