本文介绍了系统应用程序的Android运行时权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 有关Android运行时权限的问题. AFAIK,Android在运行时授予危险权限.我重置了手机,然后通过adb pull/data/system/users/0/runtime-permissions.xml,我发现android.ui.system已经授予了许多危险的权限.谁能告诉我它是怎么做的?解决方案插入/data/system/users/0/runtime-permissions.xml文件的noreferrer>危险的运行时权限仅适用于第三方应用程序,与内置应用程序无关.您可以看到 AndroidManifest.xml 来自AOSP,其中为系统组件编写了所有类型的必需权限.对于第三方应用程序,当用户授予任何运行时权限时,它将添加到文件/data/system/users/0/runtime-permissions.xml中.当用户从任何第三方应用程序撤消该权限时,该权限将从文件中删除.在完全恢复出厂设置的情况下,随着/data/system/users/0/runtime-permissions.xml被删除(数据分区擦除),所有第三方应用程序的运行时权限都将被删除.但是即使在恢复出厂设置后,/data/system/users/0/runtime-permissions.xml仍包含系统应用程序的运行时权限(甚至是危险的权限),请参阅默认权限: runtime-permissions.xml . 它的发生是因为: Question about Android runtime permissions. AFAIK, android grant dangerous permission at runtime. I reset my phone, then adb pull /data/system/users/0/runtime-permissions.xml, I found android.ui.system has already granted many dangerous permissions. can anybody tell me how it does? 解决方案 The mechanism to insert dangerous runtime permissions into the /data/system/users/0/runtime-permissions.xml file via a user-confirmed dialog applies only to third party applications, and is not relevant for built-in applications.You can see the AndroidManifest.xml from AOSP, where all types of required permissions are written for system components.For third party apps, when the user grants any runtime permission, it gets added into the file /data/system/users/0/runtime-permissions.xml. The permission gets removed from the file when the user revokes it from any third party app. In the case of a full factory reset, runtime permissions of all third party apps are removed, as /data/system/users/0/runtime-permissions.xml gets deleted (data partition wipe).But even after a factory reset, /data/system/users/0/runtime-permissions.xml contains runtime permissions (even dangerous ones) for system apps, see the default permissions: runtime-permissions.xml.And it happens because: 这篇关于系统应用程序的Android运行时权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-18 06:51
查看更多