Sam*_*Sam 11 android android-11
Android R Preview 1 引入了一个名为QUERY_ALL_PACKAGES
. 许可文件如下:
允许查询设备上的任何普通应用程序,无论清单声明如何。
有没有人弄清楚这实际上是做什么的?
我已经尝试在模拟器映像上运行以下内容,并且该权限对其中任何一个都没有影响:
packageManager.queryIntentActivities(intent, 0)
packageManager.getInstalledPackages(0)
Com*_*are 11
DP2 发布后,他们对此进行了更多介绍。
引用我自己的话:
虽然我还没有测试 R DP2 的这方面,但一般来说,您的应用程序现在似乎无法找出安装了哪些其他应用程序。引用的例子是
queryIntentActivities()
,但要使其真正发挥作用,您需要认真进行脑白质切除术PackageManager
。您可以将某些包和某些<intent-filter>
结构列入白名单,以尝试在某些用例中解决此问题。而且,这就是QUERY_ALL_PACKAGES
DP1 中的神秘权限发挥作用的地方 - 该权限消除了这些新的限制。鉴于“寻找 Google Play 为需要此权限的应用程序提供指南”的警告,最安全的假设是,如果您尝试使用它,最终您将被机器人禁止进入 Play 商店。
因此,您可能想在 DP2 上重试您的实验。我计划在未来几周内做同样的事情。
小智 10
Android 11 introduced changes related to package visibility. These changes affect applications, only if they target Android 11 and above. For more information on these changes, please view the official documentation about package visibility on Android.
https://developer.android.com/training/package-visibility
https://developer.android.com/about/versions/11/privacy/package-visibility
In my case, it was Cordova Android v10.1.1, targetSdkVersion
= 30
I added
<queries>
<package android:name="com.google.android.gm" />
<package android:name="com.facebook.katana" />
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.DIAL" />
<data android:scheme="tel" />
</intent>
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
</intent>
</queries>
Run Code Online (Sandbox Code Playgroud)
to my AndroidManifest.xml
小智 9
即使QUERY_ALL_PACKAGES
添加了权限,您仍然需要<queries>
向您的AndroidManifest
.
例如,对于启动器应用程序,它可能是:
<permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
</intent>
</queries>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
13532 次 |
最近记录: |