android / storage-samples

Multiple samples showing the best practices in storage APIs on Android.
Apache License 2.0
1.53k stars 576 forks source link

All the URI returned by system chooser can be read without any permissions? #302

Open oOJohn6Oo opened 2 years ago

oOJohn6Oo commented 2 years ago

In the module ActionOpenDocument, there's no PERMISSIONS declared in AndroidManifest.xml.

Does that mean we have the access to all URI returned by system chooser? Like Intent.ACTION_PICK, Intent.ACTION_GET_CONTENT,Intent.ACTION_OPEN_DOCUMENT etc.

I can not find any official info about this.

What I've implemented is choose an image from gallery then set it to an ImageView. Tested on several devices it works fine. (Pixel 3 Android 12, Samsung S8 Android 7, ...) Only one Chinese Model(Android 8.1) crashed and reported SecurityException.