termux / termux-api-package

Termux package containing scripts to call functionality in Termux:API.
MIT License
994 stars 314 forks source link

termux-saf-managedir doesn't open a folder selection screen, it just hangs #181

Closed zavocc closed 6 months ago

zavocc commented 6 months ago

Problem description I'm trying to manage folders through SAF, however termux-saf-managedir doesn't seem to show a folder selection screen. It just hangs without showing anything.

Steps to reproduce

termux-api-start
termux-saf-managedir 

Disabled battery optimizations for both apps

Expected behavior I believe it should open documentsui folder picker

Additional information Post output of command termux-info. If you are rooted or have access to adb then capture a logcat with logcat -d "*:W, from a adb or root shell.

Logcat: logcat.txt

Termux-info:

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=14794
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main stable main
# x11-repo (sources.list.d/x11.list)
deb https://packages-cf.termux.dev/apt/termux-x11 x11 main
Updatable packages:
All packages up to date
termux-tools version:
1.40.4
Android version:
11
Kernel build information:
Linux localhost 4.14.180-perf+ #2 SMP PREEMPT Sat Sep 3 23:17:03 CST 2022 aarch64 Android
Device manufacturer:
OPPO
Device model:
CPH1933
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51
com.termux.styling versionCode:31
com.termux.widget versionCode:13
2096779623 commented 6 months ago

It works fine on my device(Android 14), tried checking permissions and installing termux-am .

2096779623 commented 6 months ago
~ $ termux-saf-rm -h
Usage: termux-saf-rm uri
Removes the file or folder at the given URI. See other termux-saf-* commands for more info.
Returns 0 on success, 1 if the file or folder couldn't be deleted and 2 if another error occurred.
 -h  show this help
~ $ termux-saf-rm content://com.android.externalstorage.documents/tree/primary%3AMT2/document/primary%3AMT2%2Faa
~ $

It returns nothing but the folder has been deleted successfully.

agnostic-apollo commented 6 months ago

SAF APIs are not available on F-Droid. Will be released along with termux app pre-release. Use GitHub builds instead.