简体   繁体   English

系统应用权限问题

[英]system app permission issue

I have created a system app signed with firmware key and it is asking for permission from the user when starting the app ex. 我创建了一个使用固件密钥签名的系统应用程序,启动应用程序ex时,它正在征求用户的许可。 for Storage / Location. 用于存储/位置。 How will I give permission at install time to it won't ask for any permission at runtime? 我如何在安装时授予权限,而在运行时不要求任何权限?

How will I give permission at install time to it won't ask for any permission at runtime? 我如何在安装时授予权限,而在运行时不要求任何权限?

If you are running your app on OS version >= Android M (API 23) and targetSdkVersion is set to >= 23, permissions falling under dangerous category (storage/location permissions fall under this category) have to be granted at run-time. 如果您在操作系统版本> = Android M(API 23)上运行您的应用程序,并且targetSdkVersion设置为> = 23,则必须在运行时授予属于危险类别的权限(存储/位置许可属于此类别)。 Even System apps are not exempted from this request. 即使系统应用程序也不能免除此请求。

For generic apps only the normal-level permissions are granted at installation time. 对于通用应用程序,在安装时仅授予普通级别权限。 Since your app is signed with firmware key the advantage it gets is, the normal-level as well as signature-level permissions will be granted at installation time. 由于您的应用程序是使用固件密钥签名的,因此它获得的好处是,在安装时将授予普通级别和签名级别的权限。 Refer to official document for more details. 有关更多详细信息,请参考官方文档

How will I give permission at install time to it won't ask for any permission at runtime? 我如何在安装时授予权限,而在运行时不要求任何权限?

AFAIK it is not possible if you app targetSdkVersion >=23 because since api 23 user grants all the dangerous permission at run time not while installing app AFAIK ,如果您的应用targetSdkVersion >=23是不可能的,因为因为api 23用户在运行时(而不是在安装应用时)授予所有危险权限

its a bad idea to make your targetSdkVersion below 23 because please read this Target API level requirement from late 2018 让您的targetSdkVersion低于23是个坏主意,因为请从2018年末开始阅读此Target API级别要求

  • Implicit intents for bindService() no longer supported (Android 5.0) 不再支持bindService()的隐式意图(Android 5.0)

  • Runtime permissions (Android 6.0) 运行时权限(Android 6.0)

  • User-added CAs not trusted by default for secure connections (Android 7.0) 用户添加的CA默认情况下不受安全连接信任(Android 7.0)

  • Apps can't access user accounts without explicit user approval (Android 8.0) 未经明确的用户批准,应用无法访问用户帐户(Android 8.0)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM