2013-07-20 35 views

回答

2

这是为什么?

某些权限要求您的应用程序由签署固件的相同签名密钥进行签名。

其他权限要求您的应用程序要么使用签署固件的相同签名密钥进行签名,要么将其安装在系统分区上(例如由有根设备的用户)。

普通的SDK应用程序无法拥有这些权限。不幸的是,JavaDocs没有解释哪些权限具有哪些要求。

如果你看一下the platform manifest,与signature这些权限作为其android:protectionLevel允许应用程序的一部分,以保持该权限如果他们由签署的固件相同的签名密钥签名。那些system作为android:protectionLevel的一部分可以由安装在系统分区中的应用程序持有。

因此,举例来说:

<!-- Required to be able to reboot the device. --> 
<permission android:name="android.permission.REBOOT" 
    android:label="@string/permlab_reboot" 
    android:description="@string/permdesc_reboot" 
    android:protectionLevel="signature|system" /> 

此权限可以通过签署在系统分区上安装固件相同的签名密钥签名的应用程序举行。

<!-- Required to be able to disable the device (very dangerous!). --> 
<permission android:name="android.permission.BRICK" 
    android:label="@string/permlab_brick" 
    android:description="@string/permdesc_brick" 
    android:protectionLevel="signature" /> 

此权限只能由签署固件的相同签名密钥签名的应用持有。

相关问题