多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] ## 检测方法 只需提取出所有<uses-permission>标签中的android:name属性的值即可,主要采用正则表达式来提取。 ![uses-permission标签](https://wiki-1252789527.cos.ap-shanghai.myqcloud.com/scan\_model/uses-permission.png) ## 1 权限简介 Android构建权限体系的目的是保护Android用户的隐私。当Android应用请求访问敏感用户数据(如联系人和短信)的权限,以及某些系统功能(如相机和互联网)时,必须获得权限许可。根据功能的不同,系统可能会自动授予权限,也可能会提示用户批准请求。 Android安全体系结构的核心设计点是,默认情况下,任何应用程序都无权执行任何会对其他应用程序,操作系统或用户产生负面影响的操作。这包括读取或写入用户的私人数据(如联系人或电子邮件),读取或写入其他应用程序的文件,执行网络访问,保持设备唤醒等等。 应用必须通过 `<uses-permission>`标签在AndroidManifest中说明其所需的权限 。例如,需要发送SMS消息的应用程序需要包含以下行: ``` <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.snazzyapp"> <uses-permission android:name="android.permission.SEND_SMS"/> <application ...> ... </application> </manifest> ``` 这是一个AndroidManifest.xml文件的例子,可以看到它申请了八个权限: ![权限说明](http://wiki-1252789527.picsh.myqcloud.com/scan_model/%E6%9D%83%E9%99%90%E8%AF%B4%E6%98%8E.png) 如果您的应用在其清单中列出了**正常**权限(即不会对用户的隐私或设备操作造成太大风险的权限),系统会自动将这些权限授予您的应用。 如果您的应用在其清单中列出了**危险**权限(即可能影响用户隐私或设备正常运行的`SEND_SMS`权限),例如上述权限,则用户必须明确同意授予这些权限。 有关正常和危险权限的详细信息,请参阅`第二节:权限的详细清单`的内容。 只有危险权限才需要用户同意。Android要求用户授予危险权限的方式取决于用户设备上运行的Android版本以及应用程序定位的系统版本。 ### 运行时请求(Android 6.0及更高版本) 如果设备运行的是Android 6.0(API级别23)或更高版本, 并且应用程序的数量targetSdkVersion 为23或更高,则在安装时不会通知用户任何应用程序权限。您的应用必须要求用户在运行时授予危险权限。当您的应用请求权限时,用户会看到一个系统对话框(如图1左侧所示),告诉用户您的应用尝试访问哪个权限组。该对话框包括拒绝和允许按钮。 如果用户拒绝权限请求,则下次应用请求权限时,该对话框包含一个复选框,选中该复选框后,表示不希望再次提示用户获得权限(参见图1,右)。 ![运行时请求](http://wiki-1252789527.picsh.myqcloud.com/scan_model/runtime_permission_request_2x.png?imageMogr2/thumbnail/400x) 图1.初始权限对话框(左)和次要权限请求以及关闭进一步请求的选项(右) 如果用户选中“ 永不再询问”框并点击 “拒绝”,则系统不再提示用户以后是否尝试请求相同的权限。 即使用户授予您的应用程序所请求的权限,您也不能总是依赖它。用户还可以选择在系统设置中逐个启用和禁用权限。您应该始终在运行时检查并请求权限以防止运行时错误(SecurityException)。 有关如何处理运行时权限请求的详细信息,请参阅 请求应用程序权限。 ### 安装时请求(Android 5.1.1及更低版本) 如果设备运行Android 5.1.1(API级别22)或更低版本,或者`targetSdkVersion` 在任何版本的Android上运行时 应用程序为22或更低,系统会自动要求用户在安装时为您的应用授予所有危险权限(见图2)。 ![安装时请求](https://wiki-1252789527.picsh.myqcloud.com/scan_model/install_time_permissions_dialog_2x.png?imageMogr2/thumbnail/200x) 图2.安装时权限对话框 如果用户单击“ 接受”,则授予应用程序请求的所有权限。如果用户拒绝权限请求,系统将取消应用程序的安装。 如果应用更新包含对其他权限的需求,则会在更新应用之前提示用户接受这些新权限。 ## 2 权限的详细清单 Android的权限体系,一般是分为四种保护等级:**正常、危险、签名和签名|特权**,但是根据实际情况,还需要再附加两种情况:**不允许被第三方应用使用、已启用** | 保护等级 | 英文表示 | 英文简写 | 含义| |---------------------------|---------------------------|---------|------| | 正常 | normal | N | 默认值。风险较低的权限,允许请求应用程序访问隔离的应用程序级功能,对其他应用程序,系统或用户的风险最小。系统会在安装时自动向请求的应用程序授予此类权限,而不会要求用户明确批准(尽管用户始终可以选择在安装之前查看这些权限)。 | | 危险 | dangerous | D | 一种风险较高的权限,可以使请求的应用程序访问私有用户数据或控制可能对用户产生负面影响的设备。由于此类权限会引入潜在风险,因此系统可能不会自动将其授予请求的应用程序。例如,应用程序请求的任何危险许可可以显示给用户并且在继续之前需要确认,或者可以采取一些其他方法以避免用户自动允许使用这些设施。 | | 签名 | signature | S | 仅当请求的应用程序使用与声明权限的应用程序相同的证书进行签名时系统授予的权限。如果证书匹配,系统会自动授予权限,而不通知用户或要求用户明确批准。 | | 签名/特权 | signature/privileged | S/P | *在API级别23后推荐使用"signatureOrSystem"表示*。</br>系统仅授予Android系统映像上专用文件夹中的应用程序*或*使用与声明权限的应用程序相同的证书进行签名的权限。应避免使用此选项,因为signature 保护级别应该足以满足大多数需求,并且无论应用程序的确切安装位置如何都能正常工作。“ signatureOrSystem”权限用于某些特殊情况,其中多个供应商将应用程序内置到系统映像中,并且需要明确共享特定功能,因为它们是一起构建的。 | 再附加两种情况: | 情况 | 英文表示 | 英文简写 | |---------------------------|-------------------------------------------|---------| | 不允许被第三方应用使用 | Not for Use by third-party applications | NU | | 已弃用 | out | O | ### 特别注意 这里有必要提及一下**第三方应用**的概念,Android系统自带的应用以外的,也就是我们开发者开发的Android应用,比如QQ、微博、微信、今日头条、抖音和王者荣耀等等,都是第三方应用,这些应用都是不能拥有NU标注的权限的。 对于带有**已弃用**标注的权限,有以下三种情况 1. 从API级别高于某一值废弃。低于这个数值申请该权限属于正常,但是高于这个数值,再申请肯定是错误的,因为此权限被弃用。我们使用`O-xxx`来表示从API级别xxx以后废弃该权限。比如O-23表示从API Level为23以后弃用该权限。 2. 该权限被某一权限替代。比如BIND_CARRIER_MESSAGING_SERVICE被BIND_CARRIER_SERVICES取代。 2. 该权限被永久废弃。我们用`O-all`来表示。 ### 所有的权限列表清单 | 类型 | 权限字符串 | 安全等级 | |-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [ACCEPT_HANDOVER](https://developer.android.google.cn/reference/android/Manifest.permission.html#ACCEPT_HANDOVER) </br>允许呼叫应用继续在另一个应用中启动的呼叫。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [ACCESS_CHECKIN_PROPERTIES](https://developer.android.google.cn/reference/android/Manifest.permission.html#ACCESS_CHECKIN_PROPERTIES) </br>允许对签入数据库中的“属性”表进行读/写访问,以更改上载的值。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [ACCESS_COARSE_LOCATION](https://developer.android.google.cn/reference/android/Manifest.permission.html#ACCESS_COARSE_LOCATION) </br>允许应用访问大致位置。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [ACCESS_FINE_LOCATION](https://developer.android.google.cn/reference/android/Manifest.permission.html#ACCESS_FINE_LOCATION) </br>允许应用访问精确位置。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [ACCESS_LOCATION_EXTRA_COMMANDS](https://developer.android.google.cn/reference/android/Manifest.permission.html#ACCESS_LOCATION_EXTRA_COMMANDS) </br>允许应用程序访问额外的位置提供程序命令。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [ACCESS_NETWORK_STATE](https://developer.android.google.cn/reference/android/Manifest.permission.html#ACCESS_NETWORK_STATE) </br>允许应用程序访问有关网络的信息。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [ACCESS_NOTIFICATION_POLICY](https://developer.android.google.cn/reference/android/Manifest.permission.html#ACCESS_NOTIFICATION_POLICY) </br>对希望访问通知政策的应用程序的标记权限。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [ACCESS_WIFI_STATE](https://developer.android.google.cn/reference/android/Manifest.permission.html#ACCESS_WIFI_STATE) </br>允许应用程序访问有关Wi-Fi网络的信息。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [ACCOUNT_MANAGER](https://developer.android.google.cn/reference/android/Manifest.permission.html#ACCOUNT_MANAGER) </br>允许应用程序调用AccountAuthenticators。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [ADD_VOICEMAIL](https://developer.android.google.cn/reference/android/Manifest.permission.html#ADD_VOICEMAIL) </br>允许应用程序将语音邮件添加到系统中。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [ANSWER_PHONE_CALLS](https://developer.android.google.cn/reference/android/Manifest.permission.html#ANSWER_PHONE_CALLS) </br>允许该应用接听来电。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BATTERY_STATS](https://developer.android.google.cn/reference/android/Manifest.permission.html#BATTERY_STATS) </br>允许应用程序收集电池统计信息 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_ACCESSIBILITY_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_ACCESSIBILITY_SERVICE) </br>必须由AccessibilityService调用,以确保只有系统可以绑定它。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_APPWIDGET](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_APPWIDGET) </br>允许应用程序告诉AppWidget服务哪个应用程序可以访问AppWidget的数据。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_AUTOFILL_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_AUTOFILL_SERVICE) </br>必须由a来要求AutofillService,以确保只有系统可以绑定它。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_CARRIER_MESSAGING_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_CARRIER_MESSAGING_SERVICE) </br>*此常量在API级别23中已弃用。请改为BIND_CARRIER_SERVICES使用* | S/P(O-23) | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_CARRIER_SERVICES](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_CARRIER_SERVICES) </br>允许绑定到运营商应用程序中的服务的系统进程将具有此权限。 | S/P | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_CHOOSER_TARGET_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_CHOOSER_TARGET_SERVICE) </br>必须由ChooserTargetService调用,以确保只有系统可以绑定它。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_CONDITION_PROVIDER_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_CONDITION_PROVIDER_SERVICE) </br>必须由ConditionProviderService调用,以确保只有系统可以绑定它。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_DEVICE_ADMIN](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_DEVICE_ADMIN) </br>必须由设备管理接收器要求,以确保只有系统可以与之交互。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_DREAM_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_DREAM_SERVICE) </br>必须由DreamService调用,以确保只有系统可以绑定它。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_INCALL_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_INCALL_SERVICE) </br>必须由InCallService调用,以确保只有系统可以绑定它。 | S/P | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_INPUT_METHOD](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_INPUT_METHOD) </br>必须由InputMethodService调用,以确保只有系统可以绑定它。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_MIDI_DEVICE_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_MIDI_DEVICE_SERVICE) </br>必须由MidiDeviceService调用,以确保只有系统可以绑定它。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_NFC_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_NFC_SERVICE) </br>必须由HostApduService或OffHostApduService调用,确保只有系统可以绑定它。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_NOTIFICATION_LISTENER_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_NOTIFICATION_LISTENER_SERVICE) </br>必须由NotificationListenerService调用,以确保只有系统可以绑定它。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_PRINT_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_PRINT_SERVICE) </br>必须由PrintService调用,以确保只有系统可以绑定它。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_QUICK_SETTINGS_TILE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_QUICK_SETTINGS_TILE) </br>允许应用程序绑定到第三方快速设置磁贴,只能由系统申请,并且附加TileService的声明 | S/P | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_REMOTEVIEWS](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_REMOTEVIEWS) </br>必须由RemoteViewsService调用,以确保只有系统可以绑定它。 | S/P | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_SCREENING_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_SCREENING_SERVICE) </br>必须由CallScreeningService调用,以确保只有系统可以绑定它。 | S/P | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_TELECOM_CONNECTION_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_TELECOM_CONNECTION_SERVICE) </br>必须由ConnectionService调用,以确保只有系统可以绑定它。 | S/P | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_TEXT_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_TEXT_SERVICE) </br>必须由TextService要求(例如 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_TV_INPUT](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_TV_INPUT) </br>必须由TvInputService调用,确保只有系统可以绑定它。 | S/P | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_VISUAL_VOICEMAIL_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_VISUAL_VOICEMAIL_SERVICE) </br>必须通过链接VisualVoicemailService来确保只有系统可以绑定它。 | S/P | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_VOICE_INTERACTION](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_VOICE_INTERACTION) </br>必须由VoiceInteractionService调用,以确保只有系统可以绑定它。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_VPN_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_VPN_SERVICE) </br>必须由VpnService调用,以确保只有系统可以绑定它。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_VR_LISTENER_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_VR_LISTENER_SERVICE) </br>必须由VrListenerService调用,以确保只有系统可以绑定它。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BIND_WALLPAPER](https://developer.android.google.cn/reference/android/Manifest.permission.html#BIND_WALLPAPER) </br>必须由WallpaperService调用,以确保只有系统可以绑定它。 | S/P | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BLUETOOTH](https://developer.android.google.cn/reference/android/Manifest.permission.html#BLUETOOTH) </br>允许应用程序连接到配对的蓝牙设备。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BLUETOOTH_ADMIN](https://developer.android.google.cn/reference/android/Manifest.permission.html#BLUETOOTH_ADMIN) </br>允许应用程序发现并配对蓝牙设备。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BLUETOOTH_PRIVILEGED](https://developer.android.google.cn/reference/android/Manifest.permission.html#BLUETOOTH_PRIVILEGED) </br>允许应用程序在没有用户交互的情况下配对蓝牙设备,并允许或禁止电话簿访问或消息访问。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BODY_SENSORS](https://developer.android.google.cn/reference/android/Manifest.permission.html#BODY_SENSORS) </br>允许应用程序访问用户用来测量身体内部情况的传感器数据,例如心率。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BROADCAST_PACKAGE_REMOVED](https://developer.android.google.cn/reference/android/Manifest.permission.html#BROADCAST_PACKAGE_REMOVED) </br>允许应用程序广播已删除应用程序包的通知。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BROADCAST_SMS](https://developer.android.google.cn/reference/android/Manifest.permission.html#BROADCAST_SMS) </br>允许应用程序广播SMS收据通知。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BROADCAST_STICKY](https://developer.android.google.cn/reference/android/Manifest.permission.html#BROADCAST_STICKY) </br>允许应用程序广播粘性意图。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [BROADCAST_WAP_PUSH](https://developer.android.google.cn/reference/android/Manifest.permission.html#BROADCAST_WAP_PUSH) </br>允许应用程序广播WAP PUSH收据通知。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CALL_PHONE](https://developer.android.google.cn/reference/android/Manifest.permission.html#CALL_PHONE) </br>允许应用程序在不通过拨号器用户界面的情况下发起电话呼叫,以便用户确认呼叫。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CALL_PRIVILEGED](https://developer.android.google.cn/reference/android/Manifest.permission.html#CALL_PRIVILEGED) </br>允许应用程序拨打任何电话号码(包括紧急号码),而无需通过拨号器用户界面以便用户确认正在拨打的电话。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CAMERA](https://developer.android.google.cn/reference/android/Manifest.permission.html#CAMERA) </br>需要能够访问相机设备。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CAPTURE_AUDIO_OUTPUT](https://developer.android.google.cn/reference/android/Manifest.permission.html#CAPTURE_AUDIO_OUTPUT) </br>允许应用程序捕获音频输出。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CAPTURE_SECURE_VIDEO_OUTPUT](https://developer.android.google.cn/reference/android/Manifest.permission.html#CAPTURE_SECURE_VIDEO_OUTPUT) </br>允许应用程序捕获安全视频输出。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CAPTURE_VIDEO_OUTPUT](https://developer.android.google.cn/reference/android/Manifest.permission.html#CAPTURE_VIDEO_OUTPUT) </br>允许应用程序捕获视频输出。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CHANGE_COMPONENT_ENABLED_STATE](https://developer.android.google.cn/reference/android/Manifest.permission.html#CHANGE_COMPONENT_ENABLED_STATE) </br>允许应用程序更改是否启用了应用程序组件(除了它自己的组件)。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CHANGE_CONFIGURATION](https://developer.android.google.cn/reference/android/Manifest.permission.html#CHANGE_CONFIGURATION) </br>允许应用程序修改当前配置,例如区域设置。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CHANGE_NETWORK_STATE](https://developer.android.google.cn/reference/android/Manifest.permission.html#CHANGE_NETWORK_STATE) </br>允许应用程序更改网络连接状态。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CHANGE_WIFI_MULTICAST_STATE](https://developer.android.google.cn/reference/android/Manifest.permission.html#CHANGE_WIFI_MULTICAST_STATE) </br>允许应用程序进入Wi-Fi多播模式。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CHANGE_WIFI_STATE](https://developer.android.google.cn/reference/android/Manifest.permission.html#CHANGE_WIFI_STATE) </br>允许应用程序更改Wi-Fi连接状态。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CLEAR\_APP\_CACHE](https://developer.android.google.cn/reference/android/Manifest.permission.html#CLEAR_APP_CACHE) </br>允许应用程序清除设备上所有已安装应用程序的缓存。 | S/P | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CONTROL_LOCATION_UPDATES](https://developer.android.google.cn/reference/android/Manifest.permission.html#CONTROL_LOCATION_UPDATES) </br>允许从收音机启用/禁用位置更新通知。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [DELETE_CACHE_FILES](https://developer.android.google.cn/reference/android/Manifest.permission.html#DELETE_CACHE_FILES) </br>允许应用程序删除缓存文件,这是旧的权限,不再使用,但是我们可以简单地忽略它而不调用它,而不是抛出异常的信号。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [DELETE_PACKAGES](https://developer.android.google.cn/reference/android/Manifest.permission.html#DELETE_PACKAGES) </br>允许应用程序删除包。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [DIAGNOSTIC](https://developer.android.google.cn/reference/android/Manifest.permission.html#DIAGNOSTIC) </br>允许应用程序将RW转换为诊断资源。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [DISABLE_KEYGUARD](https://developer.android.google.cn/reference/android/Manifest.permission.html#DISABLE_KEYGUARD) </br>允许应用程序在密钥保护不安全时禁用它。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [DUMP](https://developer.android.google.cn/reference/android/Manifest.permission.html#DUMP) </br>允许应用程序从系统服务检索状态转储信息。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [EXPAND_STATUS_BAR](https://developer.android.google.cn/reference/android/Manifest.permission.html#EXPAND_STATUS_BAR) </br>允许应用程序展开或折叠状态栏。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [FACTORY_TEST](https://developer.android.google.cn/reference/android/Manifest.permission.html#FACTORY_TEST) </br>作为制造商测试应用程序运行,以root用户身份运行。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [FOREGROUND_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#FOREGROUND_SERVICE) </br>允许常规应用程序使用Service.startForeground。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [GET_ACCOUNTS](https://developer.android.google.cn/reference/android/Manifest.permission.html#GET_ACCOUNTS) </br>允许访问帐户服务中的帐户列表。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [GET_ACCOUNTS_PRIVILEGED](https://developer.android.google.cn/reference/android/Manifest.permission.html#GET_ACCOUNTS_PRIVILEGED) </br>允许访问帐户服务中的帐户列表。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [GET_PACKAGE_SIZE](https://developer.android.google.cn/reference/android/Manifest.permission.html#GET_PACKAGE_SIZE) </br>允许应用程序查找任何包使用的空间。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [GET_TASKS](https://developer.android.google.cn/reference/android/Manifest.permission.html#GET_TASKS) </br>*此常量在API级别21中已弃用。不再强制执行。* | N/O-21 | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [GLOBAL_SEARCH](https://developer.android.google.cn/reference/android/Manifest.permission.html#GLOBAL_SEARCH) </br>此权限可用于内容提供商,以允许全局搜索系统访问其数据。 | S/P | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [INSTALL_LOCATION_PROVIDER](https://developer.android.google.cn/reference/android/Manifest.permission.html#INSTALL_LOCATION_PROVIDER) </br>允许应用程序将位置提供程序安装到位置管理器中。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [INSTALL_PACKAGES](https://developer.android.google.cn/reference/android/Manifest.permission.html#INSTALL_PACKAGES) </br>允许应用程序安装包。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [INSTALL_SHORTCUT](https://developer.android.google.cn/reference/android/Manifest.permission.html#INSTALL_SHORTCUT) </br>允许应用程序在Launcher中安装快捷方式。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [INSTANT_APP_FOREGROUND_SERVICE](https://developer.android.google.cn/reference/android/Manifest.permission.html#INSTANT_APP_FOREGROUND_SERVICE) </br>允许即时应用创建前台服务。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [INTERNET](https://developer.android.google.cn/reference/android/Manifest.permission.html#INTERNET) </br>允许应用程序打开网络套接字。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [KILL_BACKGROUND_PROCESSES](https://developer.android.google.cn/reference/android/Manifest.permission.html#KILL_BACKGROUND_PROCESSES) </br>允许应用程序调用 ActivityManager.killBackgroundProcesses(String)。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [LOCATION_HARDWARE](https://developer.android.google.cn/reference/android/Manifest.permission.html#LOCATION_HARDWARE) 允许应用程序在硬件中使用位置功能,例如geofencing api。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [MANAGE_DOCUMENTS](https://developer.android.google.cn/reference/android/Manifest.permission.html#MANAGE_DOCUMENTS) </br>允许应用程序管理对文档的访问,通常作为文档选择器的一部分。 |S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [MANAGE_OWN_CALLS](https://developer.android.google.cn/reference/android/Manifest.permission.html#MANAGE_OWN_CALLS) </br>允许通过自我管理的ConnectionServiceAPI 管理自己的调用的调用应用程序 。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [MASTER_CLEAR](https://developer.android.google.cn/reference/android/Manifest.permission.html#MASTER_CLEAR) </br>不适用于第三方应用程序。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [MEDIA_CONTENT_CONTROL](https://developer.android.google.cn/reference/android/Manifest.permission.html#MEDIA_CONTENT_CONTROL) </br>允许应用程序知道正在播放的内容并控制其播放。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [MODIFY_AUDIO_SETTINGS](https://developer.android.google.cn/reference/android/Manifest.permission.html#MODIFY_AUDIO_SETTINGS) </br>允许应用程序修改全局音频设置。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [MODIFY_PHONE_STATE](https://developer.android.google.cn/reference/android/Manifest.permission.html#MODIFY_PHONE_STATE) </br>允许修改电话状态 - 开机,mmi等 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [MOUNT_FORMAT_FILESYSTEMS](https://developer.android.google.cn/reference/android/Manifest.permission.html#MOUNT_FORMAT_FILESYSTEMS) </br>允许格式化可移动存储的文件系统。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [MOUNT_UNMOUNT_FILESYSTEMS](https://developer.android.google.cn/reference/android/Manifest.permission.html#MOUNT_UNMOUNT_FILESYSTEMS) </br>允许安装和卸载文件系统以进行可移动存储。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [NFC](https://developer.android.google.cn/reference/android/Manifest.permission.html#NFC) </br>允许应用程序通过NFC执行I / O操作。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [NFC_TRANSACTION_EVENT](https://developer.android.google.cn/reference/android/Manifest.permission.html#NFC_TRANSACTION_EVENT) </br>允许应用程序接收NFC交易事件。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [PACKAGE_USAGE_STATS](https://developer.android.google.cn/reference/android/Manifest.permission.html#PACKAGE_USAGE_STATS) </br>允许应用程序收集组件使用情况统计信息,声明权限意味着使用API​​的意图,设备用户可以通过“设置”应用程序授予权限。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [PERSISTENT_ACTIVITY](https://developer.android.google.cn/reference/android/Manifest.permission.html#PERSISTENT_ACTIVITY) </br>*此常量在API级别9中已弃用。此功能将在以后删除; 请不要使用。允许应用程序使其活动持久。* | O-all | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [PROCESS_OUTGOING_CALLS](https://developer.android.google.cn/reference/android/Manifest.permission.html#PROCESS_OUTGOING_CALLS) </br>允许应用程序查看拨出呼叫期间拨打的号码,并选择将呼叫重定向到其他号码或完全中止呼叫。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [READ_CALENDAR](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_CALENDAR) </br>允许应用程序读取用户的日历数据。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [READ_CALL_LOG](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_CALL_LOG) </br>允许应用程序读取用户的通话记录。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [READ_CONTACTS](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_CONTACTS) </br>允许应用程序读取用户的联系人数据。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [READ_EXTERNAL_STORAGE](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_EXTERNAL_STORAGE) </br>允许应用程序从外部存储读取。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [READ_FRAME_BUFFER](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_FRAME_BUFFER) </br>允许应用程序进行屏幕截图,更一般地,可以访问帧缓冲区数据。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [READ_INPUT_STATE](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_INPUT_STATE) </br>*此常量在API级别16中已弃用。已删除使用此权限的API。* | NU/O-16 | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [READ_LOGS](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_LOGS) </br>允许应用程序读取低级系统日志文件。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [READ_PHONE_NUMBERS](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_PHONE_NUMBERS) </br>允许读取设备的电话号码。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [READ_PHONE_STATE](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_PHONE_STATE) </br>允许只读访问电话状态,包括设备的电话号码,当前的蜂窝网络信息,任何正在进行的呼叫的状态以及PhoneAccount在设备上注册的任何s 的列表 。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [READ_SMS](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_SMS) </br>允许应用程序读取SMS消息。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [READ_SYNC_SETTINGS](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_SYNC_SETTINGS) </br>允许应用程序读取同步设置。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [READ_SYNC_STATS](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_SYNC_STATS) </br>允许应用程序读取同步统计信息。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [READ\_VOICEMAIL](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_VOICEMAIL) </br>允许应用程序读取系统中的语音邮件。 | S/P | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [REBOOT](https://developer.android.google.cn/reference/android/Manifest.permission.html#REBOOT) </br>必须能够重启设备。 |NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [RECEIVE_BOOT_COMPLETED](https://developer.android.google.cn/reference/android/Manifest.permission.html#RECEIVE_BOOT_COMPLETED) </br>允许应用程序接收Intent.ACTION_BOOT_COMPLETED系统完成引导后广播的应用程序 。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [RECEIVE_MMS](https://developer.android.google.cn/reference/android/Manifest.permission.html#RECEIVE_MMS) </br>允许应用程序监控传入的MMS消息。 |D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [RECEIVE_SMS](https://developer.android.google.cn/reference/android/Manifest.permission.html#RECEIVE_SMS) </br>允许应用程序接收SMS消息。 |D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [RECEIVE_WAP_PUSH](https://developer.android.google.cn/reference/android/Manifest.permission.html#RECEIVE_WAP_PUSH) </br>允许应用程序接收WAP推送消息。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [RECORD_AUDIO](https://developer.android.google.cn/reference/android/Manifest.permission.html#RECORD_AUDIO) </br>允许应用程序录制音频。 |D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [REORDER_TASKS](https://developer.android.google.cn/reference/android/Manifest.permission.html#REORDER_TASKS) </br>允许应用程序更改任务的Z-order。 |N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [REQUEST_COMPANION_RUN_IN_BACKGROUND](https://developer.android.google.cn/reference/android/Manifest.permission.html#REQUEST_COMPANION_RUN_IN_BACKGROUND) </br>允许随播应用在后台运行。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [REQUEST_COMPANION_USE_DATA_IN_BACKGROUND](https://developer.android.google.cn/reference/android/Manifest.permission.html#REQUEST_COMPANION_USE_DATA_IN_BACKGROUND) </br>允许配套应用在后台使用数据。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [REQUEST_DELETE_PACKAGES](https://developer.android.google.cn/reference/android/Manifest.permission.html#REQUEST_DELETE_PACKAGES) </br>允许应用程序请求删除包。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [REQUEST_IGNORE_BATTERY_OPTIMIZATIONS](https://developer.android.google.cn/reference/android/Manifest.permission.html#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS) </br>必须持有申请才能使用 Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [REQUEST_INSTALL_PACKAGES](https://developer.android.google.cn/reference/android/Manifest.permission.html#REQUEST_INSTALL_PACKAGES) </br>允许应用程序请求安装包。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [RESTART\_PACKAGES](https://developer.android.google.cn/reference/android/Manifest.permission.html#RESTART_PACKAGES) </br>*API级别8中不推荐使用此常量ActivityManager.restartPackage(String) 。不再支持API。* | O-all | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SEND_RESPOND_VIA_MESSAGE](https://developer.android.google.cn/reference/android/Manifest.permission.html#SEND_RESPOND_VIA_MESSAGE) </br>允许应用程序(电话)向其他应用程序发送请求,以处理来电期间的响应消息操作。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SEND_SMS](https://developer.android.google.cn/reference/android/Manifest.permission.html#SEND_SMS) </br>允许应用程序发送短信。 |D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SET_ALARM](https://developer.android.google.cn/reference/android/Manifest.permission.html#SET_ALARM) </br>允许应用程序广播Intent以为用户设置警报。 |N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SET_ALWAYS_FINISH](https://developer.android.google.cn/reference/android/Manifest.permission.html#SET_ALWAYS_FINISH) </br>允许应用程序控制在后台放置活动是否立即完成。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SET_ANIMATION_SCALE](https://developer.android.google.cn/reference/android/Manifest.permission.html#SET_ANIMATION_SCALE) </br>修改全局动画缩放系数。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SET_DEBUG_APP](https://developer.android.google.cn/reference/android/Manifest.permission.html#SET_DEBUG_APP) </br>配置应用程序以进行调试。 |NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SET_PREFERRED_APPLICATIONS](https://developer.android.google.cn/reference/android/Manifest.permission.html#SET_PREFERRED_APPLICATIONS) </br> *此常量在API级别7中已弃用。不再有用,请参阅 PackageManager.addPackageToPreferred(String) 详细信息。* | O-all | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SET_PROCESS_LIMIT](https://developer.android.google.cn/reference/android/Manifest.permission.html#SET_PROCESS_LIMIT) </br>允许应用程序设置可以运行的最大(不需要)应用程序进程数。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SET_TIME](https://developer.android.google.cn/reference/android/Manifest.permission.html#SET_TIME) </br> 允许应用程序设置系统时间。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SET_TIME_ZONE](https://developer.android.google.cn/reference/android/Manifest.permission.html#SET_TIME_ZONE) </br>允许应用程序设置系统时区。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SET_WALLPAPER](https://developer.android.google.cn/reference/android/Manifest.permission.html#SET_WALLPAPER) </br>允许应用程序设置壁纸。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SET_WALLPAPER_HINTS](https://developer.android.google.cn/reference/android/Manifest.permission.html#SET_WALLPAPER_HINTS) </br>允许应用程序设置壁纸提示。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SIGNAL_PERSISTENT_PROCESSES](https://developer.android.google.cn/reference/android/Manifest.permission.html#SIGNAL_PERSISTENT_PROCESSES) </br>允许应用程序请求将信号发送到所有持久进程。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [STATUS_BAR](https://developer.android.google.cn/reference/android/Manifest.permission.html#STATUS_BAR) </br>允许应用程序打开,关闭或禁用状态栏及其图标。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SYSTEM_ALERT_WINDOW](https://developer.android.google.cn/reference/android/Manifest.permission.html#SYSTEM_ALERT_WINDOW) </br>允许应用使用WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY所有其他应用上显示的类型创建窗口 。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [TRANSMIT_IR](https://developer.android.google.cn/reference/android/Manifest.permission.html#TRANSMIT_IR) </br>允许使用设备的红外发射器(如果有)。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [UNINSTALL_SHORTCUT](https://developer.android.google.cn/reference/android/Manifest.permission.html#UNINSTALL_SHORTCUT) </br> **请勿在您的应用中使用此权限。** | O-all | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [UPDATE_DEVICE_STATS](https://developer.android.google.cn/reference/android/Manifest.permission.html#UPDATE_DEVICE_STATS) </br>允许应用程序更新设备统计信息。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [USE_BIOMETRIC](https://developer.android.google.cn/reference/android/Manifest.permission.html#USE_BIOMETRIC) </br>允许应用使用设备支持的生物识别模式。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [USE_FINGERPRINT](https://developer.android.google.cn/reference/android/Manifest.permission.html#USE_FINGERPRINT) </br>*这个常量在API-28已弃用,应用程序应申请权限USE_BIOMETRIC。* | N/O-28 | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [USE_SIP](https://developer.android.google.cn/reference/android/Manifest.permission.html#USE_SIP) </br> 允许应用程序使用SIP服务。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [VIBRATE](https://developer.android.google.cn/reference/android/Manifest.permission.html#VIBRATE) </br>允许访问振动器。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [WAKE_LOCK](https://developer.android.google.cn/reference/android/Manifest.permission.html#WAKE_LOCK) </br>允许使用PowerManager WakeLocks防止处理器休眠或屏幕变暗。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [WRITE_APN_SETTINGS](https://developer.android.google.cn/reference/android/Manifest.permission.html#WRITE_APN_SETTINGS) </br>允许应用程序编写apn设置。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [WRITE_CALENDAR](https://developer.android.google.cn/reference/android/Manifest.permission.html#WRITE_CALENDAR) </br>允许应用程序写入用户的日历数据。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [WRITE_CALL_LOG](https://developer.android.google.cn/reference/android/Manifest.permission.html#WRITE_CALL_LOG) </br>允许应用程序写入(但不读取)用户的呼叫日志数据。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [WRITE_CONTACTS](https://developer.android.google.cn/reference/android/Manifest.permission.html#WRITE_CONTACTS) </br>允许应用程序写入用户的联系人数据。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [WRITE_EXTERNAL_STORAGE](https://developer.android.google.cn/reference/android/Manifest.permission.html#WRITE_EXTERNAL_STORAGE) </br>允许应用程序写入外部存储。 | D | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [WRITE_GSERVICES](https://developer.android.google.cn/reference/android/Manifest.permission.html#WRITE_GSERVICES) </br>许应用修改Google服务地图。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [WRITE_SECURE_SETTINGS](https://developer.android.google.cn/reference/android/Manifest.permission.html#WRITE_SECURE_SETTINGS) </br>允许应用程序读取或写入安全系统设置。 | NU | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [WRITE_SETTINGS](https://developer.android.google.cn/reference/android/Manifest.permission.html#WRITE_SETTINGS) </br>允许应用程序读取或写入系统设置。 | S | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [WRITE_SYNC_SETTINGS](https://developer.android.google.cn/reference/android/Manifest.permission.html#WRITE_SYNC_SETTINGS) </br>允许应用程序写入同步设置。 | N | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [WRITE_VOICEMAIL](https://developer.android.google.cn/reference/android/Manifest.permission.html#WRITE_VOICEMAIL) </br>允许应用程序修改和删除系统中的现有语音邮件。 | S/P | ## 3 权限组 权限分组为与设备功能或功能相关的组。在此系统下,权限请求在组级别处理,单个权限组对应于应用程序清单中的多个权限声明。例如,SMS组包括声明`READ_SMS`和 `RECEIVE_SMS`声明。以这种方式对权限进行分组使用户能够做出更有意义和更明智的选择,而不会被复杂和技术许可请求所淹没。 ![权限组说明](https://wiki-1252789527.cos.ap-shanghai.myqcloud.com/scan_model/user-data-overview-permissions-flow01.jpg) #### 对permission-group、permission、uses-permission三者的理解 权限组用标签`<permission-group>`表示,这里需要说明一下`<permission>`标签和`<uses-permission>`标签的区别。 我们来看一下某版本的**Android系统的源代码**,不要奇怪没有见过`COST_MONEY`这个权限组,因为不同SDK对权限组的定义和划分可能会有不同。 ``` <permission-group android:name="android.permission-group.COST_MONEY" android:label="@string/permgrouplab_costMoney" android:description="@string/permgroupdesc_costMoney"/> <permission android:name="android.permission.SEND_SMS" android:permissionGroup="android.permission-group.COST_MONEY" android:protectionLevel="dangerous" android:label="@string/permlab_sendSms" android:description="@string/permdesc_sendSms"/> <permission android:name="android.permission.CALL_PHONE" android:permissionGroup="android.permission-group.COST_MONEY" android:protectionLevel="dangerous" android:label="@string/permlab_callPhone" android:description="@string/permdesc_callPhone"/> ``` 可以看到,这边先定义了一个permission-group: * `android.permission-group.COST_MONEY` 然后又定义了两个permission: * `android.permission.SEND_SMS` * `android.permission.CALL_PHONE` 需要注意的是,这两个权限中都一个`android:permissionGroup`属性,这个属性就指定了这个权限所属的PermissionGroup。 而PermissionGroup在定义时,仅仅制定了label和description,就是说明一下这个权限组的作用,没什么其他用处。 通过这个Android系统的源码我们也可以总结出`<permission>`标签和`<uses-permission>`标签的区别,Android系统在开发时就预先设计好了若干的权限,也就是Google官方文档展示的权限清单,我们在开发应用时只需根据需求,申请我们的APP**所需的权限**即可,采用`<uses-permission>`标签;只有在我们开发的APP类似Android系统(操作系统本质也是一个应用)提供了供其他应用程序调用的代码或者数据,才需要使用`<permission>`声明**自己的程序的权限**。 #### 关于危险权限的权限组 所有危险的Android权限都属于权限组。无论保护级别如何,任何权限都可以属于权限组。但是,如果权限是危险的,则权限组仅影响用户体验。 如果设备运行的是Android 6.0(API级别23)且应用程序`targetSdkVersion`为23或更高,则当您的应用请求危险权限时,以下系统行为适用: * 如果应用程序当前在权限组中没有任何权限,系统会向用户显示描述应用程序要访问的权限组的权限请求对话框。该对话框未描述该组中的特定权限。例如,如果某个应用请求了该 `READ_CONTACTS`权限,系统对话框就会说该应用需要访问该设备的联系人。如果用户授予批准,系统将为应用程序提供其请求的权限。 * 如果应用程序已在同一权限组中被授予其他危险权限,则系统会立即授予权限,而不与用户进行任何交互。例如,如果某个应用程序先前已请求并已获得该`READ_CONTACTS`权限,然后它会请求`WRITE_CONTACTS`,则系统会立即授予该权限,而不向用户显示权限对话框。 警告:未来版本的Android SDK可能会将特定权限从一个组移动到另一个组。因此,请勿将应用程序的逻辑基于这些权限组的结构。 例如,与Android 8.1(API级别27)`READ_CONTACTS`属于同一权限组 `WRITE_CONTACTS`。如果您的应用请求`READ_CONTACTS` 权限,然后请求 `WRITE_CONTACTS`权限,请不要假设系统可以自动授予 `WRITE_CONTACTS`权限。 如果设备运行Android 5.1(API级别22)或更低版本,或者应用程序 `targetSdkVersion`为22或更低,系统会要求用户在安装时授予权限。系统再次告诉用户应用程序需要哪些权限组,而不是单个权限。例如,当应用程序请求`READ_CONTACTS`安装对话框时,列出“联系人”组。用户接受时,仅`READ_CONTACTS`授予应用程序权限。 注意:即使用户已在同一组中授予了其他权限,您的应用仍需要明确请求其所需的每个权限。此外,将权限分组到组中可能会在将来的Android版本中发生变化。您的代码不应具有依赖于同一组中的一组特定权限的逻辑。 #### 权限组列表 | 类型 |权限组字符串 | 权限 | |-------------|--------------------------|------| | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CALENDAR](https://developer.android.google.cn/reference/android/Manifest.permission_group.html#CALENDAR) 用于与用户日历相关的运行时权限。 | [READ_CALENDAR](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_CALENDAR)</br>[WRITE_CALENDAR](https://developer.android.google.cn/reference/android/Manifest.permission.html#WRITE_CALENDAR) | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CALL_LOG](https://developer.android.google.cn/reference/android/Manifest.permission_group.html#CALL_LOG) 用于与电话功能相关联的权限。 | [READ_CALL_LOG](https://developer.android.google.cn/reference/android/Manifest.permission#READ_CALL_LOG)</br>[WRITE_CALL_LOG](https://developer.android.google.cn/reference/android/Manifest.permission#WRITE_CALL_LOG)</br>[PROCESS_OUTGOING_CALLS](https://developer.android.google.cn/reference/android/Manifest.permission#PROCESS_OUTGOING_CALLS) | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CAMERA](https://developer.android.google.cn/reference/android/Manifest.permission_group.html#CAMERA) 用于与访问摄像头或从设备捕获图像/视频相关联的权限。 | [CAMERA](https://developer.android.google.cn/reference/android/Manifest.permission.html#CAMERA) | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [CONTACTS](https://developer.android.google.cn/reference/android/Manifest.permission_group.html#CONTACTS) 用于与此设备上的联系人和配置文件相关的运行时权限。 | [READ_CONTACTS](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_CONTACTS)</br>[WRITE_CONTACTS](https://developer.android.google.cn/reference/android/Manifest.permission.html#WRITE_CONTACTS)</br>[GET_ACCOUNTS](https://developer.android.google.cn/reference/android/Manifest.permission.html#GET_ACCOUNTS) | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [LOCATION](https://developer.android.google.cn/reference/android/Manifest.permission_group.html#LOCATION) 用于允许访问设备位置的权限。 | [ACCESS_FINE_LOCATION](https://developer.android.google.cn/reference/android/Manifest.permission.html#ACCESS_FINE_LOCATION)</br>[ACCESS_COARSE_LOCATION](https://developer.android.google.cn/reference/android/Manifest.permission.html#ACCESS_COARSE_LOCATION) | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [MICROPHONE](https://developer.android.google.cn/reference/android/Manifest.permission_group.html#MICROPHONE) 用于与从设备访问麦克风音频相关联的权限。 | [RECORD_AUDIO](https://developer.android.google.cn/reference/android/Manifest.permission.html#RECORD_AUDIO) | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [PHONE](https://developer.android.google.cn/reference/android/Manifest.permission_group.html#PHONE) 用于与电话功能相关联的权限。 | [READ_PHONE_STATE](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_PHONE_STATE)</br>[READ_PHONE_NUMBERS](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_PHONE_NUMBERS)</br>[CALL_PHONE](https://developer.android.google.cn/reference/android/Manifest.permission.html#CALL_PHONE)</br>[ANSWER_PHONE_CALLS](https://developer.android.google.cn/reference/android/Manifest.permission.html#ANSWER_PHONE_CALLS)</br>[ADD_VOICEMAIL](https://developer.android.google.cn/reference/android/Manifest.permission.html#ADD_VOICEMAIL)</br>[USE_SIP](https://developer.android.google.cn/reference/android/Manifest.permission.html#USE_SIP) | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SENSORS](https://developer.android.google.cn/reference/android/Manifest.permission_group.html#SENSORS) 用于与访问正文或环境传感器相关联的权限。 | [BODY_SENSORS](https://developer.android.google.cn/reference/android/Manifest.permission.html#BODY_SENSORS) | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [SMS](https://developer.android.google.cn/reference/android/Manifest.permission_group.html#SMS) 用于与用户的SMS消息相关的运行时权限。 | [SEND_SMS](https://developer.android.google.cn/reference/android/Manifest.permission.html#SEND_SMS)</br>[RECEIVE_SMS](https://developer.android.google.cn/reference/android/Manifest.permission.html#RECEIVE_SMS)</br>[READ_SMS](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_SMS)</br>[RECEIVE_WAP_PUSH](https://developer.android.google.cn/reference/android/Manifest.permission.html#RECEIVE_WAP_PUSH)</br>[RECEIVE_MMS](https://developer.android.google.cn/reference/android/Manifest.permission.html#RECEIVE_MMS) | | [String](https://developer.android.google.cn/reference/java/lang/String.html) | [STORAGE](https://developer.android.google.cn/reference/android/Manifest.permission_group.html#STORAGE) 用于与共享外部存储相关的运行时权限。 | [READ_EXTERNAL_STORAGE](https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_EXTERNAL_STORAGE)</br>[WRITE_EXTERNAL_STORAGE](https://developer.android.google.cn/reference/android/Manifest.permission.html#WRITE_EXTERNAL_STORAGE) | ## 4 Google官方文档链接 查阅更多,请查阅Google Android开发文档。 * 权限介绍<https://developer.android.google.cn/guide/topics/permissions/overview> * 权限清单<https://developer.android.google.cn/reference/android/Manifest.permission> * 权限组<https://developer.android.google.cn/reference/android/Manifest.permission_group>