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

fix: storage permission request for non-conforming devices #726

Merged
merged 5 commits into from
Jun 1, 2024

Conversation

mainrs
Copy link
Contributor

@mainrs mainrs commented Apr 29, 2024

Re-opened #645 due to me doing a wrong rebase.
Fixes #395.

I had the same issue with a news app I've programmed.

These devices run a custom Android OS that does not correctly implement the SAF. The FileProvider that is responsible for handling the OPEN_DOCUMENT_TREE Intent probably does not set the PERSISTABLE_URI flag. Thus, the call to takePersistableUriPermission fails with a SecurityException; no valid tickets are available.

This workaround gets the user passed the onboarding screen. I have tested this using manga I bought online and the default file path of /Mihon.

I want to note that, after selecting the file path during the onboarding experience, the app would still tell me No folder has been selected, but the next button was clickable. I think the issue is that the selected path is the default path, thus the validation logic assumes no (custom) path has been selected.

To make this work with @rpr13 's device, one would have to add the model name to the list.

@AntsyLich AntsyLich merged commit 8632ba8 into mihonapp:main Jun 1, 2024
1 check passed
@mainrs mainrs deleted the fix/storage-permission branch June 1, 2024 19:32
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash after selecting folder for mihon - ebook reader
2 participants