Android| (十三)权限1 <uses-permission>使用权限

官网:<permission>|  Android Developers

        在Android权限操作(在Manifest文件中配置)中,有4个标签与此有关,即

  • <uses-permission>(Android预定义权限,最常用)
  • <permission> (自定义权限使用,使用较少)
  • <permission-tree> (很少使用,声明一组permissons的namespace)
  • <permission-group> (很少使用,声明一个标签,代表一组permissions)

一、<uses-permission>概述

 定义:指定为使应用正常运行而用户必须授予的系统权限。

<uses-permission 
        android:name="string"
        android:maxSdkVersion="integer" />
name

权限名称(通常以软件包名称为前缀),可以是

  •  标准系统权限
  • 应用通过<permission>自定义的权限
  • 另一个应用定义的权限 
maxSdkVersion

此权限授予应用的最高 API 级别。

如果从某个 API 级别开始不再需要应用所需的权限,则设置此属性非常有用。

二、常见权限 | 方便查找【ctrl+F】

android.permission.Allows an application
ACCESS_CHECKIN_PROPERTIES

读写访问”properties”表在checkin数据库中,改值可以修改上传

ACCESS_COARSE_LOCATION
ACCESS_FINE_LOCATION
访问CellID或WiFi热点来获取粗略的位置(access coarse (e.g., Cell-ID, WiFi) location)
访问精良位置(如GPS) ( accessfine (e.g., GPS) location)
ACCESS_LOCATION_EXTRA_COMMANDS访问额外的位置提供命令( access extra location provider commands)
ACCESS_MOCK_LOCATION创建模拟位置提供用于测试(create mock location providers for testing)
CHANGE_CONFIGURATION允许一个程序修改当前设置,如本地化
CALL_PHONE
CALL_PRIVILEGED
初始化电话拨号/ 拨打任何号码,包含紧急号码,无需通过拨号用户界面需要用户确认
INTERNET
ACCESS_NETWORK_STATE
ACCESS_WIFI_STATE

允许程序打开网络套接字sockets
访问GSM网络状态信息 
访问Wi-Fi网络状态信息

CHANGE_NETWORK_STATE

CHANGE_WIFI_STATE

改变网络连接状态

改变Wi-Fi连接状态

BROADCAST_PACKAGE_REMOVEDapp移除后,广播提示消息 
ACCESS_SURFACE_FLINGER使用SurfaceFlinger底层特性 
BRICK请求能够禁用设备(非常危险)(Required to be able to disable thedevice (very *erous!).)
ADD_SYSTEM_SERVICE发布系统级服务(Allowsan application to publish system-level services).
BATTERY_STATS更新手机电池统计信息

BLUETOOTH

BLUETOOTH_ADMIN

连接到已配对的蓝牙设备

允许程序发现和配对蓝牙设备

CHANGE_COMPONENT_ENABLED_STATE允许一个程序是否改变一个组件或其他的启用或禁用(Allowsan application to change whether an application component (other than its own)is enabled or not. )
BROADCAST_STICKY广播sticky intents
CAMERA请求访问使用照相设备
CLEAR_APP_CACHE清除缓存 在设备中所有安装的程序

CLEAR_APP_USER_DATA
允许一个程序清除用户设置

CONTROL_LOCATION_UPDATES
允许启用禁止位置更新提示从无线模块

.DELETE_CACHE_FILES
允许程序删除缓存文件

android.permission.DELETE_PACKAGES
允许一个程序删除包

android.permission.DEVICE_POWER
允许访问底层电源管理

android.permission.DIAGNOSTIC
允许程序RW诊断资源

DISABLE_KEYGUARD
允许程序禁用键盘锁

DUMP
允许程序返回状态抓取信息从系统服务

EXPAND_STATUS_BAR
允许一个程序扩展收缩在状态栏,android开发网提示应该是一个类似Windows Mobile中的托盘程序

android.permission.FACTORY_TEST
作为一个工厂测试程序,运行在root用户(Run as a manufacturer test application,running as the root user. )

android.permission.FLASHLIGHT
访问闪光灯,android开发网提示HTC Dream不包含闪光灯(Allowsaccess to the flashlight )

android.permission.FORCE_BACK
允许程序强行一个后退操作是否在顶层activities(Allowsan application to force a BACK operation on whatever is the top activity. )

