diff --git a/contrib/android/Dockerfile b/contrib/android/Dockerfile index 74f53928e3ae..ea356ba20d40 100644 --- a/contrib/android/Dockerfile +++ b/contrib/android/Dockerfile @@ -207,10 +207,10 @@ RUN cd /opt \ && /opt/venv/bin/python3 -m pip install --no-build-isolation --no-dependencies -e . # install python-for-android -ENV P4A_CHECKOUT_COMMIT="003451604321deb1f10d879b63450ec76db4a758" -# ^ from branch electrum_20240930_android_16kb_page_alignment (note: careful with force-pushing! see #8162) +ENV P4A_CHECKOUT_COMMIT="e91310fbf88857b2fbd9f9a5f591300ae5da90b5" +# ^ from branch TODO xxxxx FIX git remote (note: careful with force-pushing! see #8162) RUN cd /opt \ - && git clone https://github.com/spesmilo/python-for-android \ + && git clone https://github.com/sombernight/python-for-android \ && cd python-for-android \ && git checkout "${P4A_CHECKOUT_COMMIT}^{commit}" \ && /opt/venv/bin/python3 -m pip install --no-build-isolation --no-dependencies -e . diff --git a/contrib/android/buildozer_qml.spec b/contrib/android/buildozer_qml.spec index e19bcac5abf9..75328a51e014 100644 --- a/contrib/android/buildozer_qml.spec +++ b/contrib/android/buildozer_qml.spec @@ -76,7 +76,7 @@ requirements = plyer, libffi, libsecp256k1, - cryptography, + pycryptodomex, pyqt6sip, pyqt6, libzbar diff --git a/contrib/android/p4a_recipes/openssl/__init__.py b/contrib/android/p4a_recipes/openssl/__init__.py index 3746e8cccdba..fdbb7d662978 100644 --- a/contrib/android/p4a_recipes/openssl/__init__.py +++ b/contrib/android/p4a_recipes/openssl/__init__.py @@ -6,14 +6,14 @@ util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py')) -assert OpenSSLRecipe._version == "1.1" +assert OpenSSLRecipe._version == "3.0.18" assert OpenSSLRecipe.depends == [] assert OpenSSLRecipe.python_depends == [] class OpenSSLRecipePinned(util.InheritedRecipeMixin, OpenSSLRecipe): - url_version = "1.1.1w" - sha512sum = "b4c625fe56a4e690b57b6a011a225ad0cb3af54bd8fb67af77b5eceac55cc7191291d96a660c5b568a08a2fbf62b4612818e7cca1bb95b2b6b4fc649b0552b6d" + version = "3.0.18" + sha512sum = "6bdd16f33b83ae2a12777230c4ff00d0595bbc00253ac8c3ac31e1375e818fc74d7f491bd2e507ff33cab9f0498cfb28fa8690f75a98663568d40901523cdf3c" recipe = OpenSSLRecipePinned() diff --git a/contrib/android/p4a_recipes/pycryptodomex/__init__.py b/contrib/android/p4a_recipes/pycryptodomex/__init__.py new file mode 100644 index 000000000000..0e0a580bfd5c --- /dev/null +++ b/contrib/android/p4a_recipes/pycryptodomex/__init__.py @@ -0,0 +1,15 @@ +from pythonforandroid.recipe import PythonRecipe + + +assert PythonRecipe.depends == ['python3'] +assert PythonRecipe.python_depends == [] + + +class PycryptodomexRecipe(PythonRecipe): + version = "3.23.0" + sha512sum = "951cebaad2e19b9f9d04fe85c73ab1ff8b515069c1e0e8e3cd6845ec9ccd5ef3e5737259e0934ed4a6536e289dee6aabac58e1c822a5a6393e86b482c60afc89" + url = "https://github.com/Legrandin/pycryptodome/archive/v{version}x.tar.gz" + depends = ["setuptools", "cffi"] + + +recipe = PycryptodomexRecipe() diff --git a/run_electrum b/run_electrum index e9b3ab86538a..3d75478c5b2d 100755 --- a/run_electrum +++ b/run_electrum @@ -100,6 +100,13 @@ if not is_android: check_imports() +if is_android: + # hack to make pycryptodomex work on Android + # from https://github.com/kivy/python-for-android/issues/1866#issuecomment-927157780 + import ctypes + ctypes.pythonapi = ctypes.PyDLL("libpython%d.%d.so" % sys.version_info[:2]) # replaces ctypes.PyDLL(None) + + sys._ELECTRUM_RUNNING_VIA_RUNELECTRUM = True # used by logging.py from electrum.logging import get_logger, configure_logging # import logging submodule first