aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-12-15 18:36:39 +0800
committerfanquake <fanquake@gmail.com>2021-12-15 18:37:15 +0800
commit965ffe2bed04b3c6683abd9bc9e05f00b1f1c0d4 (patch)
tree4221a4d42312ac24f89cde9241cd5c8b396153b1
parentb67115dd044d609559a40c27d159aeab3597b251 (diff)
parent27f353d8efca19bc2f7dc79b09d4737c9401a768 (diff)
Merge bitcoin/bitcoin#23757: [build] Android: fix GUI not loading on Qt 5.15
27f353d8efca19bc2f7dc79b09d4737c9401a768 build, android: Fix Android GUI not loading on Qt 5.15 (Igor Cota) 6fc5c772d47cca01968c451f070f997c9f7641e0 build, qt: use static QAndroidPlatformIntegrationPlugin (Igor Cota) Pull request description: PR moved from https://github.com/bitcoin-core/gui/pull/504 as it escaped the confines of `src/qt`. ACKs for top commit: hebasto: re-ACK 27f353d8efca19bc2f7dc79b09d4737c9401a768 promag: utACK 27f353d8efca19bc2f7dc79b09d4737c9401a768 Tree-SHA512: 4b6e6b2fb1923b89934f11caa8c05c6f340881689273f0c08916144e623f03fd5b781f1a53af83f6e87dce211fe02a1cb87e5943d13811c791cc8aa458184d9f
-rw-r--r--src/Makefile.qt.include3
-rw-r--r--src/Makefile.qttest.include2
-rw-r--r--src/qt/android/.gitignore4
-rw-r--r--src/qt/android/AndroidManifest.xml3
-rw-r--r--src/qt/android/res/values/libs.xml17
-rw-r--r--src/qt/bitcoin.cpp2
-rw-r--r--src/qt/test/test_main.cpp2
7 files changed, 26 insertions, 7 deletions
diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index 35d5b0004a..6c0e6f7c6f 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/Makefile.qttest.include b/src/Makefile.qttest.include
index 797e1f9a97..a0900f2691 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/android/.gitignore b/src/qt/android/.gitignore
index 74cf42f934..c090a2e98e 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 abb88fe89d..41615294e0 100644
--- a/src/qt/android/AndroidManifest.xml
+++ b/src/qt/android/AndroidManifest.xml
@@ -32,7 +32,8 @@
<meta-data android:name="android.app.background_running" android:value="true"/>
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="true"/>
<meta-data android:name="android.app.extract_android_style" android:value="default"/>
- </activity>
+ <meta-data android:name="android.app.load_local_libs_resource_id" android:resource="@array/load_local_libs"/>
+ </activity>
</application>
</manifest>
diff --git a/src/qt/android/res/values/libs.xml b/src/qt/android/res/values/libs.xml
new file mode 100644
index 0000000000..0f20df4eb0
--- /dev/null
+++ b/src/qt/android/res/values/libs.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <array name="load_local_libs">
+ <item>
+ arm64-v8a;libbitcoin-qt_arm64-v8a.so
+ </item>
+ <item>
+ armeabi-v7a;libbitcoin-qt_armeabi-v7a.so
+ </item>
+ <item>
+ x86_64;libbitcoin-qt_x86_64.so
+ </item>
+ <item>
+ x86;libbitcoin-qt_x86.so
+ </item>
+ </array>
+</resources>
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index 922aac531f..d22111ce44 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 e7a3d724bb..f6ab26d1d2 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