android.permission.FOTA_UPDATE
暂时不了解这是做什么使用的,android开发网分析可能是一个预留权限.

android.permission.GET_ACCOUNTS
访问一个帐户列表在AccountsService中(Allows access to thelist of accounts in the Accounts Service)

android.permission.GET_PACKAGE_SIZE
允许一个程序获取任何package占用空间容量(Allows an application to find out thespace used by any package. )

android.permission.GET_TASKS
允许一个程序获取信息有关当前或最近运行的任务,一个缩略的任务状态,是否活动等等(Allowsan application to get information about the currently or recently runningtasks: a thumbnail representation of the tasks, what activities are running init, etc.)

android.permission.HARDWARE_TEST
允许访问硬件(Allowsaccess to hardware peripherals. )

android.permission.INJECT_EVENTS
允许一个程序截获用户事件如按键、触摸、轨迹球等等到一个时间流,android开发网提醒算是hook技术吧(Allowsan application to inject user events (keys, touch, trackball) into the eventstream and deliver them to ANY window.)

android.permission.INSTALL_PACKAGES
允许一个程序安装packages(Allowsan application to install packages. )

android.permission.INTERNAL_SYSTEM_WINDOW
允许打开窗口使用系统用户界面(Allowsan application to open windows that are for use by parts of the system userinterface. )

android.permission.MANAGE_APP_TOKENS
允许程序管理(创建、催后、 z- order默认向z轴推移)程序引用在窗口管理器中(Allowsan application to manage (create, destroy, Z-order) application tokens in thewindow manager. )

android.permission.MASTER_CLEAR
目前还没有明确的解释,android开发网分析可能是清除一切数据,类似硬格机

android.permission.MODIFY_AUDIO_SETTINGS
允许程序修改全局音频设置(Allowsan application to modify global audio settings)

android.permission.MODIFY_PHONE_STATE
允许修改话机状态,如电源,人机接口等(Allowsmodification of the telephony state – power on, mmi, etc. )

android.permission.MOUNT_UNMOUNT_FILESYSTEMS
允许挂载和反挂载文件系统可移动存储(Allowsmounting and unmounting file systems for removable storage. )

android.permission.PERSISTENT_ACTIVITY
允许一个程序设置他的activities显示(Allow an application to make itsactivities persistent. )

android.permission.PROCESS_OUTGOING_CALLS
允许程序监视、修改有关播出电话(Allowsan application to monitor, modify, or abort outgoing calls)

