-
-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathandroiddeployqt_keystore_env.diff
More file actions
50 lines (48 loc) · 2.11 KB
/
Copy pathandroiddeployqt_keystore_env.diff
File metadata and controls
50 lines (48 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Description: Environment variables to control androiddeployqt behavior, see
comments added in the diff below.
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -405,6 +405,44 @@
{
Options options;
+ // Drawpile patch: Qt5 has no provisions to pass additional arguments
+ // to androiddeployqt through cmake and it expects you to dump passwords
+ // into the build files. Qt6 allows the use of these environment variables
+ // instead, so this is a backport of that functionality.
+ QByteArray keyStore = qgetenv("QT_ANDROID_KEYSTORE_PATH");
+ if (!keyStore.isEmpty()) {
+ options.keyStore = QString::fromLocal8Bit(keyStore);
+ }
+ QByteArray keyStoreAlias = qgetenv("QT_ANDROID_KEYSTORE_ALIAS");
+ if (!keyStoreAlias.isEmpty()) {
+ options.keyStoreAlias = QString::fromLocal8Bit(keyStoreAlias);
+ }
+ QByteArray keyStorePassword = qgetenv("QT_ANDROID_KEYSTORE_STORE_PASS");
+ if (!keyStorePassword.isEmpty()) {
+ options.keyStorePassword = QString::fromLocal8Bit(keyStorePassword);
+ }
+ QByteArray keyPass = qgetenv("QT_ANDROID_KEYSTORE_KEY_PASS");
+ if (!keyPass.isEmpty()) {
+ options.keyPass = QString::fromLocal8Bit(keyPass);
+ }
+ if(!options.keyStore.isEmpty() && !options.keyStoreAlias.isEmpty()) {
+ options.releasePackage = true;
+ }
+
+ // Drawpile patch: allow forcing release mode through environment
+ // variables. Needed for F-Droid, which wants an unsigned release artifact.
+ QByteArray packageMode = qgetenv("QT_ANDROID_PACKAGE_MODE");
+ if(!packageMode.isEmpty()) {
+ if(packageMode == QByteArrayLiteral("release")) {
+ options.releasePackage = true;
+ } else if(packageMode == QByteArrayLiteral("debug")) {
+ options.releasePackage = false;
+ } else {
+ fprintf(stderr, "Unrecognized package mode: %s\n", packageMode);
+ options.helpRequested = true;
+ }
+ }
+
QStringList arguments = QCoreApplication::arguments();
for (int i=0; i<arguments.size(); ++i) {
const QString &argument = arguments.at(i);