diff --git a/recovery/root/init.recovery.qcom.rc b/recovery/root/init.recovery.qcom.rc index 6de4855..e6e9d58 100644 --- a/recovery/root/init.recovery.qcom.rc +++ b/recovery/root/init.recovery.qcom.rc @@ -45,3 +45,21 @@ on fs on late-init start boot-hal-1-0 start health-hal-2-0 + start set_permissive + +on post-fs-data + start preptouch + +service set_permissive /system/bin/permissive.sh + disabled + user root + group root + oneshot + seclabel u:r:recovery:s0 + +service preptouch /system/bin/preptouch.sh + disabled + user root + group root + oneshot + seclabel u:r:recovery:s0 diff --git a/recovery/root/system/bin/permissive.sh b/recovery/root/system/bin/permissive.sh new file mode 100755 index 0000000..f1046f9 --- /dev/null +++ b/recovery/root/system/bin/permissive.sh @@ -0,0 +1,8 @@ +#!/sbin/sh + +# We use this shell script because the script will follow symlinks and +# different trees will use different binaries to supply the setenforce +# tool. Before M we use toolbox, M and beyond will use toybox. The init +# binary and init.rc will not follow symlinks. + +setenforce 0 diff --git a/recovery/root/system/bin/preptouch.sh b/recovery/root/system/bin/preptouch.sh new file mode 100755 index 0000000..4b45b1e --- /dev/null +++ b/recovery/root/system/bin/preptouch.sh @@ -0,0 +1,47 @@ +#!/sbin/sh +# +# Copyright (c) 2019-2020 Martin Dünkelmann +# All rights reserved. +# +# We use this shell script because the script will follow symlinks and +# different trees will use different binaries to supply the setenforce +# tool. Before M we use toolbox, M and beyond will use toybox. The init +# binary and init.rc will not follow symlinks. + +touch_id=`cat /sys/devices/dsi_panel_driver/panel_id` + +#XZ2 "3" XZ2C "4" Clearpad +if [[ "$touch_id" == "3" ]] || [[ "$touch_id" == "4" ]]; then + insmod /sbin/clearpad_rmi_dev.ko + insmod /sbin/clearpad_core.ko + insmod /sbin/clearpad_i2c.ko + + echo 1 > /sys/devices/virtual/input/clearpad/post_probe_start +fi + +#XZ2 "7" XZ2C "8" TCM +if [[ "$touch_id" == "7" ]] || [[ "$touch_id" == "8" ]]; then + insmod /sbin/synaptics_tcm_i2c.ko + insmod /sbin/synaptics_tcm_core.ko + insmod /sbin/synaptics_tcm_touch.ko + insmod /sbin/synaptics_tcm_device.ko + insmod /sbin/synaptics_tcm_testing.ko + insmod /sbin/synaptics_tcm_reflash.ko + insmod /sbin/synaptics_tcm_recovery.ko + insmod /sbin/synaptics_tcm_diagnostics.ko +fi + +#XZ2P SSW +if [[ "$touch_id" == "9" ]]; then + insmod /sbin/ssw49501.ko + insmod /sbin/ssw_mon.ko + + echo 1 > /sys/devices/virtual/input/siw_touch_input/init_late_session +fi + +#XZ3 ATMEL +if [[ "$touch_id" == "5" ]]; then + insmod /sbin/atmel_mxt640u.ko + + echo 1 > /sys/devices/virtual/input/lge_touch/charge_out +fi