android.permission.READ_CALENDAR
允许程序读取用户日历数据(Allowsan application to read the user's calendar data.)

android.permission.READ_CONTACTS
允许程序读取用户联系人数据(Allowsan application to read the user's contacts data.)

android.permission.READ_FRAME_BUFFER
允许程序屏幕波或和更多常规的访问帧缓冲数据(Allowsan application to take screen shots and more generally get access to the framebuffer data)

android.permission.READ_INPUT_STATE
允许程序返回当前按键状态(Allowsan application to retrieve the current state of keys and switches. )

android.permission.READ_LOGS
允许程序读取底层系统日志文件(Allowsan application to read the low-level system log files. )

android.permission.READ_OWNER_DATA
允许程序读取所有者数据(Allowsan application to read the owner's data)

android.permission.READ_SMS
允许程序读取短信息(Allowsan application to read SMS messages.)

android.permission.READ_SYNC_SETTINGS
允许程序读取同步设置(Allowsapplications to read the sync settings)

android.permission.READ_SYNC_STATS
允许程序读取同步状态(Allowsapplications to read the sync stats)

android.permission.REBOOT
请求能够重新启动设备(Requiredto be able to reboot the device. )

android.permission.RECEIVE_BOOT_COMPLETED
允许一个程序接收到ACTION_BOOT_COMPLETED广播在系统完成启动(Allowsan application to receive the ACTION_BOOT_COMPLETED that is broadcast after thesystem finishes booting. )

android.permission.RECEIVE_MMS
允许一个程序监控将收到MMS彩信,记录或处理(Allowsan application to monitor incoming MMS messages, to record or performprocessing on them. )

android.permission.RECEIVE_SMS
允许程序监控一个将收到短信息,记录或处理(Allowsan application to monitor incoming SMS messages, to record or performprocessing on them.)

android.permission.RECEIVE_WAP_PUSH
允许程序监控将收到WAPPUSH信息(Allows an applicationto monitor incoming WAP push messages. )

android.permission.RECORD_AUDIO
允许程序录制音频(Allowsan application to record audio)

android.permission.REORDER_TASKS
允许程序改变Z轴排列任务(Allows an application to change theZ-order of tasks)

RESTART_PACKAGES
允许程序重新启动其他程序

SEND_SMS
允许程序发送SMS短信

SET_ACTIVITY_WATCHER
允许程序监控或控制activities已经启动全局系统中

SET_ALWAYS_FINISH
允许程序控制是否活动间接完成在处于后台时

SET_ANIMATION_SCALE
修改全局信息比例(Modifythe global animation scaling factor.)

.SET_DEBUG_APP
配置一个程序用于调试(Configurean application for debugging.)

SET_ORIENTATION
允许底层访问设置屏幕方向和实际旋转

SET_PREFERRED_APPLICATIONS
允许一个程序修改列表参数

SET_PROCESS_FOREGROUND
允许程序当前运行程序强行到前台force any currently running process to be in the foreground.)

SET_PROCESS_LIMIT设置最大的运行进程数量 maximum number of (not needed) application processesthat can be running. 

SET_TIME_ZONE设置系统时间区域

SET_WALLPAPER

SET_WALLPAPER_HINTS

设置壁纸wallpaper 

设置壁纸 wallpaper hints

SIGNAL_PERSISTENT_PROCESSES允许程序请求发送信号到所有显示的进程中
STATUS_BAR

打开、关闭或禁用状态栏及图标 

status bar and its icons.

SUBSCRIBED_FEEDS_READ

SUBSCRIBED_FEEDS_WRITE

访问订阅RSS Feed ContentProvider.

系统暂时保留改设置,android开发网认为未来版本会加入该功能。

SYSTEM_ALERT_WINDOW打开窗口使用TYPE_SYSTEM_ALERT,显示在其他所有程序的顶层
VIBRATE访问振动设备vibrator
WAKE_LOCK使用PowerManager的 WakeLocks保持进程在休眠时从屏幕消失(Allows using PowerManager WakeLocks to keep
processor from sleeping or screen fromdimming)
WRITE_APN_SETTINGS写入API设置( write the apnsettings)
WRITE_CALENDAR写入但不读取用户日历数据(write (but not read) the user's calendar data. )
WRITE_CONTACTS写入但不读取用户联系人数据(write (but not read) the user's contacts data. )
WRITE_GSERVICES修改Google服务地图( modify theGoogle service map. )
WRITE_OWNER_DATA写入但不读取所有者数据(write (but not read) the owner's data.)
WRITE_SETTINGS读取或写入系统设置(ead or write the system settings. )
android.permission.WRITE_SMS允许程序写短信 write SMS messages
WRITE_SYNC_SETTINGS

允许程序写入同步设置

write the sync settings)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<uses-permission>标签在AndroidManifest.xml文件中用于声明应用程序需要使用权限。\[1\]它是Android预定义的权限,用于指定应用程序需要访问的设备功能或资源,例如访问网络、读取联系人等。与之相对的是<permission>标签,它用于自定义权限。\[1\] 在使用<uses-permission>标签时,需要指定权限的名称,例如android:name="com.scc.userprovider.permission.read"表示应用程序需要读取用户提供者的权限android:name="com.scc.userprovider.permission.write"表示应用程序需要写入用户提供者的权限。\[2\] 在AndroidManifest.xml文件中,<uses-permission>标签通常位于<manifest>标签内部的<application>标签之前。\[3\]它的作用是告诉系统应用程序需要使用哪些权限,以便在安装应用程序时向用户显示权限请求。如果应用程序没有声明所需的权限,它将无法访问相关的功能或资源。\[3\] 总结来说,<uses-permission>标签用于声明应用程序需要使用权限,以便在安装应用程序时向用户显示权限请求。它是Android预定义的权限,与<permission>标签的作用相似,但<permission>标签用于自定义权限。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* *3* [Android权限操作之uses-permission详解](https://blog.csdn.net/weixin_33946605/article/details/85920868)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [uses-permissionpermission区别及使用](https://blog.csdn.net/g984160547/article/details/119951397)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值