lfuelling / lrkFM

Awesome, (ad) free, open source file manager for Android
https://play.google.com/store/apps/details?id=io.lerk.lrkFM
MIT License
61 stars 10 forks source link

Can't navigate any files after granting storage permission, two empty entries #100

Open ioogithub opened 3 years ago

ioogithub commented 3 years ago

Describe the bug App is unusable, only one screen with two folders is displayed. There doesn't seem to be any way to get past this.

To Reproduce

  1. Install the app
  2. Open the app
  3. Click on the lock to grant permission
  4. Verify the app has permission for storage
  5. On the next screen only two entries:

emulated d-x self d-z

Both of these folders are empty. Is there some other way to grant storage permissions? Does this app require root?

Expected behavior The app would be usable

Smartphone (please complete the following information):

Additional context If I select a file and then open with IrkFM I get the same screen. There doesn't seem to be anything other than this screen. I tried this on a Moto G7 phone and got the same results.

lfuelling commented 3 years ago

Hi, this app does not require root. Unfortunately due to "security improvements" almost all directories are not readable in newer Android versions; according to Wikipedia, LineageOS 17 (assuming the numbers are switched) is Android 10 which is where this problem started occuring.

This issue is thus related to #69.

Currently I can not provide you with any help because at the moment I'm unsure whether I should add support for root (which would only help users on rooted devices) or fallback to the system file chooser on newer Android versions (or maybe both if I find the time).

What could maybe work is (since you run lineage) change the directory permissions where you want to use the app. But that's only speculation as I have no way of testing this. If you try this it's on your own risk.

ioogithub commented 3 years ago

Thanks, I did read that issue that you mentioned however the title was > 10 so that to me means Android 11. Really it should say >= 10 or some version of that notation.

ioogithub commented 3 years ago

I'm unsure whether I should add support for root (which would only help users on rooted devices) or fallback to the system file chooser on newer Android versions

I think this option would be the best.

In the meantime, are you aware of any other open source solutions for accessing 7zip or other archived files on Android?

lfuelling commented 3 years ago

Unfortunately I don't know any. One of the reasons I wrote lrkFM 🙈

As a workaround you can try "sharing" the file with lrkFM to open it (or open it from the system file chooser, should result in the same thing) but on newer versions of Android that's likely to return a content:// uri to the app which it can't handle right now. The problem with this is that you can only get the inputstream of a file behind a content URI and not any file objects. And all the libraries I use to extract archives only work with files, not with streams.

Rest assured that I'm on it and as soon as I find a way to get this to work I'll publish it.

ioogithub commented 3 years ago

This doesn't really work. I tried to share the file in the way you suggested but IrkFM is never on the list of apps that I can share the file with. I tried multiple different file types.

lfuelling commented 3 years ago

Oh, that's weird. The app is registered as being able to handle all files (*/* mime type) so it should open whn clicking on archives.

Regardless of that, I've found a way that might enable support for content URIs. I'll try it later today.

lfuelling commented 3 years ago

I got it working (only tested .7z files yet)! 🎉 I'll just make it a bit prettier and then release an update.

Concerning the "sharing" part, I was stupid. It's not "sharing" but the "Open with" action in the system file chooser context menu for selected files, sorry. Screenshot of an Android emulator showing the context menu for a selected file

lfuelling commented 3 years ago

The feature (among other things) was released as v2.4.0: https://github.com/lfuelling/lrkFM/releases/tag/v2.4.0

ioogithub commented 3 years ago

Wow Awesome!

Did you release this version to F-Droid as well? Any idea when it will be there? I would love to try it.

lfuelling commented 3 years ago

Yes, but I don't know how long it takes for the F-Droid repo to upgrade. If you're in a hurry you can simply install the apk attached to the release (which is the same the F-Droid repo will load once it updates).

ioogithub commented 3 years ago

I have installed version 2.4.0. Unfortunately this is still not working for me. I still see only two entries:

-emulated -self

When I tap on them I get:

"Unable to access files"

I have granted the storage permission

I think this is the same result as I got with the previous version.

lfuelling commented 3 years ago

Please try it using v2.5.0b2 which is using an older Android API still supporting legacy file access.

Additionally the navigation in the upper layers of the file system doesn't (and won't ever) work because of Android permissions. (Non-rooted) Apps can only properly access the /storage/emulated/0... and /sdcard directories and even those are becoming more limited in future Android versions.

The following works on the emaulator as well as my Pixel test device:

  1. Tap the main menu button in the top left when in the default "folder view"
  2. Tap the "Open Path" menu item
  3. Enter /sdcard, /storage/emulated/0 or similar and tap "Ok"
  4. The folder should be opened (if not try a different path)
  5. (optional) Open the main menu again and tap "Add Bookmark"
  6. (optional) Tap "Use current folder"
  7. (optional) The folder will be in the bookmark section of the main menu

If that doesn't work you it might be a customization by your device vendor. In that case you can try using the "Filesystem Explorer" in Android Studio to find a suitable path which you can set as the home directory in the app settings.

ioogithub commented 3 years ago

I have tried everything suggested in your last post. Manually typing the paths doesn't work, neither does the Add Bookmark solution. Thanks for the suggestions.