From 6fc5c772d47cca01968c451f070f997c9f7641e0 Mon Sep 17 00:00:00 2001 From: Igor Cota Date: Sun, 12 Dec 2021 08:15:06 +0100 Subject: [PATCH 1/2] build, qt: use static QAndroidPlatformIntegrationPlugin --- src/Makefile.qttest.include | 2 +- src/qt/bitcoin.cpp | 2 ++ src/qt/test/test_main.cpp | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 797e1f9a978..a0900f26911 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -52,7 +52,7 @@ if ENABLE_ZMQ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) endif qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \ - $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ + $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) \ $(QR_LIBS) $(BDB_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(LIBSECP256K1) \ $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(SQLITE_LIBS) qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 922aac531ff..d22111ce44b 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -65,6 +65,8 @@ Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin); #elif defined(QT_QPA_PLATFORM_COCOA) Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin); Q_IMPORT_PLUGIN(QMacStylePlugin); +#elif defined(QT_QPA_PLATFORM_ANDROID) +Q_IMPORT_PLUGIN(QAndroidPlatformIntegrationPlugin) #endif #endif diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp index e7a3d724bbe..f6ab26d1d27 100644 --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -34,6 +34,8 @@ Q_IMPORT_PLUGIN(QXcbIntegrationPlugin); Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); #elif defined(QT_QPA_PLATFORM_COCOA) Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin); +#elif defined(QT_QPA_PLATFORM_ANDROID) +Q_IMPORT_PLUGIN(QAndroidPlatformIntegrationPlugin) #endif #endif From 27f353d8efca19bc2f7dc79b09d4737c9401a768 Mon Sep 17 00:00:00 2001 From: Igor Cota Date: Sun, 12 Dec 2021 08:17:12 +0100 Subject: [PATCH 2/2] build, android: Fix Android GUI not loading on Qt 5.15 Qt 5.14 introduced certain breaking changes to the way it parses AndroidManifest.xml metadata https://lists.qt-project.org/pipermail/interest/2020-January/034372.html --- src/Makefile.qt.include | 3 +-- src/qt/android/.gitignore | 4 +--- src/qt/android/AndroidManifest.xml | 3 ++- src/qt/android/res/values/libs.xml | 17 +++++++++++++++++ 4 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 src/qt/android/res/values/libs.xml diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 35d5b0004a0..6c0e6f7c6f7 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -394,8 +394,7 @@ bitcoin_qt_apk: FORCE cp $(dir $(lastword $(CC)))../sysroot/usr/lib/$(host_alias)/libc++_shared.so $(APK_LIB_DIR) tar xf $(QT_BASE_PATH) -C qt/android/src/ $(QT_BASE_TLD)src/android/jar/src --strip-components=5 tar xf $(QT_BASE_PATH) -C qt/android/src/ $(QT_BASE_TLD)src/android/java/src --strip-components=5 - tar xf $(QT_BASE_PATH) -C qt/android/res/ $(QT_BASE_TLD)src/android/java/res --strip-components=5 - cp qt/bitcoin-qt $(APK_LIB_DIR)/libbitcoin-qt.so + cp qt/bitcoin-qt $(APK_LIB_DIR)/libbitcoin-qt_$(ANDROID_ARCH).so cd qt/android && gradle wrapper --gradle-version=6.6.1 cd qt/android && ./gradlew build diff --git a/src/qt/android/.gitignore b/src/qt/android/.gitignore index 74cf42f9349..c090a2e98ea 100644 --- a/src/qt/android/.gitignore +++ b/src/qt/android/.gitignore @@ -1,9 +1,7 @@ /.gradle /build -/gradle/wrapper +/gradle /gradlew* /libs -/res/layout -/res/values* /src/org/kde /src/org/qtproject diff --git a/src/qt/android/AndroidManifest.xml b/src/qt/android/AndroidManifest.xml index abb88fe89da..41615294e09 100644 --- a/src/qt/android/AndroidManifest.xml +++ b/src/qt/android/AndroidManifest.xml @@ -32,7 +32,8 @@ - + + diff --git a/src/qt/android/res/values/libs.xml b/src/qt/android/res/values/libs.xml new file mode 100644 index 00000000000..0f20df4eb05 --- /dev/null +++ b/src/qt/android/res/values/libs.xml @@ -0,0 +1,17 @@ + + + + + arm64-v8a;libbitcoin-qt_arm64-v8a.so + + + armeabi-v7a;libbitcoin-qt_armeabi-v7a.so + + + x86_64;libbitcoin-qt_x86_64.so + + + x86;libbitcoin-qt_x86.so + + +