From ef404e3fc16ea132ad969f7acb730e78387da50e Mon Sep 17 00:00:00 2001 From: lufebe16 Date: Wed, 14 Dec 2022 10:46:37 +0100 Subject: [PATCH] Updates - android storage assignment - build instructions --- buildozer/build-instructions.txt | 8 +++++++- buildozer/buildozer.spec | 2 +- buildozer/src/manifest/extra_attributes.xml | 1 + pysollib/mfxutil.py | 6 ++++-- 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 buildozer/src/manifest/extra_attributes.xml diff --git a/buildozer/build-instructions.txt b/buildozer/build-instructions.txt index d8f8f288..8cf01dd9 100644 --- a/buildozer/build-instructions.txt +++ b/buildozer/build-instructions.txt @@ -78,4 +78,10 @@ test notes: 3) built apks worked on android 7 and android 8. (no newer devices had been available) -LB221118. +4) on fdroid, that provided a light weight build server + with debian bullseye the following additional packages had + to be installed (apt-get): + - ant autoconf build-essential ccache gettext imagemagick + - libffi-dev libltdl-dev libssl-dev libtool python3-tk + - virtualenv wget zlib1g-dev + diff --git a/buildozer/buildozer.spec b/buildozer/buildozer.spec index bf7d526c..c96cd2d3 100644 --- a/buildozer/buildozer.spec +++ b/buildozer/buildozer.spec @@ -151,7 +151,7 @@ android.api = 32 # (str) Extra xml to write directly inside the tag of AndroidManifest.xml # use that parameter to provide a filename from where to load your custom XML arguments: -#android.extra_manifest_application_arguments = ./src/android/extra_manifest_application_arguments.xml +android.extra_manifest_application_arguments = ./src/manifest/extra_attributes.xml # (str) Full name including package path of the Java class that implements Python Service # use that parameter to set custom Java class instead of PythonService diff --git a/buildozer/src/manifest/extra_attributes.xml b/buildozer/src/manifest/extra_attributes.xml new file mode 100644 index 00000000..a792c20c --- /dev/null +++ b/buildozer/src/manifest/extra_attributes.xml @@ -0,0 +1 @@ +android:requestLegacyExternalStorage="true" diff --git a/pysollib/mfxutil.py b/pysollib/mfxutil.py index fc16d983..bc5bdff7 100644 --- a/pysollib/mfxutil.py +++ b/pysollib/mfxutil.py @@ -140,10 +140,12 @@ def getprefdir(package): plat = get_platform() if plat == 'android': from pysollib.kivy.androidperms import getStoragePerm + from android.storage import primary_external_storage_path + from android.storage import app_storage_path if getStoragePerm(): - os.environ['HOME'] = '/sdcard' + os.environ['HOME'] = primary_external_storage_path() else: - os.environ['HOME'] = '.' + os.environ['HOME'] = app_storage_path() if os.name == "nt": return win32_getprefdir(package)