diff --git a/adbd.te b/adbd.te index 8f2ac302c74fe2e11a67abb3d6cccffe3b830082..4f332b3579245dd233431f80c3d375426de493e1 100644 --- a/adbd.te +++ b/adbd.te @@ -6,3 +6,11 @@ unconfined_domain(adbd) domain_auto_trans(adbd, shell_exec, shell) # this is an entrypoint allow adbd rootfs:file entrypoint; + +# Read /data/misc/adb/adb_keys. +allow adbd adb_keys_file:dir search; +allow adbd adb_keys_file:file r_file_perms; + +# Allow access in case /data/misc/adb still has the old type. +allow adbd system_data_file:dir search; +allow adbd system_data_file:file r_file_perms; diff --git a/file.te b/file.te index 44b7516212bc045fe12f640593e95242f8aa2489..a6868bf0c16687daa295e837b3d634d3f6196826 100644 --- a/file.te +++ b/file.te @@ -54,6 +54,7 @@ type wifi_data_file, file_type, data_file_type; type radio_data_file, file_type, data_file_type; type nfc_data_file, file_type, data_file_type; type camera_calibration_file, file_type, data_file_type; +type adb_keys_file, file_type, data_file_type; # /data/data subdirectories - app sandboxes type app_data_file, file_type, data_file_type; type platform_app_data_file, file_type, data_file_type, mlstrustedobject; diff --git a/file_contexts b/file_contexts index 1e4b5a66698aecaaa0d9e94da3d2a4b78d2cfded..c4c4a094ec68d7f1d81eb0117f22e8798472ea46 100644 --- a/file_contexts +++ b/file_contexts @@ -3,7 +3,7 @@ / u:object_r:rootfs:s0 # Data files -/adb_keys u:object_r:rootfs:s0 +/adb_keys u:object_r:adb_keys_file:s0 /default.prop u:object_r:rootfs:s0 /fstab\..* u:object_r:rootfs:s0 /init\..* u:object_r:rootfs:s0 @@ -175,6 +175,7 @@ /data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0 /data/misc/camera(/.*)? u:object_r:camera_calibration_file:s0 /data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0 +/data/misc/adb(/.*)? u:object_r:adb_keys_file:s0 # App sandboxes /data/data/.* u:object_r:app_data_file:s0 # Wallpaper file.