android的權限在androidmanifest.xml檔案裡配置。androidmanifest檔案中有四個标簽與permission有關,它們分别是 <permission>、 <permission-group> 、<permission-tree> 和 <uses-permission>。其中最常用的是 <uses-permission>,當我們需要擷取某個權限的時候就必須在我們的manifest檔案中聲明<uses-permission>
例如,短信和電話權限的定義:
下面是收集到的 <uses-permission>的資料,友善用的時候查找:
android.permission.access_checkin_properties
允許讀寫通路”properties”表在checkin資料庫中,改值可以修改上傳( allowsread/write access to the “properties” table in the checkin database, to changevalues that get uploaded)
android.permission.access_coarse_location
允許一個程式通路cellid或wifi熱點來擷取粗略的位置(allowsan application to access coarse (e.g., cell-id, wifi) location)
android.permission.access_fine_location
允許一個程式通路精良位置(如gps) (allows an application to accessfine (e.g., gps) location)
android.permission.access_location_extra_commands
允許應用程式通路額外的位置提供指令(allowsan application to access extra location provider commands)
android.permission.access_mock_location
允許程式建立模拟位置提供用于測試(allowsan application to create mock location providers for testing)
android.permission.access_network_state
允許程式通路有關gsm網絡資訊(allows applications to accessinformation about networks)
android.permission.access_surface_flinger
允許程式使用surfaceflinger底層特性(allows an application to usesurfaceflinger’s low level features)
android.permission.access_wifi_state
允許程式通路wi-fi網絡狀态資訊(allows applications to accessinformation about wi-fi networks)
android.permission.add_system_service
允許程式釋出系統級服務(allowsan application to publish system-level services).
android.permission.battery_stats
允許程式更新手機電池統計資訊(allowsan application to update the collected battery statistics)
android.permission.bluetooth
允許程式連接配接到已配對的藍牙裝置(allowsapplications to connect to paired bluetooth devices)
android.permission.bluetooth_admin
允許程式發現和配對藍牙裝置(allowsapplications to discover and pair bluetooth devices)
android.permission.brick
請求能夠禁用裝置(非常危險)(required to be able to disable thedevice (very *erous!).)
android.permission.broadcast_package_removed
允許程式廣播一個提示消息在一個應用程式包已經移除後(allowsan application to broadcast a notification that an applicationpackage has been removed)
android.permission.broadcast_sticky
允許一個程式廣播常用intents(allowsan application to broadcast sticky intents)
android.permission.call_phone
允許一個程式初始化一個電話撥号不需通過撥号使用者界面需要使用者确認(allowsan application to initiate a phone call without going through the dialer userinterface for the user to confirm the call being placed.)
android.permission.call_privileged
允許一個程式撥打任何号碼,包含緊急号碼無需通過撥号使用者界面需要使用者确認(allowsan application to call any phone number, including emergency numbers, withoutgoing through the dialer user interface for the user to confirm the call beingplaced)
android.permission.camera
請求通路使用照相裝置(requiredto be able to access the camera device. )
android.permission.change_component_enabled_state
允許一個程式是否改變一個元件或其他的啟用或禁用(allowsan application to change whether an application component (other than its own)is enabled or not. )
android.permission.change_configuration
允許一個程式修改目前設定,如本地化(allowsan application to modify the current configuration, such as locale. )
android.permission.change_network_state
允許程式改變網絡連接配接狀态(allowsapplications to change network connectivity state)
android.permission.change_wifi_state
允許程式改變wi-fi連接配接狀态(allows applications to change wi-ficonnectivity state)
android.permission.clear_app_cache
允許一個程式清楚緩存從所有安裝的程式在裝置中(allowsan application to clear the caches of all installed applications on the device.)
android.permission.clear_app_user_data
允許一個程式清除使用者設定(allowsan application to clear user data)
android.permission.control_location_updates
允許啟用禁止位置更新提示從無線子產品(allowsenabling/disabling location update notifications from the radio. )
android.permission.delete_cache_files
允許程式删除緩存檔案(allowsan application to delete cache files)
android.permission.delete_packages
允許一個程式删除包(allowsan application to delete packages)
android.permission.device_power
允許通路底層電源管理(allowslow-level access to power management)
android.permission.diagnostic
允許程式rw診斷資源(allows applications to rw to diagnosticresources. )
android.permission.disable_keyguard
允許程式禁用鍵盤鎖(allowsapplications to disable the keyguard )
android.permission.dump
允許程式傳回狀态抓取資訊從系統服務(allowsan application to retrieve state dump information from
system services.)
android.permission.expand_status_bar
允許一個程式擴充收縮在狀态欄,android開發網提示應該是一個類似windows mobile中的托盤程式(allows an application to expand orcollapse the status bar. )
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.internet
允許程式打開網絡套接字(allowsapplications to open network sockets)
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)
android.permission.restart_packages
允許程式重新啟動其他程式(allowsan application to restart other applications)
android.permission.send_sms
允許程式發送sms短信(allows an application to send smsmessages)
android.permission.set_activity_watcher
允許程式監控或控制activities已經啟動全局系統中(allows an application to watch andcontrol how activities are started globally in the system.)
android.permission.set_always_finish
允許程式控制是否活動間接完成在處于背景時(allowsan application to control whether activities are immediately finished when putin the background.)
android.permission.set_animation_scale
修改全局資訊比例(modifythe global animation scaling factor.)
android.permission.set_debug_app
配置一個程式用于調試(configurean application for debugging.)
android.permission.set_orientation
允許底層通路設定螢幕方向和實際旋轉(allowslow-level access to setting the orientation (actually rotation) of the screen.)
android.permission.set_preferred_applications
允許一個程式修改清單參數packagemanager.addpackagetopreferred()和packagemanager.removepackagefrompreferred()方法(allowsan application to modify the list of preferred applications with thepackagemanager.addpackagetopreferred() andpackagemanager.removepackagefrompreferred() methods.)
android.permission.set_process_foreground
允許程式目前運作程式強行到前台(allowsan application to force any currently running process to be in the foreground.)
android.permission.set_process_limit
允許設定最大的運作程序數量(allowsan application to set the maximum number of (not needed) application processesthat can be running. )
android.permission.set_time_zone
允許程式設定時間區域(allowsapplications to set the system time zone)
android.permission.set_wallpaper
允許程式設定桌面(allowsapplications to set the wallpaper )
android.permission.set_wallpaper_hints
允許程式設定桌面hits(allowsapplications to set the wallpaper hints)
android.permission.signal_persistent_processes
允許程式請求發送信号到所有顯示的程序中(allowan application to request that a signal be sent to all persistent processes)
android.permission.status_bar
允許程式打開、關閉或禁用狀态欄及圖示allowsan application to open, close, or disable the status bar and its icons.
android.permission.subscribed_feeds_read
允許一個程式通路訂閱rssfeed内容提供(allows an applicationto allow access the subscribed feeds contentprovider. )
android.permission.subscribed_feeds_write
系統暫時保留改設定,android開發網認為未來版本會加入該功能。
android.permission.system_alert_window
允許一個程式打開視窗使用type_system_alert,顯示在其他所有程式的頂層(allowsan application to open windows using the type type_system_alert, shown on topof all other applications. )
android.permission.vibrate
允許通路振動裝置(allowsaccess to the vibrator)
android.permission.wake_lock
允許使用powermanager的 wakelocks保持程序在休眠時從螢幕消失(allows using powermanager wakelocks to keep
processor from sleeping or screen fromdimming)
android.permission.write_apn_settings
允許程式寫入api設定(allows applications to write the apnsettings)
android.permission.write_calendar
允許一個程式寫入但不讀取使用者月曆資料(allowsan application to write (but not read) the user’s calendar data. )
android.permission.write_contacts
允許程式寫入但不讀取使用者聯系人資料(allowsan application to write (but not read) the user’s contacts data. )
android.permission.write_gservices
允許程式修改google服務地圖(allows an application to modify thegoogle service map. )
android.permission.write_owner_data
允許一個程式寫入但不讀取所有者資料(allowsan application to write (but not read) the owner’s data.)
android.permission.write_settings
允許程式讀取或寫入系統設定(allowsan application to read or write the system settings. )
android.permission.write_sms
允許程式寫短信(allowsan application to write sms messages)
android.permission.write_sync_settings
允許程式寫入同步設定(allowsapplications to write the sync settings)
<permission>和 <uses-permission>的作用相似,兩者之間的不同之處, <uses-permission>是android預定義的權限, <permission>是自己定義的權限。 <permission>用的相對較少, <permission-group> <permission-tree>這兩個标簽就更少見了,簡單說 <permission-group> 就是聲明一個标簽,該标簽代表了一組permissions,而 <permission-tree>是為一組permissions聲明了一個namespace。