android - 关于安卓权限和签名保护级别

标签 android permissions

我是 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/

相关文章:

android - 字节数组到二维数组

php - 如何修复错误 "Fatal error: Uncaught --> Smarty: unable to write file"?

security - Jenkins 基于用户的工作保障

android - 通过主题应用 buttonStyle 不起作用,直接应用完美

java - 如何将数据从 fragment 发送到 fragment ?

android - 我的 Android 智能手机无法从我的 Apache 服务器下载 apk,这是 Mime 类型的问题吗?

android - 在 Android 浏览器中仅使用 HTML 和 CSS 的上拉工具栏

PHP 无法在 Mac 上写入 sys_get_temp_dir()

c# - Xamarin Forms 从 PCL 请求互联网许可 Android 6

android - 如何检查是否授予 "android.permission.PACKAGE_USAGE_STATS"权限?