multiple permissions in android:permisson

吃可爱长大的小学妹 提交于 2019-12-10 10:43:05

问题


I have a requirement to parse the AndroidManifest.xml of an app to find out what permissions a client app need to possess in order to communicate with this app. As per android developer guidelines the permission mentioned in the android:permission attribute of application tag and component (Activity, Service, Provider, Receiver) tag is supposed to be possessed by the client app. An example (AndroidManifest.xml excerpt) of this usage is

<application android:permission="android.permission.INTERNET">
    ...
</application>

In the aforementioned example, the client app should possess android.permission.INTERNET in order to communicate with this app.

My question is, this permission information is mentioned in the attribute of a tag. Hence I understand (I might be wrong) it is not possible to have more than one permission to be mentioned here. But it is quite possible that an app/ component could expect the client app/ component to possess more than one such a permission. For example, in the aforementioned case, the app could expect both android.permission.INTERNET and android.permission.ACCESS_WIFI_STATE permissions to be possessed by the client app. But there seems to be no room to specify this in the AndroidManifest.xml.

Please let me know whether it is possible to mandate the possession of more than one permission by a client app.


回答1:


Hence I understand (I might be wrong) it is not possible to have more than one permission to be mentioned here

Correct.

But there seems to be no room to specify this in the AndroidManifest.xml.

Correct.

I have a requirement to parse the AndroidManifest.xml of an app to find out what permissions a client app need to possess in order to communicate with this app

Technically, this is not possible, as apps can check for permissions at runtime (e.g., by calling checkCallingPermission()).



来源:https://stackoverflow.com/questions/18420994/multiple-permissions-in-androidpermisson

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!