New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to retrieve the selected path on removable media #47
Comments
Yes it's an expected behavior. When you pick a file or a directory on Android, you get an URI. So DroidFS will try to extract a path from it, but if it's not a regular URI that point to a location in shared storage, it fails most of the time. Do you have a way to see what's the URI being retrieved when picking a folder on USB ? |
URI to GoCryptfs config on USB OTG: content://com.android.externalstorage.documents/document/4839-8D98%3Acppcryptfs%2Fgocryptfs.conf Interestingly, DroidFS is able to mount GoCryptfs volumes on external SD card. Copying the whole volume to my SD card allows the app to mount as read-only. URI is content://com.android.externalstorage.documents/document/EFFA-5B80%3Acppcryptfs%2Fgocryptfs.conf |
Awesome, how did you get this URIs ? |
URIs were collected by opening the directory in the "Files" (com.android.documentsui) app, which is used as the default document storage provider when selecting a volume path through DroidFS. Long-pressing any file in that directory and selecting the share sheet brings up a Clipboard option through MiXplorer, a file manager app I use more frequently than Files. The document storage URI can then be pasted to any text field. I would be a little unsure compiling from source, so test APKs would be appreciated. Thanks for working on this issue! My use case requires accessing encrypted storage from USB OTG. |
|
I have attached a logcat when selecting the OTG volume path and a logcat from selecting the volume on external SD card. |
That's what I thought, the USB-OTG device is not in the storage volume list that DroidFS can deduce a path from. Maybe a dirty string manipulation can do the trick... |
Thanks ! |
That's progress: Volume path can now be chosen over USB-OTG, but after entering the password and choosing open, an error is displayed:
Copying the volume to internal storage or external SD card permits mounting as normal. Logcat and screenshot are attached below. |
This is probably because Android doesn't allow DroidFS to access USB-OTG using raw file path. I built another debug APK that should confirm this:
|
Logcat from trying to mount from OTG with latest debug APK. |
Strange, it says that the path |
ls works for /storage/EFFA-5B80/ (external SD) but it's showing "No such file or directory" for /storage/9007-78F2/. Material Terminal screenshot here. I know EDS Lite allows mounting and even editing EncFS and other container formats from OTG, but unfortunately the app does not support gocryptfs. See workflow here. The container path used was |
OK so Android has a very strict policy concerning USB-OTG device access. Apps seems not allowed to use file paths with them. I read some part of the EDS Lite source code and it seems that the app only uses URI. Unfortunately, I don't see any solution except becoming root or rewrite the whole gocryptfs code to Kotlin/Android. I'm afraid that your USB device won't be accessible from DroidFS for a while... |
What about as a file manager using Ghost Commander (latest version from the Google Play store)? market://details?id=com.ghostsq.commander (Note-- be sure to use the Play Store, not fdroid, for latest version...) I did this on AndroidGO 8.1.0 to get the raw file access instead of the contentprovider URI. |
Android 10, DroidFS v1.5.4 here, still no dice using any of the path formats provided by GhostCommander. |
Hi, on SD cards, DroidFS can write under |
Hi. I don't know much about Android development but I hope this might be helpful. Android 11 introduced some changes in how storage is handled, including the option to access files per direct file path, as documented here Could DroidFS possibly take advantage of this new feature? |
Yes it's planned to use MANAGE_EXTERNAL_STORAGE but that's only available on Android 11+. |
Hello, I'm having the same issue in a Samsung A70. Is there any way to access the external USB key in this devices? Thanks |
Sorry for being a year late coming back to the party. On Android 10, DroidFS version 1.10.1, attempting to enter USB-OTG path The same path selected through storage access framework gives the error Failed to retrieve the selected path. In contrast to OTG devices, selecting the So it seems that on Android 10, OTG devices are still not compatible. Am I correct to interpret that OTG devices may work on Android 11+ when MANAGE_EXTERNAL_STORAGE is implemented in DroidFS? |
Thanks for your feedback. I don't know if it's going to work at all, but it's planned to be implemented for DroidFS v2.0.0 (stable). |
OTG volumes may now be mounted on latest 2.0.0 release! Read/write access works, no need to place volumes under /Android/data/sushi.hardcore.droidfs Tested on Galaxy S23/Android 13. |
I have read issue #47 and I thought usb otg is working since v2 but I still get this error "DroidFS doesn't have write access to this path. Please try another location" when I try to add a volume from the usb. I tried it both on android 11, 13 and it shows the same error. Thank you for the great app. |
What's your device model and ROM ? Make sure that DroidFS is granted "All files access" permission and that your drive is mounted read/write. Please show your logcat while reproducing the bug. |
I manage to make it work using v2.0.2 on android 13
I don't know why I need to close the app but it works when I do that. no luck on android 11 so I just update to 13. |
OK, that's weird. Can you please show your logcat of the bug? |
OS: Android 10
Device: Moto G5+
Platform: ARM64
DroidFS version: 1.5.2
Cannot select a path on removable 8GB exFAT flash drive connected via USB OTG. Attempting to choose the volume path on the flash drive shows "Error: Failed to retrieve the selected path".
The text was updated successfully, but these errors were encountered: