1
0

Merge pull request #10332 from SomberNight/202511_p4a_hacks

android build: update openssl, and switch cryptography->pycryptodomex
This commit is contained in:
ghost43
2025-12-11 17:47:52 +00:00
committed by GitHub
5 changed files with 28 additions and 6 deletions

View File

@@ -207,8 +207,8 @@ 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 electrum_20251211 (note: careful with force-pushing! see #8162)
RUN cd /opt \
&& git clone https://github.com/spesmilo/python-for-android \
&& cd python-for-android \

View File

@@ -76,7 +76,7 @@ requirements =
plyer,
libffi,
libsecp256k1,
cryptography,
pycryptodomex,
pyqt6sip,
pyqt6,
libzbar

View File

@@ -6,14 +6,14 @@ from pythonforandroid.util import load_source
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()

View File

@@ -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()

View File

@@ -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