11

Android defines a set of permissions that third-party apps can request. Permissions are categorized by sensitivity; most permissions are either "normal" or "dangerous". Normal permissions are granted automatically, without prompting the user; dangerous permissions are presented to the user when the app is installed and the user is asked to consent to granting them.

Question: For any particular Android permission I have in mind, how can I tell whether it is a normal permission or a dangerous permission? Is there a list of dangerous permissions and a list of normal permissions?

(I know that third-party apps can declare their own permissions. I'm only asking about standard permissions. I know it may not be possible to get a 100%-complete list. I'm only looking for best-effort; something is better than nothing.)

For a related but different question, see also Where can I get a list of Android permissions (however, that's a different question; it doesn't at the normal vs dangerous distinction, and I don't necessarily need a complete list).

Community
  • 1
  • 1
D.W.
  • 3,382
  • 7
  • 44
  • 110

7 Answers7

23

For more simplicity, below are list of Normal permissions taken from official docs:

As of API level 23, the following permissions are classified as PROTECTION_NORMAL:

ACCESS_LOCATION_EXTRA_COMMANDS
ACCESS_NETWORK_STATE
ACCESS_NOTIFICATION_POLICY
ACCESS_WIFI_STATE
BLUETOOTH
BLUETOOTH_ADMIN
BROADCAST_STICKY
CHANGE_NETWORK_STATE
CHANGE_WIFI_MULTICAST_STATE
CHANGE_WIFI_STATE
DISABLE_KEYGUARD
EXPAND_STATUS_BAR
FLASHLIGHT
GET_PACKAGE_SIZE
INTERNET
KILL_BACKGROUND_PROCESSES
MODIFY_AUDIO_SETTINGS
NFC
READ_SYNC_SETTINGS
READ_SYNC_STATS
RECEIVE_BOOT_COMPLETED
REORDER_TASKS
REQUEST_INSTALL_PACKAGES
SET_TIME_ZONE
SET_WALLPAPER
SET_WALLPAPER_HINTS
TRANSMIT_IR
USE_FINGERPRINT
VIBRATE
WAKE_LOCK
WRITE_SYNC_SETTINGS
SET_ALARM
INSTALL_SHORTCUT
UNINSTALL_SHORTCUT

And here is list of Dangerous permissions and permission groups:

CALENDAR : READ_CALENDAR, WRITE_CALENDAR
CAMERA : CAMERA
CONTACTS : READ_CONTACTS, WRITE_CONTACTS, GET_ACCOUNTS
LOCATION : ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION
MICROPHONE : RECORD_AUDIO
PHONE : READ_PHONE_STATE, CALL_PHONE, READ_CALL_LOG, WRITE_CALL_LOG, ADD_VOICEMAIL, USE_SIP, PROCESS_OUTGOING_CALLS
SENSORS : BODY_SENSORS    
SMS     : SEND_SMS, RECEIVE_SMS, READ_SMS, RECEIVE_WAP_PUSH, RECEIVE_MMS
STORAGE : READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE
Uniruddh
  • 4,427
  • 3
  • 52
  • 86
15

Normal permissions are granted automatically, without prompting the user

AFAIK, the documentation is wrong here.

dangerous permissions are presented to the user when the app is installed and the user is asked to consent to granting them

AFAIK, all permissions have this behavior.

What this may have morphed into is that dangerous permissions are always displayed and normal permissions are ones that might be "below the fold" if there are enough dangerous ones.

For any particular Android permission I have in mind, how can I tell whether it is a normal permission or a dangerous permission? Is there a list of dangerous permissions and a list of normal permissions?

You can look at the source code.

Rahul Tiwari
  • 6,851
  • 3
  • 49
  • 78
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 1
    Link is broken, try this link instead: https://github.com/android/platform_frameworks_base/blob/master/core/res/AndroidManifest.xml – Ben Holland Feb 18 '15 at 16:58
  • http://stackoverflow.com/questions/32681513/what-is-different-between-normal-and-dangerous-in-android-protection-level I think there is one difference which is ought to be explained in the above description. Dangerous permissions are granted at runtime and introduced in API level 23 – Satish Oct 15 '15 at 13:22
  • this answer is not so satisfying; but just tells the diff between them; the questioner wanted the list of dangerous permission i believe! – DJphy May 24 '16 at 15:06
  • 1
    @DJphy: The roster of `dangerous` permissions changes with every Android release. – CommonsWare May 24 '16 at 15:24
  • @CommonsWare, look at me I am so dumb. I didn't think about this. Its so very true; Thanks for the enlightenment and sorry! – DJphy May 24 '16 at 15:29
6

I found this blogpost listing the "default" permissions by protection level. I think, this is the kind of list you were looking for.

The list might have changed in the meantime though, as the post is 10 months old. It provides sample code to recompile the list by yourself.

korius
  • 359
  • 2
  • 6
3

From android M permissions will be granted at runtime. User consent is not required for Normal permissions but for Dangerous permissions user is required to grant the permission to application.

Normal permissions: https://developer.android.com/guide/topics/security/normal-permissions.html

Dangerous permissions: Dangerous permissions cover areas where the app wants data or resources that involve the user's private information https://developer.android.com/guide/topics/security/permissions.html#normal-dangerous

singularity
  • 147
  • 1
  • 11
3

Here is a good article which describes every thing about run time permissions ,

Normal permissions

android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
android.permission.ACCESS_NETWORK_STATE
android.permission.ACCESS_NOTIFICATION_POLICY
android.permission.ACCESS_WIFI_STATE
android.permission.ACCESS_WIMAX_STATE
android.permission.BLUETOOTH
android.permission.BLUETOOTH_ADMIN
android.permission.BROADCAST_STICKY
android.permission.CHANGE_NETWORK_STATE
android.permission.CHANGE_WIFI_MULTICAST_STATE
android.permission.CHANGE_WIFI_STATE
android.permission.CHANGE_WIMAX_STATE
android.permission.DISABLE_KEYGUARD
android.permission.EXPAND_STATUS_BAR
android.permission.FLASHLIGHT
android.permission.GET_ACCOUNTS
android.permission.GET_PACKAGE_SIZE
android.permission.INTERNET
android.permission.KILL_BACKGROUND_PROCESSES
android.permission.MODIFY_AUDIO_SETTINGS
android.permission.NFC
android.permission.READ_SYNC_SETTINGS
android.permission.READ_SYNC_STATS
android.permission.RECEIVE_BOOT_COMPLETED
android.permission.REORDER_TASKS
android.permission.REQUEST_INSTALL_PACKAGES
android.permission.SET_TIME_ZONE
android.permission.SET_WALLPAPER
android.permission.SET_WALLPAPER_HINTS
android.permission.SUBSCRIBED_FEEDS_READ
android.permission.TRANSMIT_IR
android.permission.USE_FINGERPRINT
android.permission.VIBRATE
android.permission.WAKE_LOCK
android.permission.WRITE_SYNC_SETTINGS
com.android.alarm.permission.SET_ALARM
com.android.launcher.permission.INSTALL_SHORTCUT
com.android.launcher.permission.UNINSTALL_SHORTCUT

Dangerous permissions enter image description here

Manohar
  • 22,116
  • 9
  • 108
  • 144
1

in Android Studio,you can open your AndroidManifest.xml and press F1 on every permission you used then you can see if it is dangerous which the doc may shows.

shiguiyou
  • 401
  • 1
  • 5
  • 7
1

New permissions are added as new Android versions are released, so any list included in your code will go out of date.

If you need a future-proof approach, it's possible to determine at runtime whether a permission is dangerous.

fun Context.isDangerousPermission(permissionName: String): Boolean {
    val permissionInfo: PermissionInfo = try {
        packageManager.getPermissionInfo(permissionName, 0);
    } catch (ex: PackageManager.NameNotFoundException) {
        return false
    }
    return if (Build.VERSION.SDK_INT >= 28) {
        permissionInfo.protection == PermissionInfo.PROTECTION_DANGEROUS
    } else {
        permissionInfo.protectionLevel and PermissionInfo.PROTECTION_DANGEROUS != 0
    }
}

This extension function returns true if a permission is dangerous.

For example:

activity.isDangerousPermission("android.permission.CAMERA") // true
activity.isDangerousPermission("android.permission.INTERNET") // false
Troy
  • 690
  • 1
  • 7
  • 25