0xpr03 / VocableTrainer-Android

Vocabulary Trainer for Android - not lang specific
Apache License 2.0
29 stars 10 forks source link

File Import broken with recent android API #53

Closed 0xpr03 closed 2 years ago

0xpr03 commented 3 years ago

Describe the bug Recent android versions require the use of the MediaStore.Files system or applying MANAGE_EXTERNAL_STORAGE permissions. The current WRITE/READ_EXTERNAL_STORAGE permissions won't suffice as they only report media files (images,videos..), since those android changes.

The MediaStore system will apparently replace the file-navigation with some kind of index and removes the folder structure.

The latter one is restricted to a specific set of apps and thus should probably not be used. It may also require additional permissions-requests from the OS, though it works as a drop-in fix for the current system using appops set --uid vocabletrainer.heinecke.aron.vocabletrainer MANAGE_EXTERNAL_STORAGE allow.

To Reproduce Steps to reproduce the behavior:

  1. Create an API v30 emulator
  2. Drop a .csv file inside
  3. Try to import it
  4. File isn't visible in file chooser, directory doesn't report this file as existing for the app. File is visible in "Files" App.
Bennneeeet commented 3 years ago

Hi @0xpr03 are there any updates?

0xpr03 commented 3 years ago

I'll have to re-do the whole file selection, depending on the android version used, as the "manage external storage" permission won't even work any more on higher android versions.(Google really likes to change everything and it specifically doesn't like file interactions..) I'm currently implementing the DB 3.0, but I could first try to fix the file stuff.