Conversation
Collaborator
YuKongA
commented
May 15, 2026
- based on main...5ec1cff:KernelSU:bootimg
- missing dc1f174a
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors KernelSU’s userspace boot image patch/restore flow to use the android-bootimg Rust crate instead of relying on magiskboot, and removes the now-unneeded magiskboot plumbing from the CLI, installer, and Manager command invocations.
Changes:
- Replace
magiskbootsubprocess usage inboot_patchwith in-process parsing/patching viaandroid-bootimg+cpioedits. - Remove
--magiskbootoptions/paths fromksudinstall/uninstall commands and Manager-side command construction. - Add new Rust dependencies to support the refactor (bootimg crate, memmap, SHA1 hex encoding helpers) and update the lockfile accordingly.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| userspace/ksud/src/utils.rs | Drops magiskboot installation/uninstall wiring and calls restore without magiskboot. |
| userspace/ksud/src/late_load.rs | Updates call site for the new utils::install() signature. |
| userspace/ksud/src/defs.rs | Removes the MAGISKBOOT_PATH constant. |
| userspace/ksud/src/cli.rs | Removes --magiskboot CLI options and updates install/uninstall dispatch. |
| userspace/ksud/src/boot_patch.rs | Reimplements boot patch/restore using android-bootimg + CPIO manipulation; adds direct partition flashing. |
| userspace/ksud/src/assets.rs | Replaces file-copy helper with an in-memory asset accessor used by the new patcher flow. |
| userspace/ksud/Cargo.toml | Adds android-bootimg, memmap2, base16ct, bumps sha1, updates bindgen. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt | Removes --magiskboot usage from Manager ksud command invocations. |
| Cargo.lock | Updates lockfile for new/updated dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- based on main...5ec1cff:KernelSU:bootimg - missing dc1f174a - not fully tested Co-Authored-By: 5ec1cff <56485584+5ec1cff@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.