android - 签名保护级别 - 澄清

标签 android android-permissions

<分区>

由于我是Android的新手,我想问一些我不太清楚的问题。我读了API guide考虑到这个主题,关于权限的问题还有很多问答,不过,我不确定我是否理解正确。所以,签名保护级别是:

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 API 中定义的所有权限并具有此类保护级别?

最佳答案

Does this mean that I am not able to use any permission with 'signature' protection level, so all permissions defined in the Android's API and having such protection level are unavailable to anyone, apart the team which is developing it?

一般来说,是的。

更具体地说,一个 signature -level 权限意味着应用程序使用该权限(例如,通过 android:permission 属性)保护自己,并且应用程序试图与第一个需要权限的应用程序(<uses-permission> 元素)通信必须由相同的签名 key 签名。

如果保护自身的应用程序是设备固件的一部分,或者是操作系统本身,则只有使用与该固件相同的签名 key 签名的应用程序才能通过持有权限与防御应用程序通信。

但是,如果编写的应用程序 A 使用 signature 来保护自己-级权限(例如,自定义权限),并且编写的应用程序 B 想要与应用程序 A 的 protected 部分对话,你可以这样做,如果你正在签署应用程序 A 和应用程序 B相同的签名 key 。

关于android - 签名保护级别 - 澄清,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21438129/

相关文章:

android - 编译时无法打开数据库文件(代码 14): ,:PRAGMA journal_mode

android - 在Android中授予应用程序权限时是否有可能获得回调

javascript - Android相机权限请求不触发请求弹窗

android - 您可以在 Android Marshmallow (API 23) 的运行时权限模型中同步请求权限吗?

android - 使用 Intent 通过 Android jetpack 导航图传递数据

java - 从 getItem() 制作对象并访问字段

android - 在Amazon App Store和Android Market上提交Android应用程序?

C# 列表问题(Android/Monodroid ListView 搜索)

android - 我的 Android 应用程序需要我没有请求的权限

Android 11 用户无法授予后台位置权限?