我是 Android 新手,对 AndroidManifest.xml 中权限的保护级别“签名”有疑问。
Android 引用文档说明了“签名”保护级别:
A permission that the system grants only if the requesting application is signed with the same certificate as the application that declared the permission. If the certificates match, the system automatically grants the permission without notifying the user or asking for the user's explicit approval.
这意味着具有“签名”保护级别的权限不能被普通应用程序使用,只能由 Android 开发团队使用。
我想知道的是,Android Market 或其他网站上有多少应用程序可以拥有这些权限?就像用于通话录音的应用程序一样,除了其他权限外,还具有 android.permission.DEVICE_POWER。 Android系统真的在安装时给这个应用授予了这个权限吗?
当我尝试使用权限“READ_INPUT_STATE”(2.2 中的新功能)时,我在 LogCat 中收到以下错误:
06-28 09:28:34.943: WARN/PackageManager(60): 未授予 android.permission.READ_INPUT_STATE 权限以打包 com.example.wheredoyoulive (protectionLevel=2 flags=0x8444)
保护级别为“SignatureOrSystem”的权限也是如此。存在除其他权限外还具有 CALL_PRIVILEGED 权限的调用方应用程序。
请帮帮我,解开我的疑惑。
问候
阿布舍克
最佳答案
我相信“签名”权限级别的目的是让同一开发人员的两个应用程序能够无缝共享数据而不会打扰用户。 READ_INPUT_STATE 权限不适用于应用程序:
Allows an application to retrieve the current state of keys and switches. This is only for use by the system.
参见 http://developer.android.com/reference/android/Manifest.permission.html#READ_INPUT_STATE
关于android - 关于安卓权限和签名保护级别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3129996/