From 5d19da490b53cc643a552ade9633bd560426f385 Mon Sep 17 00:00:00 2001 From: Admire Date: Sat, 20 Jul 2024 00:44:19 +0800 Subject: [PATCH] fix services --- kernel/patch/android/gen/user_init.c | 2 +- kernel/patch/android/user_init.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/patch/android/gen/user_init.c b/kernel/patch/android/gen/user_init.c index d877017..1c962c0 100644 --- a/kernel/patch/android/gen/user_init.c +++ b/kernel/patch/android/gen/user_init.c @@ -1 +1 @@ -static const char user_init[] = "#!/bin/sh\n\nKPMS_DIR=\"/data/adb/ap/kpms/\"\nMAGISK_POLICY_PATH=\"/data/adb/ap/bin/magiskpolicy\"\nSUPERCMD=\"truncate\"\nMAGISK_SCTX=\"u:r:magisk:s0\"\nAPD_PATH=\"/data/adb/apd\"\n\nskey=\"$1\"\nevent=\"$2\"\n\nLOG_FILE=\"/dev/user_init_\"\"$event\"\".log\"\n\nexec >>$LOG_FILE 2>&1\n\nset -x\n\nload_modules() {\n for dir in \"$KPMS_DIR/*\"; do\n if [ ! -d \"$dir\" ]; then continue; fi\n if [ -e \"$dir/disable\" ]; then continue; fi\n main_sh=\"$dir/main.sh\"\n if [ -e \"$main_sh\" ]; then\n touch \"$dir/disable\"\n echo \"loading $dir/main.sh ...\"\n . \"$main_sh\"\n rm -f \"$dir/disable\"\n else\n echo \"Error: $main_sh not found in $dir\"\n fi\n done\n}\n\nhandle() {\n $SUPERCMD $skey event $event\n case \"$event\" in\n \"early-init\" | \"init\" | \"late-init\")\n echo \"user_init event: $event\"\n ;;\n \"post-fs-data\")\n $MAGISK_POLICY_PATH --magisk --live\n load_modules $skey $event\n $SUPERCMD $skey -Z $MAGISK_SCTX exec $APD_PATH -s $skey $event\n ;;\n \"service\" | \"boot-completed\")\n $SUPERCMD $skey -Z $MAGISK_SCTX exec $APD_PATH -s $skey $event\n ;;\n *)\n echo \"unknown user_init event: $event\"\n ;;\n esac\n $SUPERCMD $skey event $event\n}\n\nhandle\n"; +static const char user_init[] = "#!/bin/sh\n\nKPMS_DIR=\"/data/adb/ap/kpms/\"\nMAGISK_POLICY_PATH=\"/data/adb/ap/bin/magiskpolicy\"\nSUPERCMD=\"truncate\"\nMAGISK_SCTX=\"u:r:magisk:s0\"\nAPD_PATH=\"/data/adb/apd\"\n\nskey=\"$1\"\nevent=\"$2\"\n\nLOG_FILE=\"/dev/user_init_\"\"$event\"\".log\"\n\nexec >>$LOG_FILE 2>&1\n\nset -x\n\nload_modules() {\n for dir in \"$KPMS_DIR/*\"; do\n if [ ! -d \"$dir\" ]; then continue; fi\n if [ -e \"$dir/disable\" ]; then continue; fi\n main_sh=\"$dir/main.sh\"\n if [ -e \"$main_sh\" ]; then\n touch \"$dir/disable\"\n echo \"loading $dir/main.sh ...\"\n . \"$main_sh\"\n rm -f \"$dir/disable\"\n else\n echo \"Error: $main_sh not found in $dir\"\n fi\n done\n}\n\nhandle() {\n $SUPERCMD $skey event $event\n case \"$event\" in\n \"early-init\" | \"init\" | \"late-init\")\n echo \"user_init event: $event\"\n ;;\n \"post-fs-data\")\n $MAGISK_POLICY_PATH --magisk --live\n load_modules $skey $event\n $SUPERCMD $skey -Z $MAGISK_SCTX exec $APD_PATH -s $skey $event\n ;;\n \"services\" | \"boot-completed\")\n $SUPERCMD $skey -Z $MAGISK_SCTX exec $APD_PATH -s $skey $event\n ;;\n *)\n echo \"unknown user_init event: $event\"\n ;;\n esac\n $SUPERCMD $skey event $event\n}\n\nhandle\n"; diff --git a/kernel/patch/android/user_init.sh b/kernel/patch/android/user_init.sh index 6c2d986..06973c4 100644 --- a/kernel/patch/android/user_init.sh +++ b/kernel/patch/android/user_init.sh @@ -42,7 +42,7 @@ handle() { load_modules $skey $event $SUPERCMD $skey -Z $MAGISK_SCTX exec $APD_PATH -s $skey $event ;; - "service" | "boot-completed") + "services" | "boot-completed") $SUPERCMD $skey -Z $MAGISK_SCTX exec $APD_PATH -s $skey $event ;; *)