diff --git a/universal7885-common/sepolicy/vendor/file_contexts b/universal7885-common/sepolicy/vendor/file_contexts index d6f1541..1e3f0de 100644 --- a/universal7885-common/sepolicy/vendor/file_contexts +++ b/universal7885-common/sepolicy/vendor/file_contexts @@ -218,10 +218,7 @@ /(vendor|system/vendor)/firmware(/.*)? u:object_r:vendor_firmware_file:s0 # SamsungParts -/(vendor|system/vendor)/bin/hw/vendor\.eureka\.hardware\.battery@1\.0-service u:object_r:hal_battery_default_exec:s0 -/(vendor|system/vendor)/bin/hw/vendor\.eureka\.hardware\.flashlight@1\.0-service u:object_r:hal_flashlight_default_exec:s0 -/(vendor|system/vendor)/bin/hw/vendor\.eureka\.hardware\.gpu@1\.0-service u:object_r:hal_gpu_default_exec:s0 -/(vendor|system/vendor)/bin/hw/vendor\.eureka\.security\.selinux@1\.0-service u:object_r:hal_selinux_default_exec:s0 +/(vendor|system/vendor)/bin/hw/vendor\.eureka\.hardware\.parts@[0-9]\.[0-9]-service u:object_r:hal_parts_default_exec:s0 /dev/radio0 u:object_r:fm_radio_device:s0 /factory(/.*)? u:object_r:sec_efs_file:s0 diff --git a/universal7885-common/sepolicy/vendor/hal_battery_default.te b/universal7885-common/sepolicy/vendor/hal_battery_default.te deleted file mode 100644 index fce02e8..0000000 --- a/universal7885-common/sepolicy/vendor/hal_battery_default.te +++ /dev/null @@ -1,16 +0,0 @@ -type hal_battery_default, domain; -type hal_battery_default_exec, exec_type, file_type, vendor_file_type; -add_hwservice(hal_battery_default, hal_battery_hwservice); -init_daemon_domain(hal_battery_default); - -hwbinder_use(hal_battery_default); -get_prop(hal_battery_default, hwservicemanager_prop); - -allow hal_battery_default sysfs_sec_switch:dir { search }; -allow hal_battery_default sysfs_sec_switch_writable:file rw_file_perms; -allow hal_battery_default sysfs_battery_writable:file rw_file_perms; -allow hal_battery_default sysfs_sec_switch_writable:dir { search }; -allow hal_battery_default sysfs_battery_writable:dir { search }; -allow hal_battery_default sysfs_battery:dir { search }; -allow hal_battery_default sysfs_virtual:dir { search }; -allow hal_battery_default self:capability setuid; diff --git a/universal7885-common/sepolicy/vendor/hal_flashlight_default.te b/universal7885-common/sepolicy/vendor/hal_flashlight_default.te deleted file mode 100644 index 251e0df..0000000 --- a/universal7885-common/sepolicy/vendor/hal_flashlight_default.te +++ /dev/null @@ -1,11 +0,0 @@ -type hal_flashlight_default, domain; -type hal_flashlight_default_exec, exec_type, file_type, vendor_file_type; -add_hwservice(hal_flashlight_default, hal_flashlight_hwservice); -init_daemon_domain(hal_flashlight_default); - -hwbinder_use(hal_flashlight_default); -get_prop(hal_flashlight_default, hwservicemanager_prop); -allow hal_flashlight_default sysfs_flashlight:file { read open write getattr }; -allow hal_flashlight_default sysfs_flashlight:dir search; - -allow hal_flashlight_default sysfs_virtual:dir { search }; diff --git a/universal7885-common/sepolicy/vendor/hal_gpu_default.te b/universal7885-common/sepolicy/vendor/hal_gpu_default.te deleted file mode 100644 index 2080737..0000000 --- a/universal7885-common/sepolicy/vendor/hal_gpu_default.te +++ /dev/null @@ -1,9 +0,0 @@ -type hal_gpu_default, domain; -type hal_gpu_default_exec, exec_type, file_type, vendor_file_type; -add_hwservice(hal_gpu_default, hal_gpu_hwservice); -init_daemon_domain(hal_gpu_default); - -hwbinder_use(hal_gpu_default); -get_prop(hal_gpu_default, hwservicemanager_prop) -allow hal_gpu_default sysfs_gpu_tmu:file { read open write getattr }; -allow hal_gpu_default sysfs_gpu_tmu:dir search; diff --git a/universal7885-common/sepolicy/vendor/hal_parts_default.te b/universal7885-common/sepolicy/vendor/hal_parts_default.te new file mode 100644 index 0000000..13d3e6a --- /dev/null +++ b/universal7885-common/sepolicy/vendor/hal_parts_default.te @@ -0,0 +1,31 @@ +type hal_parts_default, domain; +type hal_parts_default_exec, exec_type, file_type, vendor_file_type; +add_hwservice(hal_parts_default, hal_parts_hwservice); +init_daemon_domain(hal_parts_default); + +hwbinder_use(hal_parts_default); +get_prop(hal_parts_default, hwservicemanager_prop); + +# Battery +allow hal_parts_default sysfs_sec_switch:dir { search }; +allow hal_parts_default sysfs_sec_switch_writable:file rw_file_perms; +allow hal_parts_default sysfs_battery_writable:file rw_file_perms; +allow hal_parts_default sysfs_sec_switch_writable:dir { search }; +allow hal_parts_default sysfs_battery_writable:dir { search }; +allow hal_parts_default sysfs_battery:dir { search }; +allow hal_parts_default sysfs_virtual:dir search; +allow hal_parts_default self:capability setuid; + +# FlashLight +allow hal_parts_default sysfs_flashlight:file { read open write getattr }; +allow hal_parts_default sysfs_flashlight:dir search; +allow hal_parts_default sysfs_virtual:dir search; + +# GPU +allow hal_parts_default sysfs_gpu_tmu:file { read open write getattr }; +allow hal_parts_default sysfs_gpu_tmu:dir search; + +# SELinux +allow hal_parts_default selinuxfs:file rw_file_perms; +allow hal_parts_default selinuxfs:dir search; + diff --git a/universal7885-common/sepolicy/vendor/hal_selinux_default.te b/universal7885-common/sepolicy/vendor/hal_selinux_default.te deleted file mode 100644 index 71ff127..0000000 --- a/universal7885-common/sepolicy/vendor/hal_selinux_default.te +++ /dev/null @@ -1,9 +0,0 @@ -type hal_selinux_default, domain; -type hal_selinux_default_exec, exec_type, file_type, vendor_file_type; -add_hwservice(hal_selinux_default, hal_selinux_hwservice); -init_daemon_domain(hal_selinux_default); - -hwbinder_use(hal_selinux_default) -get_prop(hal_selinux_default, hwservicemanager_prop) -allow hal_selinux_default selinuxfs:file rw_file_perms; -allow hal_selinux_default selinuxfs:dir search; diff --git a/universal7885-common/sepolicy/vendor/hwservice.te b/universal7885-common/sepolicy/vendor/hwservice.te index 78081c2..c7f36ef 100644 --- a/universal7885-common/sepolicy/vendor/hwservice.te +++ b/universal7885-common/sepolicy/vendor/hwservice.te @@ -1,7 +1,4 @@ type rild_hwservice, hwservice_manager_type; -type hal_battery_hwservice, hwservice_manager_type; -type hal_flashlight_hwservice, hwservice_manager_type; -type hal_gpu_hwservice, hwservice_manager_type; -type hal_selinux_hwservice, hwservice_manager_type; +type hal_parts_hwservice, hwservice_manager_type; type hal_vendor_configstore_hwservice, hwservice_manager_type; type hal_vendor_surfaceflinger_hwservice, hwservice_manager_type; diff --git a/universal7885-common/sepolicy/vendor/hwservice_contexts b/universal7885-common/sepolicy/vendor/hwservice_contexts index 999e520..6030a98 100644 --- a/universal7885-common/sepolicy/vendor/hwservice_contexts +++ b/universal7885-common/sepolicy/vendor/hwservice_contexts @@ -5,10 +5,10 @@ vendor.samsung.hardware.radio.channel::ISehChannel u:object_r:rild_hwse vendor.lineage.power::ILineagePower u:object_r:hal_power_hwservice:s0 # SamsungParts -vendor.eureka.hardware.battery::IBattery u:object_r:hal_battery_hwservice:s0 -vendor.eureka.hardware.flashlight::IFlashlight u:object_r:hal_flashlight_hwservice:s0 -vendor.eureka.hardware.gpu::IGpu u:object_r:hal_gpu_hwservice:s0 -vendor.eureka.security.selinux::ISELinux u:object_r:hal_selinux_hwservice:s0 +vendor.eureka.hardware.parts::IBattery u:object_r:hal_parts_hwservice:s0 +vendor.eureka.hardware.parts::IFlashLight u:object_r:hal_parts_hwservice:s0 +vendor.eureka.hardware.parts::IGpu u:object_r:hal_parts_hwservice:s0 +vendor.eureka.security.parts::ISELinux u:object_r:hal_parts_hwservice:s0 vendor.samsung_slsi.hardware.ExynosHWCServiceTW::IExynosHWCServiceTW u:object_r:hal_vendor_surfaceflinger_hwservice:s0 vendor.samsung_slsi.hardware.configstore::IExynosHWCConfigs u:object_r:hal_vendor_configstore_hwservice:s0 diff --git a/universal7885-common/sepolicy/vendor/system_app.te b/universal7885-common/sepolicy/vendor/system_app.te index 2a4fa02..ebb7e61 100644 --- a/universal7885-common/sepolicy/vendor/system_app.te +++ b/universal7885-common/sepolicy/vendor/system_app.te @@ -12,16 +12,9 @@ allow system_app sysfs_battery_info:file { read open getattr }; r_dir_file(system_app, sysfs_battery_info) # SamsungParts -# -allow system_app hal_battery_hwservice:hwservice_manager find; -allow system_app hal_flashlight_hwservice:hwservice_manager find; -allow system_app hal_selinux_hwservice:hwservice_manager find; -allow system_app hal_gpu_hwservice:hwservice_manager find; +allow system_app hal_parts_hwservice:hwservice_manager find; -allow system_app hal_battery_default:binder call; -allow system_app hal_flashlight_default:binder call; -allow system_app hal_selinux_default:binder call; -allow system_app hal_gpu_default:binder call; +allow system_app hal_parts_default:binder call; allow system_app fm_radio_device:chr_file { read write open ioctl };