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

Access to external storage will be soon denied #1291

Closed
daniele-athome opened this issue Mar 29, 2020 · 3 comments
Closed

Access to external storage will be soon denied #1291

daniele-athome opened this issue Mar 29, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@daniele-athome
Copy link
Member

daniele-athome commented Mar 29, 2020

Starting Android Q (API level 29) the OS will deny access to the external storage directory when using simple full path access. We'll start by adding requestLegacyExternalStorage to the manifest, but that will be forbidden in Android R. Switching to FileProvider should be enough for Android Q, but won't be for Android R.

https://developer.android.com/training/data-storage/shared/media#raw-file-paths
https://developer.android.com/preview/privacy/storage

  1. https://commonsware.com/blog/2019/03/25/death-external-storage-what-now.html
  2. https://commonsware.com/blog/2019/03/26/death-external-storage-can-haz-file.html
  3. https://commonsware.com/blog/2019/03/27/death-external-storage-stay-away-files.html
  4. https://commonsware.com/blog/2019/06/07/death-external-storage-end-saga.html
@daniele-athome daniele-athome added the enhancement New feature or request label Mar 29, 2020
daniele-athome added a commit that referenced this issue Mar 29, 2020
Signed-off-by: Daniele Ricci <daniele@casaricci.it>
@daniele-athome
Copy link
Member Author

requestLegacyExternalStorage doesn't work either... 😭

@daniele-athome daniele-athome self-assigned this Mar 29, 2020
@daniele-athome daniele-athome added this to the Next milestone Mar 29, 2020
daniele-athome added a commit that referenced this issue Mar 29, 2020
Same issue remains for other media types.

Signed-off-by: Daniele Ricci <daniele@casaricci.it>
daniele-athome added a commit that referenced this issue Mar 30, 2020
Signed-off-by: Daniele Ricci <daniele@casaricci.it>
daniele-athome added a commit that referenced this issue Mar 30, 2020
Signed-off-by: Daniele Ricci <daniele@casaricci.it>
daniele-athome added a commit that referenced this issue Mar 30, 2020
Signed-off-by: Daniele Ricci <daniele@casaricci.it>
daniele-athome added a commit that referenced this issue Mar 30, 2020
This will keep a copy of pictures taken with the camera app inside an
app-specific folder that can't be reached by an average user (you'll
need a file manager). In the future those pictures should be contributed
to the MediaStore.

Signed-off-by: Daniele Ricci <daniele@casaricci.it>
daniele-athome added a commit that referenced this issue Mar 30, 2020
Signed-off-by: Daniele Ricci <daniele@casaricci.it>
@daniele-athome
Copy link
Member Author

daniele-athome commented Mar 30, 2020

  • all files will be kept in the app-specific files dir
  • adding to MediaStore will be on-demand (like Signal does)
  • pictures shot from Kontalk will always be added to the MediaStore (breaking Signal behavior)
  • adding to MediaStore on API level < 29 will require permission
  • a few TODOs/FIXMEs to address before closing this

daniele-athome added a commit that referenced this issue Apr 2, 2020
Signed-off-by: Daniele Ricci <daniele@casaricci.it>
daniele-athome added a commit that referenced this issue Apr 3, 2020
…1291)

Signed-off-by: Daniele Ricci <daniele@casaricci.it>
daniele-athome added a commit that referenced this issue Apr 3, 2020
We don't need legacy external storage (it was never going to work anyway)

Signed-off-by: Daniele Ricci <daniele@casaricci.it>
daniele-athome added a commit that referenced this issue Apr 3, 2020
We are going to switch to internal storage for media soon

Signed-off-by: Daniele Ricci <daniele@casaricci.it>
daniele-athome added a commit that referenced this issue Apr 3, 2020
Following a Signal-like security model: user can publish content to the
MediaStore on demand

Signed-off-by: Daniele Ricci <daniele@casaricci.it>
daniele-athome added a commit that referenced this issue Apr 4, 2020
App doesn't ask for external storage permission on older versions though.
I still need to address that for API level < 29.

Signed-off-by: Daniele Ricci <daniele@casaricci.it>
daniele-athome added a commit that referenced this issue Apr 4, 2020
We are now ready to not ask for write external storage permission on API
level 29 (Android R). With scoped storage, MediaStore access will be
public so no need for a permission.
Read external storage permission will stay for the import messages
database function (that's still a debug feature anyway for now).

Signed-off-by: Daniele Ricci <daniele@casaricci.it>
@daniele-athome
Copy link
Member Author

Almost done! The last thing to do is on-demand export to public storage (MediaStore).

daniele-athome added a commit that referenced this issue Apr 5, 2020
Ready to implement on-demand publishing to MediaStore

Signed-off-by: Daniele Ricci <daniele@casaricci.it>
daniele-athome added a commit that referenced this issue Apr 5, 2020
#1291)

Signed-off-by: Daniele Ricci <daniele@casaricci.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant