关于Android的权限和签名防护等级防护、权限、等级、Android

2023-09-06 17:43:23 作者:メ扎眼的阳光

我是新来的Andr​​oid和有关于保护级别签名在AndroidManifest.xml中权限的问题。

I am new to Android and have a question regarding protection level "Signature" for permissions in AndroidManifest.xml.

关于签名保护级别Android的参考文件规定:

The Android reference document states about "Signature" protection level:

一个权限,系统只授予如果发出请求的应用   与相同的证书作为申报申请签约   的权限。如果证书匹配,则系统自动   授予的权限,并且不通知用户或请求的   用户的明确同意。

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的开发团队。

This implies that permissions which have protection level "Signature" are not available to use by normal application and can only be used Android Dev Team.

我想知道的是,有多少应用在Android Market中或在其他网站上可以拥有这些权限?等,其被用于记录呼叫的应用除了其他权限有android.permission.DEVICE_POWER。是Android系统的真正授予这个权限在此应用程序,同时安装吗?

What I am wondering about is that how many applications in Android Market or on other sites can have these permissions? Like an application which is used for recording calls has android.permission.DEVICE_POWER in addition to other permissions. Is Android system really granting this permission to this application while installation?

当我试图使用许可READ_INPUT_STATE(新增2.2)我得到了LogCat中出现以下错误:

When I tried to use the permission "READ_INPUT_STATE" (new in 2.2) I got the following error in LogCat:

9月6日至28号:28:34.943:WARN / PackageManager(60):未授予权限android.permission.READ_INPUT_STATE打包com.example.wheredoyoulive(的ProtectionLevel = 2标志= 0x8444)

06-28 09:28:34.943: WARN/PackageManager(60): Not granting permission android.permission.READ_INPUT_STATE to package com.example.wheredoyoulive (protectionLevel=2 flags=0x8444)

这同样适用于与防护等级SignatureOrSystem权限。存在已CALL_PRIVILEGED许可,除了其他权限的调用者的应用程序。

The same is true for permissions with Protection Level "SignatureOrSystem". There exists a caller application which has CALL_PRIVILEGED permission in addition to other permissions.

请帮助我,清楚我的疑惑。

Please help me and clear my doubts.

问候

阿布舍克

推荐答案

我相信签名权限级别的目的是为了两个应用程序由同一个开发商能够无缝地共享数据,而不会打扰用户。该READ_INPUT_STATE权限不打算在应用程序中使用:

I believe the purpose of the "Signature" permission level is for two applications by the same developer to be able to share data seamlessly without bothering the user. The READ_INPUT_STATE permission is not intended to be used in applications:

允许应用程序检索键和开关的当前状态。 这只是供系统使用。

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