[core] Fix cmdline detection (#621)

This commit is contained in:
LoveSy 2021-05-18 21:22:08 +08:00 committed by GitHub
parent cb665d4eeb
commit bc944bd6ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -138,7 +138,7 @@ fi
start_app_process() {
while true; do
if [ -S "/dev/socket/zygote" ]; then
nohup /system/bin/app_process -Djava.class.path=$(magisk --path)/.magisk/modules/riru_lsposed/framework/lspd.dex /system/bin --nice-name=lspd org.lsposed.lspd.core.Main >/dev/null 2>&1 & echo $! > /data/adb/lspd/daemon.pid
nohup /system/bin/app_process -Djava.class.path=$(magisk --path)/.magisk/modules/riru_lsposed/framework/lspd.dex /system/bin org.lsposed.lspd.core.Main --nice-name=lspd >/dev/null 2>&1 & echo $! > /data/adb/lspd/daemon.pid
return
fi
done

View File

@ -25,7 +25,8 @@ CMDLINE="$(cat /proc/$(cat /data/adb/lspd/daemon.pid)/cmdline)"
# $(magisk --path)/.magisk/busybox/busyboxsh/data/adb/modules/riru_lsposed/post-fs-data.sh
# if service started, cmdline should be lspd
# for other cases, post-fs-data.sh may not be executed properly
if [ "${CMDLINE##*riru_lsposed/}" != "post-fs-data.sh" ] && [ "$CMDLINE" != "lspd" ]; then
if [ "${CMDLINE##*riru_lsposed/}" != "post-fs-data.sh" ] && [ "${CMDLINE##*=}" != "lspd" ]; then
log -pw -t "LSPosedService" "Got $CMDLINE"
log -pw -t "LSPosedService" "LSPosed daemon is not started properly. Try for a late start..."
nohup /system/bin/app_process -Djava.class.path=$(magisk --path)/.magisk/modules/riru_lsposed/framework/lspd.dex /system/bin --nice-name=lspd org.lsposed.lspd.core.Main >/dev/null 2>&1 & echo $! > /data/adb/lspd/daemon.pid
nohup /system/bin/app_process -Djava.class.path=$(magisk --path)/.magisk/modules/riru_lsposed/framework/lspd.dex /system/bin org.lsposed.lspd.core.Main --nice-name=lspd >/dev/null 2>&1 & echo $! > /data/adb/lspd/daemon.pid
fi