Android 11添加所有特许权限白名单

环境

Android 11 SDK

需求

修改了一些内置的系统APP,添加了些权限后,会有可能导致烧录固件后一起重启问题,打logcat会有类似下面的错误打印:

023-11-08 11:36:23.854 4173-4173/system_process E/AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: main

java.lang.IllegalStateException: Signature|privileged permissions not in privapp-permissions whitelist: {com.xx(/system/priv-app/xx): android.permission.READ_PRIVILEGED_PHONE_STATE

每次添加一个权限,都有可能导致编译出错,要再添加一次,有些麻烦,需要一种一劳永逸的方法。

实现

修改frameworks/base/data/etc/privapp-permissions-platform.xml

为自定义内置系统应用APP添加绝大部分特许权限白名单

xml 复制代码
<permission name="android.intent.action.SIM_STATE_CHANGED" />
<permission name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<permission name="android.permission.ACCESS_CACHE_FILESYSTEM" />
<permission name="android.permission.ACCESS_CHECKIN_PROPERTIES"  />
<permission name="android.permission.ACCESS_COARSE_LOCATION" />
<permission name="android.permission.ACCESS_DOWNLOAD_MANAGER" />
<permission name="android.permission.ACCESS_FINE_LOCATION" />
<permission name="android.permission.ACCESS_IMS_CALL_SERVICE"/>
<permission name="android.permission.ACCESS_INSTANT_APPS" />
<permission name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<permission name="android.permission.ACCESS_LOWPAN_STATE"/>
<permission name="android.permission.ACCESS_MTP"/>
<permission name="android.permission.ACCESS_NETWORK_CONDITIONS"/>
<permission name="android.permission.ACCESS_NETWORK_STATE" />
<permission name="android.permission.ACCESS_NOTIFICATIONS" />
<permission name="android.permission.ACCESS_SHORTCUTS"/>
<permission name="android.permission.ACCESS_TV_DESCRAMBLER" />
<permission name="android.permission.ACCESS_TV_TUNER" />
<permission name="android.permission.ACCESS_VIBRATOR_STATE"/>
<permission name="android.permission.ACCESS_WIFI_STATE" />
<permission name="android.permission.ACCESS_WIMAX_STATE" />
<permission name="android.permission.ACTIVITY_EMBEDDING"/>
<permission name="android.permission.APPROVE_INCIDENT_REPORTS"/>
<permission name="android.permission.BACKUP"  />
<permission name="android.permission.BATTERY_STATS"  />
<permission name="android.permission.BIND_APPWIDGET"/>
<permission name="android.permission.BIND_CARRIER_MESSAGING_SERVICE"/>
<permission name="android.permission.BIND_CARRIER_SERVICES"/>
<permission name="android.permission.BIND_CELL_BROADCAST_SERVICE"/>
<permission name="android.permission.BIND_CONNECTION_SERVICE"/>
<permission name="android.permission.BIND_DIRECTORY_SEARCH"/>
<permission name="android.permission.BIND_EUICC_SERVICE" /> 
<permission name="android.permission.BIND_EXPLICIT_HEALTH_CHECK_SERVICE"/>
<permission name="android.permission.BIND_IMS_SERVICE"/>
<permission name="android.permission.BIND_INCALL_SERVICE"/>
<permission name="android.permission.BIND_TELEPHONY_DATA_SERVICE"/>
<permission name="android.permission.BIND_VISUAL_VOICEMAIL_SERVICE"/>
<permission name="android.permission.BLUETOOTH" />
<permission name="android.permission.BLUETOOTH_ADMIN" />
<permission name="android.permission.BLUETOOTH_ADVERTISE" />
<permission name="android.permission.BLUETOOTH_CONNECT" />
<permission name="android.permission.BLUETOOTH_PRIVILEGED" />
<permission name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS" />
<permission name="android.permission.BROADCAST_STICKY" />
<permission name="android.permission.CALL_PHONE" />
<permission name="android.permission.CALL_PRIVILEGED"/>
<permission name="android.permission.CAMERA" />
<permission name="android.permission.CAPTURE_AUDIO_OUTPUT" />
<permission name="android.permission.CHANGE_APP_IDLE_STATE"/>
<permission name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
<permission name="android.permission.CHANGE_CONFIGURATION"  />
<permission name="android.permission.CHANGE_CONFIGURATION"/>
<permission name="android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST" />
<permission name="android.permission.CHANGE_HDMI_CEC_ACTIVE_SOURCE"/>
<permission name="android.permission.CHANGE_LOWPAN_STATE"/>
<permission name="android.permission.CHANGE_NETWORK_STATE" />
<permission name="android.permission.CHANGE_OVERLAY_PACKAGES"/>
<permission name="android.permission.CHANGE_WIFI_STATE" />
<permission name="android.permission.CHANGE_WIMAX_STATE" />
<permission name="android.permission.CLEAR_APP_CACHE"/>
<permission name="android.permission.CLEAR_APP_USER_DATA"  />
<permission name="android.permission.COMPANION_APPROVE_WIFI_CONNECTIONS" />
<permission name="android.permission.CONFIGURE_INTERACT_ACROSS_PROFILES"/>
<permission name="android.permission.CONFIGURE_WIFI_DISPLAY"  />
<permission name="android.permission.CONNECTIVITY_INTERNAL"  />
<permission name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS"/>
<permission name="android.permission.CONTROL_DEVICE_LIGHTS" />
<permission name="android.permission.CONTROL_INCALL_EXPERIENCE"/>
<permission name="android.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS"/>
<permission name="android.permission.CONTROL_VPN"/>
<permission name="android.permission.COPY_PROTECTED_DATA"  />
<permission name="android.permission.CRYPT_KEEPER"/>
<permission name="android.permission.DELETE_CACHE_FILES" />
<permission name="android.permission.DELETE_PACKAGES" />
<permission name="android.permission.DEVICE_POWER" />
<permission name="android.permission.DISABLE_KEYGUARD" />
<permission name="android.permission.DUMP"/>
<permission name="android.permission.DVB_DEVICE"/>
<permission name="android.permission.ENTER_CAR_MODE_PRIORITIZED"/>
<permission name="android.permission.FORCE_STOP_PACKAGES"  />
<permission name="android.permission.FOREGROUND_SERVICE" />
<permission name="android.permission.GET_ACCOUNTS_PRIVILEGED"/>
<permission name="android.permission.GET_APP_OPS_STATS"/>
<permission name="android.permission.GET_TASKS" />
<permission name="android.permission.GLOBAL_SEARCH"/>
<permission name="android.permission.HANDLE_CAR_MODE_CHANGES"/>
<permission name="android.permission.HDMI_CEC"/>
<permission name="android.permission.INSTALL_DYNAMIC_SYSTEM"/>
<permission name="android.permission.INSTALL_LOCATION_PROVIDER"/>
<permission name="android.permission.INSTALL_PACKAGES" />
<permission name="android.permission.INTENT_FILTER_VERIFICATION_AGENT"/>
<permission name="android.permission.INTERACT_ACROSS_PROFILES"/>
<permission name="android.permission.INTERACT_ACROSS_USERS" />
<permission name="android.permission.INTERACT_ACROSS_USERS_FULL" />
<permission name="android.permission.INTERNET" />
<permission name="android.permission.LOADER_USAGE_STATS"/>
<permission name="android.permission.LOCAL_MAC_ADDRESS" />
<permission name="android.permission.LOCATION_HARDWARE" />
<permission name="android.permission.LOG_COMPAT_CHANGE" />
<permission name="android.permission.MANAGE_ACCESSIBILITY"/>
<permission name="android.permission.MANAGE_DEBUGGING" />
<permission name="android.permission.MANAGE_DEVICE_ADMINS"  />
<permission name="android.permission.MANAGE_DYNAMIC_SYSTEM"/>
<permission name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<permission name="android.permission.MANAGE_FINGERPRINT"/>
<permission name="android.permission.MANAGE_MEDIA_PROJECTION" />
<permission name="android.permission.MANAGE_NOTIFICATIONS"/>
<permission name="android.permission.MANAGE_ROLE_HOLDERS"/>
<permission name="android.permission.MANAGE_ROLLBACKS"/>
<permission name="android.permission.MANAGE_SUBSCRIPTION_PLANS"/>
<permission name="android.permission.MANAGE_USB"  />
<permission name="android.permission.MANAGE_USERS" />
<permission name="android.permission.MASTER_CLEAR" />
<permission name="android.permission.MODIFY_APPWIDGET_BIND_PERMISSIONS"/>
<permission name="android.permission.MODIFY_AUDIO_ROUTING" />
<permission name="android.permission.MODIFY_DAY_NIGHT_MODE"/>
<permission name="android.permission.MODIFY_DEFAULT_AUDIO_EFFECTS"/>
<permission name="android.permission.MODIFY_PARENTAL_CONTROLS"/>
<permission name="android.permission.MODIFY_PHONE_STATE" />
<permission name="android.permission.MONITOR_DEFAULT_SMS_PACKAGE" />
<permission name="android.permission.MOUNT_FORMAT_FILESYSTEMS"/>
<permission name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<permission name="android.permission.MOVE_PACKAGE"  />
<permission name="android.permission.NETWORK_BYPASS_PRIVATE_DNS"/>
<permission name="android.permission.NETWORK_MANAGED_PROVISIONING"/>
<permission name="android.permission.NETWORK_SCAN"/>
<permission name="android.permission.OBSERVE_APP_USAGE"/>
<permission name="android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS"/>
<permission name="android.permission.OVERRIDE_COMPAT_CHANGE_CONFIG" />
<permission name="android.permission.PACKAGE_USAGE_STATS" />
<permission name="android.permission.PACKET_KEEPALIVE_OFFLOAD" />
<permission name="android.permission.PERFORM_CDMA_PROVISIONING"/>
<permission name="android.permission.POWER_SAVER" />
<permission name="android.permission.PROVIDE_RESOLVER_RANKER_SERVICE" />
<permission name="android.permission.QUERY_ALL_PACKAGES" />
<permission name="android.permission.READ_CALL_LOG" />
<permission name="android.permission.READ_CARRIER_APP_INFO"/>
<permission name="android.permission.READ_COMPAT_CHANGE_CONFIG" />
<permission name="android.permission.READ_CONTACTS" />
<permission name="android.permission.READ_CONTENT_RATING_SYSTEMS"/>
<permission name="android.permission.READ_DREAM_STATE" />
<permission name="android.permission.READ_EXTERNAL_STORAGE" />
<permission name="android.permission.READ_FRAME_BUFFER"/>
<permission name="android.permission.READ_INSTALL_SESSIONS" />
<permission name="android.permission.READ_LOGS" />
<permission name="android.permission.READ_LOWPAN_CREDENTIAL"/>
<permission name="android.permission.READ_NETWORK_USAGE_HISTORY"/>
<permission name="android.permission.READ_OEM_UNLOCK_STATE"/>
<permission name="android.permission.READ_PHONE_STATE" />
<permission name="android.permission.READ_PRECISE_PHONE_STATE" />
<permission name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
<permission name="android.permission.READ_PROFILE" />
<permission name="android.permission.READ_SEARCH_INDEXABLES"/>
<permission name="android.permission.READ_SMS" />
<permission name="android.permission.READ_SYNC_SETTINGS" />
<permission name="android.permission.READ_SYNC_STATS" />
<permission name="android.permission.READ_USER_DICTIONARY" />
<permission name="android.permission.READ_WIFI_CREDENTIAL"/>
<permission name="android.permission.REAL_GET_TASKS"/>
<permission name="android.permission.REBOOT" />
<permission name="android.permission.RECEIVE_BOOT_COMPLETED" />
<permission name="android.permission.RECEIVE_DATA_ACTIVITY_CHANGE"/>
<permission name="android.permission.RECEIVE_EMERGENCY_BROADCAST"/>
<permission name="android.permission.RECEIVE_SMS" />
<permission name="android.permission.RECORD_AUDIO" />
<permission name="android.permission.RECOVERY" />
<permission name="android.permission.REGISTER_CALL_PROVIDER"/>
<permission name="android.permission.REGISTER_CONNECTION_MANAGER"/>
<permission name="android.permission.REGISTER_SIM_SUBSCRIPTION"/>
<permission name="android.permission.REGISTER_STATS_PULL_ATOM" />
<permission name="android.permission.REORDER_TASKS" />
<permission name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<permission name="android.permission.REQUEST_INCIDENT_REPORT_APPROVAL"/>
<permission name="android.permission.REQUEST_INSTALL_PACKAGES" />
<permission name="android.permission.REQUEST_NOTIFICATION_ASSISTANT_SERVICE" />
<permission name="android.permission.RETRIEVE_WINDOW_CONTENT"/>
<permission name="android.permission.SCHEDULE_EXACT_ALARM" />
<permission name="android.permission.SCORE_NETWORKS"/>
<permission name="android.permission.SEND_RESPOND_VIA_MESSAGE"/>
<permission name="android.permission.SET_ALWAYS_FINISH"/>
<permission name="android.permission.SET_ANIMATION_SCALE"/>
<permission name="android.permission.SET_DEBUG_APP"/>
<permission name="android.permission.SET_KEYBOARD_LAYOUT"  />
<permission name="android.permission.SET_POINTER_SPEED"  />
<permission name="android.permission.SET_PROCESS_LIMIT"/>
<permission name="android.permission.SET_TIME" />
<permission name="android.permission.SET_TIME_ZONE" />
<permission name="android.permission.SET_WALLPAPER" />
<permission name="android.permission.SET_WALLPAPER_COMPONENT" />
<permission name="android.permission.SHUTDOWN" />
<permission name="android.permission.SIGNAL_PERSISTENT_PROCESSES"/>
<permission name="android.permission.START_ACTIVITIES_FROM_BACKGROUND" />
<permission name="android.permission.START_TASKS_FROM_RECENTS" />
<permission name="android.permission.STATUS_BAR"  />
<permission name="android.permission.STATUS_BAR_SERVICE"/>
<permission name="android.permission.STOP_APP_SWITCHES"/>
<permission name="android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME" />
<permission name="android.permission.SUBSTITUTE_SHARE_TARGET_APP_NAME_AND_ICON"/>
<permission name="android.permission.SUGGEST_TELEPHONY_TIME_AND_ZONE"/>
<permission name="android.permission.SUSPEND_APPS" />
<permission name="android.permission.SYSTEM_ALERT_WINDOW" />
<permission name="android.permission.SYSTEM_CAMERA" />
<permission name="android.permission.SYSTEM_OVERLAY_WINDOW" />
<permission name="android.permission.TETHER_PRIVILEGED"/>
<permission name="android.permission.TUNER_RESOURCE_ACCESS" />
<permission name="android.permission.TV_INPUT_HARDWARE" />
<permission name="android.permission.UPDATE_APP_OPS_STATS"/>
<permission name="android.permission.UPDATE_DEVICE_STATS"/>
<permission name="android.permission.UPDATE_LOCK"/>
<permission name="android.permission.USE_CREDENTIALS" />
<permission name="android.permission.USE_FULL_SCREEN_INTENT" />
<permission name="android.permission.USE_RESERVED_DISK"/>
<permission name="android.permission.VIBRATE" />
<permission name="android.permission.WAKE_LOCK" />
<permission name="android.permission.WATCH_APPOPS"/>
<permission name="android.permission.WIFI_UPDATE_USABILITY_STATS_SCORE"/>
<permission name="android.permission.WRITE_APN_SETTINGS" />
<permission name="android.permission.WRITE_CONTACTS" />
<permission name="android.permission.WRITE_DREAM_STATE" />
<permission name="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS" /> 
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" />
<permission name="android.permission.WRITE_MEDIA_STORAGE" />
<permission name="android.permission.WRITE_SECURE_SETTINGS" />
<permission name="android.permission.WRITE_SETTINGS" />
<permission name="android.permission.WRITE_SYNC_SETTINGS" />
<permission name="android.permission.WRITE_USER_DICTIONARY" />
<permission name="com.android.certinstaller.INSTALL_AS_USER" />
<permission name="com.android.launcher.permission.READ_SETTINGS" />
<permission name="com.android.launcher.permission.WRITE_SETTINGS" />
<permission name="com.android.permission.BIND_EUICC_SERVICE" />
<permission name="com.android.permission.USE_INSTALLER_V2"/>
<permission name="com.android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS" />
<permission name="com.android.providers.tv.permission.ACCESS_ALL_EPG_DATA"/>
<permission name="com.android.providers.tv.permission.ACCESS_WATCHED_PROGRAMS"/>
<permission name="com.android.voicemail.permission.READ_VOICEMAIL"/>
<permission name="com.android.voicemail.permission.WRITE_VOICEMAIL"/>
<permission name="com.benew.ntt.camera.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION" />
<permission name="com.google.android.googleapps.permission.GOOGLE_AUTH" />
<permission name="com.qualcomm.permission.UIM_REMOTE_CLIENT" />
<permission name="redteamobile.permission.ACCESS_RBOOK_SERVIC" />

作者:帅得不敢出门 原创文章谢绝转载

相关推荐
数据猎手小k3 小时前
AndroidLab:一个系统化的Android代理框架,包含操作环境和可复现的基准测试,支持大型语言模型和多模态模型。
android·人工智能·机器学习·语言模型
你的小104 小时前
JavaWeb项目-----博客系统
android
风和先行4 小时前
adb 命令查看设备存储占用情况
android·adb
AaVictory.5 小时前
Android 开发 Java中 list实现 按照时间格式 yyyy-MM-dd HH:mm 顺序
android·java·list
似霰6 小时前
安卓智能指针sp、wp、RefBase浅析
android·c++·binder
大风起兮云飞扬丶6 小时前
Android——网络请求
android
干一行,爱一行6 小时前
android camera data -> surface 显示
android
断墨先生6 小时前
uniapp—android原生插件开发(3Android真机调试)
android·uni-app
无极程序员8 小时前
PHP常量
android·ide·android studio
萌面小侠Plus9 小时前
Android笔记(三十三):封装设备性能级别判断工具——低端机还是高端机
android·性能优化·kotlin·工具类·低端机