diff --git a/kernel/patch/android/gen/user_init.c b/kernel/patch/android/gen/user_init.c index 1c962c0..2f822bf 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 \"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"; +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\")\n $SUPERCMD $skey -Z $MAGISK_SCTX exec $APD_PATH -s $skey $event\n ;;\n \"boot-completed\")\n $SUPERCMD $skey -Z $MAGISK_SCTX exec $APD_PATH -s $skey $event\n $SUPERCMD su -Z $MAGISK_SCTX exec $APD_PATH uid-listener &\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.c b/kernel/patch/android/user_init.c new file mode 100644 index 0000000..2f822bf --- /dev/null +++ b/kernel/patch/android/user_init.c @@ -0,0 +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 \"services\")\n $SUPERCMD $skey -Z $MAGISK_SCTX exec $APD_PATH -s $skey $event\n ;;\n \"boot-completed\")\n $SUPERCMD $skey -Z $MAGISK_SCTX exec $APD_PATH -s $skey $event\n $SUPERCMD su -Z $MAGISK_SCTX exec $APD_PATH uid-listener &\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 06973c4..1c83661 100644 --- a/kernel/patch/android/user_init.sh +++ b/kernel/patch/android/user_init.sh @@ -42,9 +42,13 @@ handle() { load_modules $skey $event $SUPERCMD $skey -Z $MAGISK_SCTX exec $APD_PATH -s $skey $event ;; - "services" | "boot-completed") + "services") $SUPERCMD $skey -Z $MAGISK_SCTX exec $APD_PATH -s $skey $event ;; + "boot-completed") + $SUPERCMD $skey -Z $MAGISK_SCTX exec $APD_PATH -s $skey $event + $SUPERCMD su -Z $MAGISK_SCTX exec $APD_PATH uid-listener & + ;; *) echo "unknown user_init event: $event" ;; diff --git a/version b/version index bb8bb10..126798b 100644 --- a/version +++ b/version @@ -1,3 +1,3 @@ #define MAJOR 0 #define MINOR 11 -#define PATCH 0 +#define PATCH 1