[英]Is it possible for READ_EXTERNAL_STORAGE to give varying degrees of access, in Android 11 depending on the circumstance?
I have two apps, both do different things but both target sdk version 30, and request READ_EXTERNAL_STORAGE permission both in the manifest and during runtime.我有两个应用程序,它们都做不同的事情,但都针对 sdk 版本 30,并在清单和运行时请求 READ_EXTERNAL_STORAGE 权限。 Both are brand new and had not been installed on the device previously.两者都是全新的,之前没有安装在设备上。
Using a samsung phone running Android 11, I then checked the permission settings on both apps and discovered this discrepancy:使用运行 Android 11 的三星手机,然后我检查了两个应用程序的权限设置并发现了这种差异:
Is this possible?这可能吗? App #2 definitely does not ever request MANAGE_EXTERNAL_STORAGE, both of them only request the read permission which does work.应用程序 #2 绝对不会请求 MANAGE_EXTERNAL_STORAGE,它们都只请求有效的读取权限。 But App #2 has the same permissions to the system file manager, that clearly can't be right.但是 App #2 对系统文件管理器具有相同的权限,这显然是不对的。
Could it be that App #2 uses a library that uses MANAGE_EXTERNAL_STORAGE?难道 App #2 使用了一个使用 MANAGE_EXTERNAL_STORAGE 的库? You could compare the AndroidManifest of both apps after they are build.您可以在构建后比较两个应用程序的 AndroidManifest。 They are not always the same as the AndroidManifest that you wrote yourself for the app.它们并不总是与您为应用程序编写的 AndroidManifest 相同。 Libraries can define their own required permissions and that will get merged into the final AndroidManifest库可以定义自己所需的权限,并将合并到最终的 AndroidManifest 中
Found the issue.发现问题。 App #2 was built using androiddeployqt which for some reason was overriding the target sdk version I specified, so it was really an sdk level 28 app.应用程序 #2 是使用 androiddeployqt 构建的,出于某种原因,它覆盖了我指定的目标 sdk 版本,因此它实际上是一个 sdk 级别 28 应用程序。 I forced it to target the correct version and it now functions as expected.我强迫它以正确的版本为目标,现在它按预期运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.