简体   繁体   中英

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. 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. 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

its a bad idea to make your targetSdkVersion below 23 because please read this Target API level requirement from late 2018

  • Implicit intents for bindService() no longer supported (Android 5.0)

  • Runtime permissions (Android 6.0)

  • User-added CAs not trusted by default for secure connections (Android 7.0)

  • Apps can't access user accounts without explicit user approval (Android 8.0)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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