androidandroid-permissionsandroid-6.0-marshmallowandroid-account

Check user account on android m


I'm trying to check if there is any user account (with email address) on an Android-M device.

I don't care what's the mail or how many are there, just a yes/no question.

Can I check it with normal and not dangerous permissions?

Thanks.


Solution

  • For devices with 6.0 and greater, GET_ACCOUNTS is a signature permission.

    Otherwise is it a dangerous permission.

    GET_ACCOUNTS

    Note: Beginning with Android 6.0 (API level 23), if an app shares the signature of the authenticator that manages an account, it does not need "GET_ACCOUNTS" permission to read information about that account. On Android 5.1 and lower, all apps need "GET_ACCOUNTS" permission to read information about any account.

    Signature permission:

    A permission that the system grants only if the requesting application is signed with the same certificate as the application that declared the permission. If the certificates match, the system automatically grants the permission without notifying the user or asking for the user's explicit approval.

    Please note, as a yes or no question, if you require more detail about this, you will need to ask a new question.