From c18eea71d7b441e8ba17f4ac5150324d3285db0f Mon Sep 17 00:00:00 2001 From: Kyle Tso Date: Wed, 28 Sep 2022 10:58:59 +0800 Subject: [PATCH] Set sepolicy for shell script of disabling contaminant detection (ported from Ib2e3cf498851c0c9e5e74aacc9bf391549c0ad1a) Bug: 244658328 Signed-off-by: Kyle Tso Change-Id: Idbfa55d4c7091ce2861600ff3881fcc7217ec662 Merged-In: Idbfa55d4c7091ce2861600ff3881fcc7217ec662 --- whitechapel_pro/disable-contaminant-detection-sh.te | 7 +++++++ whitechapel_pro/file_contexts | 1 + 2 files changed, 8 insertions(+) create mode 100644 whitechapel_pro/disable-contaminant-detection-sh.te diff --git a/whitechapel_pro/disable-contaminant-detection-sh.te b/whitechapel_pro/disable-contaminant-detection-sh.te new file mode 100644 index 00000000..95845a18 --- /dev/null +++ b/whitechapel_pro/disable-contaminant-detection-sh.te @@ -0,0 +1,7 @@ +type disable-contaminant-detection-sh, domain; +type disable-contaminant-detection-sh_exec, vendor_file_type, exec_type, file_type; +init_daemon_domain(disable-contaminant-detection-sh) + +allow disable-contaminant-detection-sh vendor_toolbox_exec:file execute_no_trans; +allow disable-contaminant-detection-sh sysfs_batteryinfo:dir r_dir_perms; +allow disable-contaminant-detection-sh sysfs_batteryinfo:file rw_file_perms; diff --git a/whitechapel_pro/file_contexts b/whitechapel_pro/file_contexts index e5467e81..83232f1e 100644 --- a/whitechapel_pro/file_contexts +++ b/whitechapel_pro/file_contexts @@ -44,6 +44,7 @@ /vendor/bin/hw/battery_mitigation u:object_r:battery_mitigation_exec:s0 /vendor/bin/hw/android\.hardware\.memtrack-service\.pixel u:object_r:hal_memtrack_default_exec:s0 /system_ext/bin/convert_to_ext4\.sh u:object_r:convert-to-ext4-sh_exec:s0 +/vendor/bin/hw/disable_contaminant_detection\.sh u:object_r:disable-contaminant-detection-sh_exec:s0 # Vendor Firmwares /vendor/firmware(/.*)? u:object_r:vendor_fw_file:s0