Android的权限和权限组之间的链路 [英] Link between Android Permissions and Permission Groups

查看:290
本文介绍了Android的权限和权限组之间的链路的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一个新的Andr​​oid开发。我一直在寻找在Android清单的权限。有两件事情。权限和权限组。我知道名单上

I an new to Android Development. I was looking at the android manifest permissions. There are two things. Permissions and Permission Groups. I know that the list at

http://developer.android.com/reference/android/Manifest。 permission.html

不是COM prehensive,你可以添加自己的权限为well.But,我想问的是这可能映射每个权限到在

is not comprehensive and you can add your own permission as well.But, I want to ask that is this possible to map each permission into the permission groups mentioned at

http://developer.android.com/reference/android/Manifest.permission_group.html.

推荐答案

Android的源代码包含了默认权限组和权限之间的实际映射。

The Android source contains the actual mappings between the default permission groups and permissions.

https://github.com/android/platform_frameworks_base/blob/master/core/res/AndroidManifest.xml

如果你想从权限组的映射允许你可以采取AndroidMainifest.xml文件的Andr​​oid您正在使用的版本,并解析XML创建映射。因此,要回答你的问题是有可能的,但它听起来像这可能是矫枉过正您的任务。

If you wanted a mapping from permission group to permission you could take AndroidMainifest.xml file for the version of Android you are working with and parse the XML to create the mapping. So to answer your question yes it is possible, but it sounds like this may be overkill for your task.

更新:因为我确实需要这种映射自己的另一个项目,我决定分享我的code创建这种映射。您可以在GitHub的资源库查看结果。

UPDATE: Because I actually needed this mapping myself for another project I decided to share my code to create this mapping. You can view the results in the github repository.

链接: https://github.com/benjholla/AndroidPermissionAttributeMapper

更新2:

我的组开源我们的解决方案,产生这种映射,并针对Android文档其他对象封装的权限。有项目页面和GitHub库的一些教程。

My group open sourced our solution that generates this mapping and some other object wrappers around Android documentation for permissions. There are some tutorials on the project page and the github repo.

项目页面: https://ensoftcorp.github.io/android-essentials-toolbox/

来源: https://github.com/EnSoftCorp/android-essentials-toolbox

这篇关于Android的权限和权限组之间的链路的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