Skip to content
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

Can't access internal file system #6379

Closed
toiiggww opened this issue Jul 15, 2020 · 8 comments
Closed

Can't access internal file system #6379

toiiggww opened this issue Jul 15, 2020 · 8 comments
Labels
Android can't fix an issue that, by definition, cannot be fixed
Milestone

Comments

@toiiggww
Copy link

toiiggww commented Jul 15, 2020

  • KOReader version: 2020.06
  • Device:Sony z5p

Issue

Can't get sub folder for internal storage .
Screenshot_20200716-061338

@pazos
Copy link
Member

pazos commented Jul 16, 2020

Press the home button. It will return you to HOME.

The issue itself is not fixable but there are a few workarounds:

  • validate that the path is inside the sandbox before chdir using Device.isValidPath/android.isPathInsideSandbox
  • validate that the path is readable before chdir.

The first option is more restrictive and would prevent directory poping even on devices without that restriction. I remember @poire-z suggested the second option somewhere, but I cannot find the conversation.

@poire-z
Copy link
Contributor

poire-z commented Jul 16, 2020

I remember @poire-z suggested the second option somewhere, but I cannot find the conversation.

Might have been in #4885 (comment) :

when reaching an unreadable directory, and then just take an appropriate decision:
[...]
go down, just showing an empty list, or a fake item "directory unreadable", but still the "go up" item

@toiiggww
Copy link
Author

toiiggww commented Jul 16, 2020

This issue not exists in some previesion , maybe can review some code in history code to fix it. ref : #3365 , this time still can get the files and dirs.

@pazos
Copy link
Member

pazos commented Jul 17, 2020

Hi @toiiggww. We bumped the API from 14 to 28 and changed a lot of things. We aren't going to revert that!. Could you please explain what's the issue here?

@pazos pazos added the can't fix an issue that, by definition, cannot be fixed label Jul 17, 2020
@toiiggww
Copy link
Author

My android version is 7.1.1, maybe that is the reason.

@pazos
Copy link
Member

pazos commented Jul 17, 2020

Yeah, on some phones there are no restrictions. But for most devices what happens is:

  • You have RW permissions on the primary storage (that's /storage/emulated/0 if you primary storage is the internal partition and /storage/emulated/UUID if your primary storage is an external SD card).
  • If you navigate to the top dir of your primary partition you won't see any directory. You need to press the home button to go back to your home.
  • You can still access files outside the primary partition but not from KOReader. Use your favorite FM, go to somewhere outside your primary partition and open a file with the program. It will open fine. If you press the button to go to the FM you will be at the right directory. Remember that you don't have writable permissions outside the primary partition.
  • You can import files from any provider including, but not limited to, any storage providers. You can import documents only inside the primary storage by clicking the + button on the FM and clicking import here. You'll be prompted with a file picker and you can choose one or more supported files. These files will be copied to the current directory.

The workflow I would recommend would be:

  • setup the primary storage as you like. If you internal partition is tiny and you store most of your documents on a sdcard it could make sense to setup the primary storage as the sdcard. (This happens on android settings, not inside KOReader).
  • use an external program to open files outside the primary partition without importing them.
  • use import to ejem, import files from other content providers, like Dropbox, Google Drive or any other cloud provider.

@toiiggww
Copy link
Author

I've use + button saved a internal storage path, and can use it as a entry to explorer files.

@poire-z
Copy link
Contributor

poire-z commented Aug 29, 2020

Original issue fixed by 1st commit of #6593.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android can't fix an issue that, by definition, cannot be fixed
Projects
None yet
Development

No branches or pull requests

4 participants