Allow listing / and /storage/emulated folders #352
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On (some?) non-rooted phones listing the
/
folder and the/storage/emulated
returns nothing. Related #279 #293 #299 #305First workaround is to let at least return an empty list, that's whyisReadable()
is changed toisExecutable()
.SecondThe workaround is more like a hack, because I couldn't find any way to list the root folders, though when I enter them directly (like/system
), they work fine in read-only mode. So I've added a way to fake/inject any folder listing if the OS doesn't list anything for us.Currently only the
/storage
and/storage/emulated/0
is faked (the others are commented out in the code). This is helpful for the "average" user, because at least there is a path to the internal and external storage throught clicking in eg. WinSCP, without direct knowledge of the Android file-system's structure.