Android Permission

作者: Zach_C | 来源:发表于2016-07-12 14:07 被阅读318次

    我们都知道,在6.0之后,Google将权限分为两类,Normal Permission和Dangerous Permission,Normal Permission这类权限不涉及用户隐私,所以不需要用户进行授权,而Dangerous Permission是涉及到用户隐私的,故需要用户进行授权。

    Normal Permissions:

    <pre>
    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
    GET_PACKAGE_SIZE
    INSTALL_SHORTCUT
    INTERNET
    KILL_BACKGROUND_PROCESSES
    MODIFY_AUDIO_SETTINGS
    NFC
    READ_SYNC_SETTINGS
    READ_SYNC_STATS
    RECEIVE_BOOT_COMPLETED
    REORDER_TASKS
    REQUEST_INSTALL_PACKAGES
    SET_ALARM
    SET_TIME_ZONE
    SET_WALLPAPER
    SET_WALLPAPER_HINTS
    TRANSMIT_IR
    UNINSTALL_SHORTCUT
    USE_FINGERPRINT
    VIBRATE
    WAKE_LOCK
    WRITE_SYNC_SETTINGS
    </pre>

    Dangerous Permissions:

    九大权限.png

    <pre>
    group:android.permission-group.CONTACTS
    permission:android.permission.WRITE_CONTACTS
    permission:android.permission.GET_ACCOUNTS
    permission:android.permission.READ_CONTACTS
    <p>
    group:android.permission-group.PHONE
    permission:android.permission.READ_CALL_LOG
    permission:android.permission.READ_PHONE_STATE
    permission:android.permission.CALL_PHONE
    permission:android.permission.WRITE_CALL_LOG
    permission:android.permission.USE_SIP
    permission:android.permission.PROCESS_OUTGOING_CALLS
    permission:com.android.voicemail.permission.ADD_VOICEMAIL
    <p>
    group:android.permission-group.CALENDAR
    permission:android.permission.READ_CALENDAR
    permission:android.permission.WRITE_CALENDAR
    <p>
    group:android.permission-group.CAMERA
    permission:android.permission.CAMERA
    <p>
    group:android.permission-group.SENSORS
    permission:android.permission.BODY_SENSORS
    <p>
    group:android.permission-group.LOCATION
    permission:android.permission.ACCESS_FINE_LOCATION
    permission:android.permission.ACCESS_COARSE_LOCATION
    <p>
    group:android.permission-group.STORAGE
    permission:android.permission.READ_EXTERNAL_STORAGE
    permission:android.permission.WRITE_EXTERNAL_STORAGE
    <p>
    group:android.permission-group.MICROPHONE
    permission:android.permission.RECORD_AUDIO
    <p>
    group:android.permission-group.SMS
    permission:android.permission.READ_SMS
    permission:android.permission.RECEIVE_WAP_PUSH
    permission:android.permission.RECEIVE_MMS
    permission:android.permission.RECEIVE_SMS
    permission:android.permission.SEND_SMS
    permission:android.permission.READ_CELL_BROADCASTS
    </pre>

       用adb shell pm list permissions -d -g可以查看。
       授权的时候,我们只要授某一组权限中的一个,当遇到改组的其它权限就不需要用户再去点击授权了。

    常用权限

    <pre>

    • ACCESS_NETWORK_STATE 网络状态权限
    • ACCESS_WIFI_STATE WIFI网络状态信息权限
    • BATTERY_STATE 电池状态权限
    • BLUETOOTH 连接匹配的蓝牙设备权限
    • BLUETOOTH_ADMIN 发现匹配的蓝牙设备权限
    • BROADCAST_SMS 广播收到短信提醒的权限
    • CALL_PHONE 拨打电话的权限
    • CAMERA 使用相机的权限
    • CHANGE_NETWORK_STATE 改变网络状态权限
    • CHANGE_WIFI_STATE 改变wifi网络状态权限
    • DELETE_CACHE_FILES 允许删除缓存文件权限
    • DELETE_PACKAGES 允许删除安装包的权限
    • FLASHLIGHT 访问闪光灯的权限
    • INTERNET 允许访问网络的权限
    • MODIFY_AUDIO_SETTINGS 允许修改全局声音的权限
    • PROCESS_OUTGOING_CALLS 允许监听、控制、取消呼出电话的权限
    • READ_CONTACTS 允许读取电话薄的权限
    • READ_HISTORY_BOOKMARKS 读取浏览器收藏夹和历史记录的权限
    • READ_OWNER_DATA 允许读取用户数据的权限
    • READ_PHONE_STATE 允许读取手机状态的权限
    • READ_PHONE_SMS 允许读取短信息的权限
    • REBOOT 允许重启系统的权限
    • RECEIVE_MMS 允许处理、监控、接受彩信的权限
    • RECEIVE_SMS 允许处理、监控、接受短信的权限
    • RECORD_AUDIO 允许录音的权限
    • SEND_SMS 允许发送短信的权限
    • SET_ORIENTATION 设置屏幕方向权限
    • SET_TIME 设置时间权限
    • SET_TIME_ZONE 允许设置时区的权限
    • SET_WALLPAPER 设置桌面壁纸权限
    • VIBRATE 允许控制振动器的权限
    • WRITE_CONTACTS 允许写用户联系人的权限
    • WRITE_HISTORY_BOOKMARKS 允许应用程序写历史记录和书签的全新
    • WRITE_OWNER_DATA 允许应用程序写用户数据的权限
      WRITE_SMS 允许写短信的权限
      </pre>

    相关文章

      网友评论

        本文标题:Android Permission

        本文链接:https://www.haomeiwen.com/subject/lxjrjttx.html