Some devices have broken tsp permissions, even without ear_detect_enable

This commit is contained in:
Pierre-Hugues Husson 2020-04-05 00:05:12 +02:00 committed by tboy1991
parent 264137a948
commit b2e61f3cf0

View File

@ -472,9 +472,8 @@ fi
if getprop ro.vendor.build.fingerprint | grep -qiE '^samsung/' && [ "$vndk" -ge 28 ];then if getprop ro.vendor.build.fingerprint | grep -qiE '^samsung/' && [ "$vndk" -ge 28 ];then
setprop persist.sys.phh.samsung_fingerprint 0 setprop persist.sys.phh.samsung_fingerprint 0
#obviously broken perms #obviously broken perms
if [ "$(stat -c '%A' /sys/class/sec/tsp/ear_detect_enable)" == "-rw-rw-r--" ] && if [ "$(stat -c '%U' /sys/class/sec/tsp/cmd)" == "root" ] &&
[ "$(stat -c '%U' /sys/class/sec/tsp/ear_detect_enable)" == "root" ] && [ "$(stat -c '%G' /sys/class/sec/tsp/cmd)" == "root" ];then
[ "$(stat -c '%G' /sys/class/sec/tsp/ear_detect_enable)" == "root" ];then
chcon u:object_r:sysfs_ss_writable:s0 /sys/class/sec/tsp/ear_detect_enable chcon u:object_r:sysfs_ss_writable:s0 /sys/class/sec/tsp/ear_detect_enable
chown system /sys/class/sec/tsp/ear_detect_enable chown system /sys/class/sec/tsp/ear_detect_enable
@ -484,7 +483,6 @@ if getprop ro.vendor.build.fingerprint | grep -qiE '^samsung/' && [ "$vndk" -ge
chown system /sys/class/power_supply/battery/wc_tx_en chown system /sys/class/power_supply/battery/wc_tx_en
chcon u:object_r:sysfs_app_writable:s0 /sys/class/power_supply/battery/wc_tx_en chcon u:object_r:sysfs_app_writable:s0 /sys/class/power_supply/battery/wc_tx_en
fi fi
if [ "$(stat -c '%U' /sys/class/sec/tsp/input/enabled)" == "root" ] && if [ "$(stat -c '%U' /sys/class/sec/tsp/input/enabled)" == "root" ] &&