From ce4d1967e8371aa5d75f3d580145d277495a0d5f Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 20 Oct 2022 21:32:40 +0200 Subject: [PATCH] Experimental support for armeabi-v7a and API level 24 --- sbapp/Makefile | 36 ++++++++++++++++++++++-------------- sbapp/buildozer.spec | 6 +++--- setup.py | 2 +- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/sbapp/Makefile b/sbapp/Makefile index 8a85433..456f56b 100644 --- a/sbapp/Makefile +++ b/sbapp/Makefile @@ -3,6 +3,7 @@ all: prepare debug prepare: activate cleanrns getrns clean: + @echo Cleaning... -(rm ./__pycache__ -r) -(rm ./app_storage -r) -(rm ./bin -r) @@ -18,30 +19,35 @@ activate: pacthfiles: patchsdl injectxml patchsdl: - cp patches/HIDDeviceUSB.java .buildozer/android/platform/build-arm64-v8a/build/bootstrap_builds/sdl2/jni/SDL/android-project/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java - cp patches/HIDDeviceUSB.java .buildozer/android/platform/build-arm64-v8a/dists/sideband/src/main/java/org/libsdl/app/HIDDeviceUSB.java - cp patches/HIDDeviceUSB.java .buildozer/android/platform/build-arm64-v8a/dists/sideband/jni/SDL/android-project/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java + # Pach USB HID behaviour + cp patches/HIDDeviceUSB.java .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni/SDL/android-project/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java + cp patches/HIDDeviceUSB.java .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/src/main/java/org/libsdl/app/HIDDeviceUSB.java + cp patches/HIDDeviceUSB.java .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/jni/SDL/android-project/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java + # Pach service loader cp patches/PythonService.java .buildozer/android/platform/python-for-android/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonService.java - cp patches/PythonService.java .buildozer/android/platform/build-arm64-v8a/build/bootstrap_builds/sdl2/src/main/java/org/kivy/android/PythonService.java - cp patches/PythonService.java .buildozer/android/platform/build-arm64-v8a/dists/sideband/src/main/java/org/kivy/android/PythonService.java + cp patches/PythonService.java .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/src/main/java/org/kivy/android/PythonService.java + cp patches/PythonService.java .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/src/main/java/org/kivy/android/PythonService.java injectxml: - mkdir -p .buildozer/android/platform/build-arm64-v8a/dists/sideband/src/main/res/xml - mkdir -p .buildozer/android/platform/build-arm64-v8a/dists/sideband/templates - cp patches/device_filter.xml .buildozer/android/platform/build-arm64-v8a/dists/sideband/src/main/res/xml/ - cp patches/AndroidManifest.tmpl.xml .buildozer/android/platform/build-arm64-v8a/dists/sideband/templates/ - + # Inject XML on arm64-v8a + mkdir -p .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/src/main/res/xml + mkdir -p .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/templates + cp patches/device_filter.xml .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/src/main/res/xml/ + cp patches/AndroidManifest.tmpl.xml .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/templates/ + debug: buildozer android debug prebake: -ifneq (,$(wildcard .buildozer/android/platform/build-arm64-v8a/dists/sideband/src/main/res/xml/device_filter.xml)) +ifneq (,$(wildcard .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/src/main/res/xml/device_filter.xml)) @echo Device filter XML exists, skipping prebake else + @(echo Prebaking build before patching files...) + @(sleep 2) -(buildozer android release) @(echo Prebake finished, applying patches and rebuilding...) - -(sleep 2) + @(sleep 2) endif release: @@ -58,13 +64,15 @@ version: @(echo $$(python ./gv.py)) install: - adb install bin/sideband-$$(python ./gv.py)-arm64-v8a-release.apk +# adb install bin/sideband-$$(python ./gv.py)-arm64-v8a-release.apk + adb install bin/sideband-$$(python ./gv.py)-arm64-v8a_armeabi-v7a-release.apk console: (adb logcat | grep "python\|sidebandservice") getrns: - (cp -rv ../../Reticulum/RNS ./;rm ./RNS/Utilities/RNS;rm ./RNS/__pycache__ -r) + (cp -rv ../../Reticulum/RNS ./;rm ./RNS/Utilities/RNS) + -(rm ./RNS/__pycache__ -r) cleanrns: -(rm ./RNS -r) diff --git a/sbapp/buildozer.spec b/sbapp/buildozer.spec index 8816120..0430310 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 = 20221019 +android.numeric_version = 20221020 requirements = python3==3.9.5,hostpython3==3.9.5,cryptography,cffi,pycparser,kivy==2.1.0,pygments,sdl2,sdl2_ttf==2.0.15,pillow,lxmf==0.2.0,netifaces,libbz2,pydenticon,usb4a,usbserial4a p4a.local_recipes = ../Others/python-for-android/pythonforandroid/recipes @@ -25,12 +25,12 @@ fullscreen = 0 android.permissions = INTERNET,POST_NOTIFICATIONS,WAKE_LOCK,FOREGROUND_SERVICE,CHANGE_WIFI_MULTICAST_STATE android.api = 30 -android.minapi = 27 +android.minapi = 24 android.ndk = 23b android.skip_update = False android.accept_sdk_license = True android.release_artifact = apk -android.archs = arm64-v8a +android.archs = arm64-v8a,armeabi-v7a #android.logcat_filters = *:S python:D services = sidebandservice:services/sidebandservice.py:foreground diff --git a/setup.py b/setup.py index 96f6a98..286791a 100644 --- a/setup.py +++ b/setup.py @@ -81,7 +81,7 @@ setuptools.setup( 'sideband=sbapp:main.run', ] }, - install_requires=['rns>=0.3.15', 'lxmf>=0.2.0', 'kivy==2.1.0', 'plyer', "pillow"], + install_requires=['rns>=0.3.16', 'lxmf>=0.2.0', 'kivy==2.1.0', 'plyer', "pillow"], extras_require={ "macos": ["pyobjus"], },