我无法在我的应用程序上授予以下权限。请提出任何替代方案?

I cannot grant the following permission on my app..Kindly suggest any alternative?

<uses-permission android:name="android.permission.CALL_PRIVILEGED"/>

我无法在 android 清单文件中授予此权限,因为它显示以下内容 错误:

Permissions with the protection level signature or signatureOrSystem are only granted to system apps. If an app is a regular non-system app, it will never be able to use these permissions.

那么,我现在该怎么办?

要获得此 "CALL_PRIVILEGED" 权限,您需要一台已获得 root 权限的设备,并且该应用程序必须仅作为系统应用程序安装。

来自文档 (https://developer.android.com/reference/android/Manifest.permission.html#CALL_PRIVILEGED):

String CALL_PRIVILEGED
Allows an application to call any phone number, including emergency numbers, 
without going through the Dialer user interface for the user to confirm the 
call being placed.

Not for use by third-party applications.

所以,简短的回答是您不能使用它。你想完成什么?

Permissions with the protection level signature or signatureOrSystem are only granted to system apps. If an app is a regular non-system app, it will never be able to use these permissions.

So,what should i do now?

如果您的应用需要 运行 在非 root 设备上运行,那么您就完蛋了 - 您什么也做不了,除非您有平台密钥来为您的应用签名。

或者,您可以将受众范围缩小到仅获得 root 权限的设备,但这样您就可以随心所欲,包括。仅使用通常为平台或系统应用保留的功能。

最后你可能会重新考虑你的方法。也许你想做的事情可以通过其他方式实现,w/o 需要提升应用权限。