diff --git a/sbapp/buildozer.spec b/sbapp/buildozer.spec index 09f9530..04ab47f 100644 --- a/sbapp/buildozer.spec +++ b/sbapp/buildozer.spec @@ -10,7 +10,7 @@ source.exclude_patterns = app_storage/*,venv/*,Makefile,./Makefil*,requirements, version.regex = __version__ = ['"](.*)['"] version.filename = %(source.dir)s/main.py -android.numeric_version = 20241213 +android.numeric_version = 20241217 requirements = kivy==2.3.0,libbz2,pillow==10.2.0,qrcode==7.3.1,usb4a,usbserial4a,able_recipe,libwebp,libogg,libopus,opusfile,numpy,cryptography,ffpyplayer,codec2,pycodec2,sh,pynacl,typing-extensions diff --git a/sbapp/sideband/certgen.py b/sbapp/sideband/certgen.py index 70e4802..631a8b4 100644 --- a/sbapp/sideband/certgen.py +++ b/sbapp/sideband/certgen.py @@ -47,7 +47,11 @@ def get_key(key_path, force_reload=False): return LOADED_KEY elif os.path.isfile(KEY_PATH): with open(KEY_PATH, "rb") as f: - key = load_pem_private_key(f.read(), KEY_PASSPHRASE) + if cryptography_major_version > 3: + key = load_pem_private_key(f.read(), KEY_PASSPHRASE) + else: + from cryptography.hazmat.backends import default_backend + key = load_pem_private_key(f.read(), KEY_PASSPHRASE, backend=default_backend()) else: if cryptography_major_version > 3: key = ec.generate_private_key(curve=ec.SECP256R1()) @@ -87,6 +91,7 @@ def gen_cert(cert_path, key): cb = cb.not_valid_before(datetime.datetime.now(datetime.timezone.utc)+datetime.timedelta(days=-14)) cb = cb.not_valid_after(datetime.datetime.now(datetime.timezone.utc)+datetime.timedelta(days=3652)) cb = cb.add_extension(x509.SubjectAlternativeName([x509.DNSName("localhost")]), critical=False) + if cryptography_major_version > 3: cert = cb.sign(key, hashes.SHA256()) else: