是否可以自动向预安装的 OS 应用程序授予危险权限?

Is it possible to automatically grant dangerous permissions to pre-installed OS apps?

假设一个应用程序需要 CAMERA 权限,并且我们将我们的应用程序提供给设备供应商以作为设备的一部分预安装在设备上 OS。是否可以在不询问用户的情况下自动授予此权限,例如这样做对于默认由 OS 提供的基本相机应用程序 ?

不,如果设备是 运行 Android 6.0(API 级别 23)并且应用的 targetSdkVersion 是 23 或更高,

The purpose of a permission is to protect the privacy of an Android user. Android apps must request permission to access sensitive user data (such as contacts and SMS), as well as certain system features (such as camera and internet). Depending on the feature, the system might grant the permission automatically or might prompt the user to approve the request.

A central design point of the Android security architecture is that no app, by default, has permission to perform any operations that would adversely impact other apps, the operating system, or the user. This includes reading or writing the user's private data (such as contacts or emails), reading or writing another app's files, performing network access, keeping the device awake, and so on.

(强调我的) 摘自 permission overview

这根本不可能,除非您可能使用 android 的自定义版本并且您可以控制 OS

是的,这是可能的。在 privileged permission whitelisting.

上查看此文档

IIRC,用户仍然可以撤销这些权限,因此您的应用必须准备好在没有此权限的情况下运行。它只保证开箱即用地授予应用程序权限。

根本不可能。 @curioustechizen 的回答是完全错误的。特权权限不同于危险权限。

危险权限必须仅在 运行 时间授予。用户应了解应用程序中使用的危险权限。

希望这个回答对您有所帮助。