Skip to content

Add late-load.sh for KernelSU LKM late-load mode - #143

Closed
Nikj-Fr wants to merge 1 commit into
JingMatrix:masterfrom
Nikj-Fr:feat/kernelsu-late-load
Closed

Nikj-Fr wants to merge 1 commit into
JingMatrix:masterfrom
Nikj-Fr:feat/kernelsu-late-load

Conversation

@Nikj-Fr

@Nikj-Fr Nikj-Fr commented Jun 10, 2026

Copy link
Copy Markdown
Add late-load.sh for KernelSU LKM late-load (jailbreak mode)

Summary

  • Add module/src/late-load.sh for KernelSU ksud late-load / LKM jailbreak mode
  • Package late-load.sh in customize.sh and module/build.gradle.kts
  • Document late-load behavior in README

Why

KernelSU LKM setups load kernelsu.ko after the system has booted (ksud late-load). In this mode, post-fs-data.sh is never run — only late-load.sh (KernelSU module docs).

NeoZygisk currently has no late-load.sh, so users on jailbreak-style KernelSU installs get no Zygisk injection until they manually run post-fs-data.sh and restart zygote.

This PR ships that workflow:

  1. Bootstrap NeoZygisk via post-fs-data.sh if the ptrace monitor is not running
  2. Soft-reboot zygote (killall zygote64 zygote) so new processes receive injection

Test plan

  • Cold boot without jailbreak: NeoZygisk inactive (expected)
  • Tap 越狱 (ksud late-load): late-load.sh runs, monitor starts
  • Module status shows ptrace monitor / injection active after zygote restart
  • Zygisk-dependent modules (e.g. Vector) work in newly started apps

Notes

  • late-load.sh only runs during KernelSU late-load; normal boot still uses post-fs-data.sh
  • Uses pidof instead of pgrep -f for toybox/busybox compatibility
  • Intentionally avoids live zygisk-ptrace64 trace on a running zygote (can SIGKILL zygote on failure)

KernelSU jailbreak (ksud late-load) skips post-fs-data.sh, so NeoZygisk never started on LKM setups until users patched it manually. Ship late-load.sh to bootstrap the monitor and soft-reboot zygote after late-load completes.
@JingMatrix

Copy link
Copy Markdown
Owner

It seems that pr #107 is more interesting regarding the late inject mode, where live-attach is applied.

I have a rough plan to somehow merge #107 while exploiting KSU's new mode.

@JingMatrix JingMatrix closed this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants