diff --git a/device.mk b/device.mk index 280a48d..36764aa 100644 --- a/device.mk +++ b/device.mk @@ -265,6 +265,7 @@ PRODUCT_PACKAGES += \ init.qcom.sh \ init.qcom.usb.rc \ init.qcom.usb.sh \ + init.sim.restart.sh \ init.target.rc \ ueventd.oplus.rc \ ueventd.qcom.rc diff --git a/init/Android.bp b/init/Android.bp index 6358f9e..105aadf 100644 --- a/init/Android.bp +++ b/init/Android.bp @@ -76,3 +76,8 @@ sh_binary { src: "init.qcom.sh", vendor: true, } + +sh_binary { + name: "init.sim.restart.sh", + src: "init.sim.restart.sh", +} \ No newline at end of file diff --git a/init/init.oplus.rc b/init/init.oplus.rc index edb1745..6057a57 100644 --- a/init/init.oplus.rc +++ b/init/init.oplus.rc @@ -44,6 +44,7 @@ on property:sys.boot_completed=1 copy /vendor/etc/Oppo_QC_LTM_Commercial_SM8250_2020_01_15.pfm /mnt/vendor/persist/data/pfm/licenses/1000-1000-no-exp-1186717196.pfm chmod 0600 /mnt/vendor/persist/data/pfm/licenses/1000-1000-no-exp-1186717196.pfm chown system system /mnt/vendor/persist/data/pfm/licenses/1000-1000-no-exp-1186717196.pfm + start sim-restart on property:vendor.post_boot.parsed=1 # IRQ Tuning @@ -109,3 +110,9 @@ service oplus_sensor_fb /odm/bin/oplus_sensor_fb group system class late_start oneshot + +service sim-restart /system/bin/init.sim.restart.sh + user root + class main + oneshot + disabled diff --git a/init/init.sim.restart.sh b/init/init.sim.restart.sh new file mode 100755 index 0000000..a46a109 --- /dev/null +++ b/init/init.sim.restart.sh @@ -0,0 +1,12 @@ +#!/system/bin/sh +# +# Copyright (C) 2024 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +service call phone 186 i32 0 i32 0 + +sleep 0.5 + +service call phone 186 i32 0 i32 1 diff --git a/sepolicy/private/file_contexts b/sepolicy/private/file_contexts new file mode 100644 index 0000000..1a8497e --- /dev/null +++ b/sepolicy/private/file_contexts @@ -0,0 +1 @@ +/system/bin/init\.sim\.restart\.sh u:object_r:init_sim_restart_exec:s0 diff --git a/sepolicy/private/init_sim_restart.te b/sepolicy/private/init_sim_restart.te new file mode 100644 index 0000000..39dc762 --- /dev/null +++ b/sepolicy/private/init_sim_restart.te @@ -0,0 +1,14 @@ +type init_sim_restart, domain, coredomain; +type init_sim_restart_exec, system_file_type, exec_type, file_type; + +init_daemon_domain(init_sim_restart) + +allow init_sim_restart init:unix_stream_socket connectto; +allow init_sim_restart property_socket:sock_file write; +allow init_sim_restart shell_exec:file { execute getattr map read }; +allow init_sim_restart toolbox_exec:file { execute execute_no_trans getattr map open read }; + +allow init_sim_restart radio:binder call; +allow init_sim_restart radio_service:service_manager find; +allow init_sim_restart servicemanager:binder call; +allow init_sim_restart system_file:file execute_no_trans;