diff --git a/buildozer/buildozer.spec b/buildozer/buildozer.spec index 19e488c1..c4dd8194 100644 --- a/buildozer/buildozer.spec +++ b/buildozer/buildozer.spec @@ -96,7 +96,7 @@ fullscreen = 1 # (list) Permissions #android.permissions = INTERNET -android.permissions = INTERNET, WRITE_EXTERNAL_STORAGE +android.permissions = WRITE_EXTERNAL_STORAGE, MANAGE_EXTERNAL_STORAGE # (list) features (adds uses-feature -tags to manifest) #android.features = android.hardware.usb.host @@ -269,6 +269,8 @@ android.enable_androidx = True # (list) The Android archs to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64 # In past, was `android.arch` as we weren't supporting builds for multiple archs at the same time. #android.archs = arm64-v8a, armeabi-v7a +#android.archs = x86 +#android.archs = x86_64 android.archs = armeabi-v7a # (int) overrides automatic versionCode computation (used in build.gradle) @@ -317,6 +319,7 @@ p4a.commit = v2023.02.10 # (str) python-for-android git clone directory (if empty, it will be automatically cloned from github) #p4a.source_dir = +#p4a.source_dir = /home/lb/SourcePackages/python-for-android/python-for-android # (str) The directory in which python-for-android should look for your own build recipes (if any) #p4a.local_recipes = diff --git a/buildozer/helpers/avdmanager b/buildozer/helpers/avdmanager new file mode 100755 index 00000000..ef512efc --- /dev/null +++ b/buildozer/helpers/avdmanager @@ -0,0 +1,5 @@ +#!/bin/sh +# Fake avdmanager. Runs in the context of a python-for-android build. +# (maybe useful in f-droid builds, do not use otherwise) +platforms=$(ls -1 $ANDROIDSDK/platforms +echo $platforms | sed -e "s/android-/\nAPI level: /g" diff --git a/buildozer/helpers/setapiforp4a b/buildozer/helpers/setapiforp4a new file mode 100755 index 00000000..24ff2151 --- /dev/null +++ b/buildozer/helpers/setapiforp4a @@ -0,0 +1,7 @@ +#!/bin/sh +# produces a fake avdmanager from buildozer settings +# may be useful with fdroid build scripts (outputs a fake avdmanager script) +echo "#!/bin/bash" +cat buildozer.spec | \ + grep -e "^android[.]api" | \ + sed -e "s/android.api\(.*\)/echo 'API level:\1'/" diff --git a/pysollib/kivy/androidperms.py b/pysollib/kivy/androidperms.py index 5c621627..57330215 100644 --- a/pysollib/kivy/androidperms.py +++ b/pysollib/kivy/androidperms.py @@ -57,14 +57,9 @@ class AndroidPerms(object): def getStoragePerm(): ap = AndroidPerms() - # print('Android API version: ', ap.version.SDK_INT) - logging.info("androidperms: API version %d" % (ap.version.SDK_INT)) - if ap.version.SDK_INT > 29: - return False return ap.getPerms( ["android.permission.WRITE_EXTERNAL_STORAGE"]) - def requestStoragePerm(): ap = AndroidPerms() logging.info("androidperms: API version %d" % (ap.version.SDK_INT))