gpt4 book ai didi

android - Android 7.0版本的权限数怎么统计最准确?

转载 作者:搜寻专家 更新时间:2023-11-01 07:46:55 24 4
gpt4 key购买 nike

根据我在网上的研究,我发现要统计最新版本的Android(Android 7)的权限数量,我们可以引用此链接中建议的官方文档(https://developer.android.com/reference/android/Manifest.permission.html)。

提议的表包含 138 个权限,这是我认为我的计数是正确的,直到我使用 github 上的这个小解析程序扫描的 Android 操作系统的 AndroidManifest.xml(https://android.googlesource.com/platform/frameworks/base/+/android-7.0.0_r29/core/res/AndroidManifest.xml)文件分析(https://github.com/benjholla/AndroidPermissionAttributeMapper) ).

生成的输出文件是:

android.permission-group.CONTACTS:
3 Permissions
android.permission.READ_CONTACTS
android.permission.GET_ACCOUNTS
android.permission.WRITE_CONTACTS
NO PERMISSION GROUP FOUND:
320 Permissions
android.permission.ALLOW_ANY_CODEC_FOR_PLAYBACK
android.permission.DIAGNOSTIC
android.permission.INTERACT_ACROSS_USERS
android.permission.SIGNAL_PERSISTENT_PROCESSES
android.permission.START_TASKS_FROM_RECENTS
android.permission.BIND_SCREENING_SERVICE
android.permission.SET_TIME_ZONE
com.android.browser.permission.WRITE_HISTORY_BOOKMARKS
android.permission.REGISTER_SIM_SUBSCRIPTION
android.permission.USER_ACTIVITY
android.permission.RECEIVE_MEDIA_RESOURCE_USAGE
android.permission.TABLET_MODE
android.permission.SUBSCRIBED_FEEDS_READ
android.permission.BIND_TV_REMOTE_SERVICE
android.permission.CONTROL_INCALL_EXPERIENCE
android.permission.MASTER_CLEAR
android.permission.WAKE_LOCK
android.permission.HDMI_CEC
android.permission.MODIFY_CELL_BROADCASTS
android.permission.MANAGE_USERS
android.permission.BIND_VOICE_INTERACTION
android.permission.GRANT_RUNTIME_PERMISSIONS
android.permission.BIND_RUNTIME_PERMISSION_PRESENTER_SERVICE
android.permission.PACKAGE_USAGE_STATS
android.permission.BLUETOOTH_MAP
android.permission.GET_PACKAGE_SIZE
android.permission.BIND_TELECOM_CONNECTION_SERVICE
android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST
com.android.alarm.permission.SET_ALARM
android.permission.SET_WALLPAPER_HINTS
android.permission.DEVICE_POWER
android.permission.UPDATE_CONFIG
android.permission.INTERNET
android.permission.INJECT_EVENTS
android.permission.UPDATE_LOCK_TASK_PACKAGES
android.permission.RECEIVE_EMERGENCY_BROADCAST
android.permission.RETRIEVE_WINDOW_TOKEN
android.permission.CAMERA_DISABLE_TRANSMIT_LED
android.permission.SET_WALLPAPER
android.permission.BIND_PRINT_SERVICE
android.permission.READ_LOGS
android.permission.REMOVE_TASKS
android.permission.READ_SYNC_SETTINGS
android.permission.ACCESS_MTP
android.permission.AUTHENTICATE_ACCOUNTS
android.permission.CONTROL_LOCATION_UPDATES
android.permission.READ_PROFILE
android.permission.CRYPT_KEEPER
android.permission.RECEIVE_BOOT_COMPLETED
android.permission.READ_FRAME_BUFFER
com.android.launcher.permission.UNINSTALL_SHORTCUT
android.permission.CONTROL_VPN
android.permission.BIND_DIRECTORY_SEARCH
android.permission.SCORE_NETWORKS
android.permission.BIND_MIDI_DEVICE_SERVICE
android.permission.GET_APP_OPS_STATS
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.GET_APP_GRANTED_URI_PERMISSIONS
android.permission.SEND_RESPOND_VIA_MESSAGE
android.permission.MANAGE_ACTIVITY_STACKS
android.permission.CHANGE_CONFIGURATION
android.permission.VIBRATE
android.permission.GET_TOP_ACTIVITY_INFO
android.permission.GET_PROCESS_STATE_AND_OOM_SCORE
android.permission.WRITE_SYNC_SETTINGS
android.permission.RESTART_PACKAGES
android.permission.KILL_BACKGROUND_PROCESSES
android.permission.HARDWARE_TEST
android.permission.BIND_TRUST_AGENT
android.permission.FORCE_STOP_PACKAGES
android.permission.READ_NETWORK_USAGE_HISTORY
android.permission.READ_PRECISE_PHONE_STATE
android.permission.READ_BLOCKED_NUMBERS
android.permission.READ_WIFI_CREDENTIAL
android.permission.RESET_SHORTCUT_MANAGER_THROTTLING
android.permission.MOVE_PACKAGE
android.permission.BLUETOOTH
android.permission.SERIAL_PORT
com.android.voicemail.permission.WRITE_VOICEMAIL
android.permission.WRITE_USER_DICTIONARY
android.permission.ACCESS_WIMAX_STATE
android.permission.SET_SCREEN_COMPATIBILITY
android.permission.ACCESS_VR_MANAGER
android.permission.BLUETOOTH_STACK
android.permission.BIND_INCALL_SERVICE
android.permission.BIND_PRINT_RECOMMENDATION_SERVICE
android.permission.INSTALL_PACKAGES
android.permission.BIND_VR_LISTENER_SERVICE
android.permission.SET_PREFERRED_APPLICATIONS
android.permission.BIND_TV_INPUT
android.permission.GET_DETAILED_TASKS
android.permission.SET_PROCESS_LIMIT
android.permission.WRITE_PROFILE
android.permission.RECEIVE_BLUETOOTH_MAP
android.permission.ACCESS_WIFI_STATE
android.permission.LAUNCH_TRUST_AGENT_SETTINGS
android.permission.BIND_ROUTE_PROVIDER
android.permission.REGISTER_WINDOW_MANAGER_LISTENERS
com.android.voicemail.permission.READ_VOICEMAIL
android.permission.INTERNAL_SYSTEM_WINDOW
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
android.permission.SET_POINTER_SPEED
android.permission.READ_OEM_UNLOCK_STATE
android.permission.OEM_UNLOCK_STATE
android.permission.NOTIFY_PENDING_SYSTEM_UPDATE
android.permission.WRITE_DREAM_STATE
android.permission.CONTROL_KEYGUARD
android.permission.RETRIEVE_WINDOW_CONTENT
android.permission.BIND_DREAM_SERVICE
android.permission.LOCAL_MAC_ADDRESS
android.permission.PACKET_KEEPALIVE_OFFLOAD
android.permission.ACCESS_INPUT_FLINGER
android.permission.FLASHLIGHT
android.permission.CAPTURE_TV_INPUT
android.permission.EXPAND_STATUS_BAR
android.permission.ACCESS_SURFACE_FLINGER
android.permission.ASEC_CREATE
android.permission.READ_DREAM_STATE
android.permission.BIND_INPUT_METHOD
android.permission.RECEIVE_DATA_ACTIVITY_CHANGE
android.permission.BIND_NFC_SERVICE
android.permission.GLOBAL_SEARCH_CONTROL
android.permission.ACCESS_PDB_STATE
android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS
android.permission.UPDATE_LOCK
android.permission.DUMP
android.permission.MANAGE_NETWORK_POLICY
android.permission.ACCESS_NOTIFICATIONS
android.permission.ACCESS_FM_RADIO
android.permission.CARRIER_FILTER_SMS
android.permission.BIND_TEXT_SERVICE
android.permission.CONFIRM_FULL_BACKUP
android.permission.ASEC_MOUNT_UNMOUNT
android.permission.BACKUP
android.permission.TRUST_LISTENER
android.permission.SET_ACTIVITY_WATCHER
android.permission.BIND_REMOTE_DISPLAY
android.permission.PERFORM_SIM_ACTIVATION
android.permission.CAPTURE_AUDIO_HOTWORD
android.permission.READ_SEARCH_INDEXABLES
android.permission.ASEC_ACCESS
android.permission.SET_ORIENTATION
android.permission.BIND_CONDITION_PROVIDER_SERVICE
android.permission.USE_CREDENTIALS
android.permission.STATUS_BAR_SERVICE
android.permission.FACTORY_TEST
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.CHANGE_NETWORK_STATE
android.intent.category.MASTER_CLEAR.permission.C2D_MESSAGE
android.permission.MODIFY_AUDIO_SETTINGS
android.permission.DVB_DEVICE
android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
android.permission.BIND_DEVICE_ADMIN
android.permission.SEND_SMS_NO_CONFIRMATION
android.permission.BLUETOOTH_PRIVILEGED
android.permission.MODIFY_PHONE_STATE
android.permission.CAPTURE_AUDIO_OUTPUT
android.permission.CONFIGURE_DISPLAY_COLOR_TRANSFORM
android.permission.MODIFY_APPWIDGET_BIND_PERMISSIONS
android.permission.SHUTDOWN
android.permission.NET_ADMIN
android.permission.DELETE_CACHE_FILES
android.permission.READ_USER_DICTIONARY
android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS
android.permission.BROADCAST_NETWORK_PRIVILEGED
android.permission.CAMERA_SEND_SYSTEM_EVENTS
android.permission.INTERACT_ACROSS_USERS_FULL
android.permission.MANAGE_NOTIFICATIONS
android.permission.MODIFY_PARENTAL_CONTROLS
android.permission.OVERRIDE_WIFI_CONFIG
android.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS
android.permission.DISABLE_KEYGUARD
android.permission.CHANGE_APP_IDLE_STATE
android.permission.BIND_NOTIFICATION_LISTENER_SERVICE
android.permission.ACCESS_NETWORK_CONDITIONS
android.permission.BIND_NOTIFICATION_RANKER_SERVICE
android.permission.CALL_PRIVILEGED
android.permission.BIND_INTENT_FILTER_VERIFIER
android.permission.RECEIVE_STK_COMMANDS
android.permission.MANAGE_USB
android.permission.CAPTURE_VIDEO_OUTPUT
android.permission.MODIFY_AUDIO_ROUTING
android.permission.MANAGE_SOUND_TRIGGER
android.permission.CHANGE_WIFI_STATE
android.permission.GET_TASKS
android.permission.TV_INPUT_HARDWARE
android.permission.SET_WALLPAPER_COMPONENT
android.permission.SET_TIME
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.MANAGE_MEDIA_PROJECTION
android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME
android.permission.TV_VIRTUAL_REMOTE_CONTROLLER
android.permission.DISPATCH_PROVISIONING_MESSAGE
android.permission.CAPTURE_SECURE_VIDEO_OUTPUT
android.permission.UPDATE_APP_OPS_STATS
android.permission.BROADCAST_SMS
android.permission.CHANGE_BACKGROUND_DATA_SETTING
android.permission.REMOVE_DRM_CERTIFICATES
android.permission.BLUETOOTH_ADMIN
android.permission.WRITE_GSERVICES
android.permission.MANAGE_CA_CERTIFICATES
android.permission.NFC
android.permission.START_ANY_ACTIVITY
android.permission.CHANGE_COMPONENT_ENABLED_STATE
android.permission.TETHER_PRIVILEGED
android.permission.CHANGE_WIMAX_STATE
android.permission.PEERS_MAC_ADDRESS
android.permission.DISPATCH_NFC_MESSAGE
android.permission.ACCESS_NOTIFICATION_POLICY
android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
android.permission.LOCATION_HARDWARE
android.permission.REMOTE_AUDIO_PLAYBACK
com.android.launcher.permission.INSTALL_SHORTCUT
android.permission.MOUNT_FORMAT_FILESYSTEMS
android.permission.RESET_FINGERPRINT_LOCKOUT
android.permission.WRITE_SMS
android.permission.NET_TUNNELING
android.permission.STATUS_BAR
android.permission.COPY_PROTECTED_DATA
android.permission.QUERY_DO_NOT_ASK_CREDENTIALS_ON_BOOT
android.permission.REORDER_TASKS
android.permission.BIND_PACKAGE_VERIFIER
android.permission.BIND_KEYGUARD_APPWIDGET
android.permission.TEMPORARY_ENABLE_ACCESSIBILITY
android.permission.MANAGE_FINGERPRINT
android.permission.READ_PRIVILEGED_PHONE_STATE
android.permission.ASEC_DESTROY
android.permission.REVOKE_RUNTIME_PERMISSIONS
android.permission.REAL_GET_TASKS
android.permission.BIND_ACCESSIBILITY_SERVICE
android.permission.FRAME_STATS
android.permission.MANAGE_VOICE_KEYPHRASES
android.permission.ACCOUNT_MANAGER
android.permission.STORAGE_INTERNAL
android.permission.READ_INSTALL_SESSIONS
android.permission.GET_ACCOUNTS_PRIVILEGED
android.permission.MANAGE_APP_OPS_RESTRICTIONS
android.permission.ACCESS_MOCK_LOCATION
android.permission.GET_PASSWORD
android.permission.GLOBAL_SEARCH
android.permission.TRANSMIT_IR
android.permission.MANAGE_DEVICE_ADMINS
android.permission.BROADCAST_WAP_PUSH
android.permission.INTENT_FILTER_VERIFICATION_AGENT
android.permission.MEDIA_CONTENT_CONTROL
android.permission.MANAGE_DOCUMENTS
android.permission.PROVIDE_TRUST_AGENT
android.permission.BIND_CARRIER_MESSAGING_SERVICE
android.permission.WRITE_MEDIA_STORAGE
com.android.browser.permission.READ_HISTORY_BOOKMARKS
android.permission.SET_ALWAYS_FINISH
android.permission.REBOOT
android.permission.CONNECTIVITY_INTERNAL
android.permission.BIND_CARRIER_SERVICES
android.permission.CONTROL_WIFI_DISPLAY
android.permission.GET_INTENT_SENDER_INTENT
android.permission.LOOP_RADIO
android.permission.BIND_CONNECTION_SERVICE
android.permission.CACHE_CONTENT
android.permission.WRITE_SECURE_SETTINGS
android.permission.MANAGE_APP_TOKENS
android.permission.SUBSCRIBED_FEEDS_WRITE
android.permission.MANAGE_ACCOUNTS
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.WRITE_APN_SETTINGS
android.permission.CLEAR_APP_CACHE
android.permission.BRICK
android.permission.WRITE_SOCIAL_STREAM
android.permission.BIND_PRINT_SPOOLER_SERVICE
android.permission.WRITE_BLOCKED_NUMBERS
android.permission.PACKAGE_VERIFICATION_AGENT
android.permission.MODIFY_DAY_NIGHT_MODE
android.permission.CHANGE_WIFI_MULTICAST_STATE
android.permission.BIND_VPN_SERVICE
android.permission.CONFIGURE_WIFI_DISPLAY
android.permission.MODIFY_NETWORK_ACCOUNTING
android.permission.REQUEST_INSTALL_PACKAGES
android.permission.BROADCAST_PACKAGE_REMOVED
android.permission.REGISTER_CONNECTION_MANAGER
android.permission.READ_SYNC_STATS
android.permission.BROADCAST_STICKY
android.permission.INSTALL_LOCATION_PROVIDER
android.permission.REGISTER_CALL_PROVIDER
android.permission.KILL_UID
android.permission.INVOKE_CARRIER_SETUP
android.permission.BIND_JOB_SERVICE
android.permission.SET_INPUT_CALIBRATION
android.permission.READ_SOCIAL_STREAM
android.permission.UPDATE_DEVICE_STATS
android.permission.READ_INPUT_STATE
android.permission.SET_DEBUG_APP
android.permission.BIND_WALLPAPER
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.RECOVERY
android.permission.SYSTEM_ALERT_WINDOW
android.permission.CREATE_USERS
android.permission.SET_KEYBOARD_LAYOUT
android.permission.CLEAR_APP_USER_DATA
android.permission.FILTER_EVENTS
android.permission.BIND_REMOTEVIEWS
android.permission.BIND_QUICK_SETTINGS_TILE
android.permission.STOP_APP_SWITCHES
android.permission.BIND_CHOOSER_TARGET_SERVICE
android.permission.ACCESS_VOICE_INTERACTION_SERVICE
android.permission.RECEIVE_WIFI_CREDENTIAL_CHANGE
android.permission.SET_ANIMATION_SCALE
android.permission.PERSISTENT_ACTIVITY
android.permission.ACCESS_NETWORK_STATE
android.permission.BATTERY_STATS
android.permission.FREEZE_SCREEN
android.permission.DELETE_PACKAGES
android.permission.CLEAR_APP_GRANTED_URI_PERMISSIONS
android.permission.PERFORM_CDMA_PROVISIONING
android.permission.ASEC_RENAME
android.permission.GET_PACKAGE_IMPORTANCE
android.permission.FORCE_BACK
android.permission.BIND_APPWIDGET
android.permission.NFC_HANDOVER_STATUS
android.permission.WRITE_SETTINGS
android.permission.ACCESS_KEYGUARD_SECURE_STORAGE
android.permission-group.STORAGE:
2 Permissions
android.permission.READ_EXTERNAL_STORAGE
android.permission.WRITE_EXTERNAL_STORAGE
android.permission-group.PHONE:
10 Permissions
android.permission.USE_SIP
android.permission.ACCESS_UCE_PRESENCE_SERVICE
android.permission.CALL_PHONE
com.android.voicemail.permission.ADD_VOICEMAIL
android.permission.ACCESS_UCE_OPTIONS_SERVICE
android.permission.READ_CALL_LOG
android.permission.WRITE_CALL_LOG
android.permission.PROCESS_OUTGOING_CALLS
android.permission.ACCESS_IMS_CALL_SERVICE
android.permission.READ_PHONE_STATE
android.permission-group.LOCATION:
2 Permissions
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_COARSE_LOCATION
android.permission-group.MICROPHONE:
1 Permissions
android.permission.RECORD_AUDIO
android.permission-group.SENSORS:
2 Permissions
android.permission.BODY_SENSORS
android.permission.USE_FINGERPRINT
android.permission-group.SMS:
6 Permissions
android.permission.SEND_SMS
android.permission.RECEIVE_SMS
android.permission.READ_SMS
android.permission.RECEIVE_WAP_PUSH
android.permission.READ_CELL_BROADCASTS
android.permission.RECEIVE_MMS
android.permission-group.CAMERA:
1 Permissions
android.permission.CAMERA
android.permission-group.CALENDAR:
2 Permissions
android.permission.WRITE_CALENDAR
android.permission.READ_CALENDAR

可以看到,检测到的权限数量远远超过文档中引用的数量,AndroidManifest.xml中列出的权限和文档中不存在的权限,例如:android.permission.ALLOW_ANY_CODEC_FOR_PLAYBACK,android.permission .ACCESS_FM_RADIO!

我的分析有什么错误?我到底要的是Android 7向开发者提出的权限数,是138个权限还是更多?如果它更多,如果我基于 AndroidManifest.xml 文件,我该如何计算它们?

感谢您的帮助。

最佳答案

What I want in the end is the number of permissions proposed to developers in Android 7, is that 138 permissions or more?

不清楚您所说的“向开发人员提议的权限数量”是什么意思。

如果您指的是“在 Android 7.0 设备上定义的权限数”,答案是 ¯\_(ツ)_/¯ ,因为应用可以定义自己的权限。

如果您的意思是“出厂时在 Android 7.0 设备上定义的权限数”,答案是 ¯\_(ツ)_/¯ ,因为制造商的预装应用可以定义自己的权限。

如果您的意思是“出厂时在 Android 7.0 设备上定义的权限数量,不包括预装应用程序的权限”,答案是 ¯\_(ツ)_/¯ ,作为制造商(或自定义 ROM 开发人员)可以修改 the platform AndroidManifest.xml file .

如果您的意思是“在 Android 7.0 版本的 Android 开源项目中定义的权限数量,并且不计算任何 AOSP 应用程序(如设置)”,那将是 <permission> 的数量。平台中的元素AndroidManifest.xml文件至少。现在,那是 300+(我的计数是 353,基于 master 分支)。

如果您的意思是“在 Android 7.0 上工作的普通应用程序开发人员将处理的权限数量”,那将是 Manifest.permission 中记录的权限。 JavaDocs,这将是平台中定义的那些的一小部分 AndroidManifest.xml文件。例如,ACCESS_FM_RADIO是您在 list 中引用但不在文档中的一个——那是​​因为它有 @hide注释:

<!-- @SystemApi Allows access to FM
@hide This is not a third-party API (intended for system apps).-->
<permission android:name="android.permission.ACCESS_FM_RADIO"
android:protectionLevel="signature|privileged" />

在平台 Java 类中,@hide - 作为构建的一部分,带注释的元素已从 SDK 中删除 android.jar .同样,@hide - 带注释的 list 元素也会从 SDK 中删除,即使它们应该存在于设备上也是如此。

FWIW,my PermissionReporter sample app使用 PackageManager查找 Android 设备上所有已定义的权限,并根据保护级别将它们列在选项卡中。因此,例如 ACCESS_FM_RADIO出现在 Android 7.1.1 设备上。

关于android - Android 7.0版本的权限数怎么统计最准确?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42149127/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com