【发布时间】:2021-07-08 15:21:57
【问题描述】:
我正在使用 Android Management API 来获取应用权限列表。
API:https://developers.google.com/android/management/reference/rest/v1/enterprises.applications/get
它返回与我们请求的应用程序关联的所有权限,没有任何分类(如运行时、正常、特殊等)。
我想从提供的响应中仅过滤掉运行时权限。
有没有什么方法可以获取权限详细信息以及它在 Android Management API 中的权限类型?
我为 Gmail 应用获取的示例数据:
{
"name": "enterprises/xxxxxxxxxx/applications/com.google.android.gm",
"title": "Gmail",
"permissions": [
{
"permissionId": "android.permission.BLUETOOTH",
"name": "pair with Bluetooth devices",
"description": "Allows the app to view the configuration of Bluetooth on the device, and to make and accept connections with paired devices."
},
{
"permissionId": "android.permission.CALL_PHONE",
"name": "directly call phone numbers",
"description": "Allows the app to call phone numbers without your intervention. This may result in unexpected charges or calls. Note that this doesn't allow the app to call emergency numbers. Malicious apps may cost you money by making calls without your confirmation."
},
{
"permissionId": "android.permission.CAMERA",
"name": "take pictures and videos",
"description": "Allows the app to take pictures and videos with the camera. This permission allows the app to use the camera at any time without your confirmation."
},
{
"permissionId": "android.permission.USE_CREDENTIALS",
"name": "use accounts on the device",
"description": "Allows the app to request authentication tokens."
},
{
"permissionId": "android.permission.WRITE_CONTACTS",
"name": "modify your contacts",
"description": "Allows the app to modify the data about your contacts stored on your device, including the frequency with which you've called, emailed, or communicated in other ways with specific contacts. This permission allows apps to delete contact data."
},
{
"permissionId": "com.google.android.providers.gsf.permission.READ_GSERVICES",
"name": "read Google service configuration",
"description": "Allows this app to read Google service configuration data."
},
{
"permissionId": "com.google.android.voicesearch.AUDIO_FILE_ACCESS"
}
]
}
【问题讨论】: