WRITE_EXTERNAL_STORAGE permission is not required

2020-07-18 10:46发布

I have stored image file into External Directory through Media store but it doesn't required permission for AndroidQ, even i have not mention permission in manifest.

compileSdkVersion 29

defaultConfig {
        minSdkVersion 21
        targetSdkVersion 29
    }

Note: Any application can store files on external storage without requesting permission to user, so is it break down security violation?

2条回答
欢心
2楼-- · 2020-07-18 11:24

An app that uses scoped storage always has read/write access to the files that it creates, both inside and outside its app-specific directory. As a result, if your app saves and accesses only the files that it creates, you don't need to request the READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE permission.

For more information - [here]

查看更多
Viruses.
3楼-- · 2020-07-18 11:25

The argument, as I understand it, is that with MediaStore you are only supposed to be able to write to a few locations, based on the media type. MediaStore is supposed to be validating that your request seems legitimate.

However, somebody (perhaps you?) suggested that IS_RELATIVE allows writing in arbitrary locations. If that were the case, then I would be much more concerned.

查看更多
登录 后发表回答