diff --git a/zygisk/module/customize.sh b/zygisk/module/customize.sh index 049ca7b8e..6b5ad34f2 100644 --- a/zygisk/module/customize.sh +++ b/zygisk/module/customize.sh @@ -82,7 +82,7 @@ esac ui_print "- Device platform: $ARCH ($ABI32 / $ABI64)" ui_print "- Extracting root module files" -for file in module.prop action.sh service.sh uninstall.sh sepolicy.rule framework/vector.dex cli daemon.apk daemon manager.apk; do +for file in module.prop action.sh service.sh emulated-soft-reboot.sh uninstall.sh sepolicy.rule framework/vector.dex cli daemon.apk daemon manager.apk; do extract "$ZIPFILE" "$file" "$MODPATH" done diff --git a/zygisk/module/emulated-soft-reboot.sh b/zygisk/module/emulated-soft-reboot.sh new file mode 100644 index 000000000..56dac3c4f --- /dev/null +++ b/zygisk/module/emulated-soft-reboot.sh @@ -0,0 +1,12 @@ +# ksud runs this stage at the start of an emulated soft reboot, before `stop`. +# The daemon is detached from the service.sh that started it, so `stop` does not +# reach it while the same cycle runs service.sh again; without this, the second +# soft reboot leaves two daemons claiming the same proxy service name. + +# -f is required: app_process sets the nice name in argv only, so comm stays +# "main" and `pkill vectord` matches nothing. The ^ anchor keeps the pattern +# from matching a shell whose own command line contains the word. +pids=$(pgrep -f '^vectord') +[ -n "$pids" ] && kill -9 $pids + +exit 0