From cfa052bc86fdb3c5dd26dae0a17d2eb686ab385f Mon Sep 17 00:00:00 2001 From: SomberNight Date: Sun, 30 Nov 2025 06:19:30 +0000 Subject: [PATCH] android build: switch from "cryptography" to "pycryptodomex" We had been using an ancient version of "cryptography" so far in our p4a fork, however it is not compatible with OpenSSL 3.0. (Previously we were building it with OpenSSL 1.1) Bumping "cryptography" is difficult, as building new versions of it from source requires a full rust toolchain. Instead, this commit switches to "pycryptodomex", as a replacement, which is much easier to build from source. --- contrib/android/buildozer_qml.spec | 2 +- .../android/p4a_recipes/pycryptodomex/__init__.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 contrib/android/p4a_recipes/pycryptodomex/__init__.py diff --git a/contrib/android/buildozer_qml.spec b/contrib/android/buildozer_qml.spec index e19bcac5a..75328a51e 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/pycryptodomex/__init__.py b/contrib/android/p4a_recipes/pycryptodomex/__init__.py new file mode 100644 index 000000000..0e0a580bf --- /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()