Skip to content

feat: jailbreak by Magica#3268

Merged
Ylarod merged 48 commits into
mainfrom
magica
Mar 12, 2026
Merged

feat: jailbreak by Magica#3268
Ylarod merged 48 commits into
mainfrom
magica

Conversation

@Ylarod

@Ylarod Ylarod commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@Ylarod Ylarod changed the title Magica: auto jailbreak feat: auto jailbreak by Magica Mar 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an “auto jailbreak by Magica” flow by adding an Android Manager toggle that enables a boot-time component, plus a new ksud late-load --magica[=<port>] path intended to escalate privileges and run the late-load stage.

Changes:

  • Add a --magica option to ksud late-load and implement a Magica-specific late-load runner in Rust.
  • Add a Manager “Auto jailbreak” setting that toggles a boot receiver and starts an isolated-process service at boot.
  • Add app-zygote preload plumbing intended to invoke ksud late-load during boot/service startup.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
userspace/ksud/src/main.rs Registers new magica module for Android builds.
userspace/ksud/src/magica.rs Implements adb-property manipulation + late-load execution flow.
userspace/ksud/src/cli.rs Extends late-load command with --magica option; adds debug binary extraction.
userspace/ksud/Cargo.toml Adds adb_client dependency for Android target.
userspace/ksud/Cargo.lock Locks new dependency graph (notably for adb_client).
manager/app/src/main/res/values/strings.xml Adds Auto jailbreak strings.
manager/app/src/main/res/values-zh-rCN/strings.xml Adds Auto jailbreak strings (zh-CN).
manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/SettingsViewModel.kt Loads and updates autoJailbreak in UI state.
manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/SettingsUiState.kt Adds autoJailbreak field to state model.
manager/app/src/main/java/me/weishu/kernelsu/ui/util/SELinuxChecker.kt Adds isSELinuxPermissive() helper.
manager/app/src/main/java/me/weishu/kernelsu/ui/screen/settings/SettingsMiuix.kt Adds Auto jailbreak toggle to MIUIX settings UI.
manager/app/src/main/java/me/weishu/kernelsu/ui/screen/settings/SettingsMaterial.kt Adds Auto jailbreak toggle to Material settings UI.
manager/app/src/main/java/me/weishu/kernelsu/magica/MagicaService.java New boot-started isolated service intended to trigger preload flow.
manager/app/src/main/java/me/weishu/kernelsu/magica/BootCompletedReceiver.java New boot receiver to start the service when enabled.
manager/app/src/main/java/me/weishu/kernelsu/magica/AppZygotePreload.java New app-zygote preload hook intended to run ksud late-load.
manager/app/src/main/java/me/weishu/kernelsu/data/repository/SettingsRepositoryImpl.kt Adds persisted autoJailbreak setting and toggles receiver enabled-state.
manager/app/src/main/java/me/weishu/kernelsu/data/repository/SettingsRepository.kt Adds autoJailbreak to repository interface.
manager/app/src/main/AndroidManifest.xml Adds direct-boot/app-zygote/service/receiver declarations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread userspace/ksud/src/magica.rs
Comment thread userspace/ksud/src/magica.rs Outdated
Comment thread manager/app/src/main/AndroidManifest.xml Outdated
Comment thread manager/app/src/main/AndroidManifest.xml
Comment thread manager/app/src/main/AndroidManifest.xml
Comment thread userspace/ksud/src/magica.rs
Comment thread userspace/ksud/Cargo.toml
@SenyFish

This comment was marked as off-topic.

selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
LeCmnGend pushed a commit to LeCmnGend/KernelSU that referenced this pull request Mar 14, 2026
Co-authored-by: 5ec1cff <ewtqyqyewtqyqy@gmail.com>
Co-authored-by: YuKongA <70465933+YuKongA@users.noreply.github.com>
Co-authored-by: KOWX712 <leecc0503@gmail.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Mar 14, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
LeCmnGend pushed a commit to LeCmnGend/KernelSU that referenced this pull request Mar 15, 2026
Co-authored-by: 5ec1cff <ewtqyqyewtqyqy@gmail.com>
Co-authored-by: YuKongA <70465933+YuKongA@users.noreply.github.com>
Co-authored-by: KOWX712 <leecc0503@gmail.com>
Flopster101 added a commit to FlopKernel-Series/flop_s5e8825_kernel that referenced this pull request Mar 15, 2026
033b60b5ce9f kernel: Fix RLIMIT_NPROC leak on root escape (#3286)
08d92684ab35 manager: trying fix ksud not release
daf724ef201b manager: unify Haze effect and refactor theme initialization
9deec27c577e manager: simplify kernel version requirements and cleanup UI
05387a745167 manager: bump MINIMAL_SUPPORTED_KERNEL to 34634
b338b1a69172 manager: enable ABI splits only for release builds
5c29099fa848 manager: enable ABI splits in manager app (#108)
ed234d64178d ci: try adjust build options (#107)
7c761877409d manager: update prebuilt susfs binary
8b046a529d97 manager: Add soft reboot (tiann/KernelSU#3272)
436d3330c6ff kernel, ksud, manager: jailbreak by Magica (tiann/KernelSU#3268)
1dc3f9c9cc4f kernel,CI(ddk): Enable multi manager support
adecabe77beb kernel: comment grammar fix (#101)
f1bfd0c27554 manager: sync translation from Crowdin (#26)
529c226a6a18 issue_template: add kernel version & hook type fields with auto-labeling (#98)
5a09074f0642 manager: fix padding issue
d5eead33aa7e kernel: enforcing selinux at late-load mode
ffa2be86d44a userspace: make cargofmt happy
5b9fee7ee7bd kernel: make clang format happy
b14bd99d8671 kernel, ksud, manager: add late-load mode support (tiann/KernelSU#3258)
96dc5fea947d kernel: use ksu_hook_init/ksu_hook_exit define for hooks init/exit
bc016ab8a966 kernel: refine stackprotector workaround (tiann/KernelSU#3264)
852483cc268f kernel: use an more clearly name for apk_sign_keys
5a22f75f0d0c kernel: add support for kowsu
5c9e92108aba kernel: deprecate set android_data_root_path/sdcard_root_path susfs cmd
301e21406493 kernel: update susfs kconfig descriptions
fca8d7e3d1a9 kernel: fix susfs_run_sus_path_loop() not executing when kernel umount is disabled
f593e7bc1f2b kernel: Only check CONFIG_STACKPROTECTOR_PER_TASK on arm64 (tiann/KernelSU#3263)
946524b3cb96 docs: add new icon assets and update README references (#95)
2f014aeadf8e build(deps): bump libc from 0.2.182 to 0.2.183 in /userspace/ksud in the crates group (#94)
2c10f6a63780 build(deps): bump libc from 0.2.182 to 0.2.183 in /userspace/ksuinit in the crates group (#93)
5c2497958910 kernel: ifdef MODULE for __stack_chk_guard
f110040091c2 kernel: add missing attribute
adbf01625215 manager: prevent duplicate push and rapid pop in Navigator
3bca52630fa4 manager: Implement new About and Open Source License screens
b7134ca4c616 ksud: Correctly fix command's args
2fcb4587a5e8 kernel: Provide own stackprotector symbol if necessary
ee7e986d35ce ksud: removed rustfmt rules
a4bdaf117b2e manager: fix Anykernel3 external install failed
b09dea678d02 manager: Refactor SearchAppBar and improve scroll behavior
f4d81094c3ea manager: Fix scale animation direction for right-edge predictive back gestures
8355009fbe00 build(deps): bump the maven group across 1 directory with 9 updates (#90)
d32e9e8bf558 ksud & ksuinit: fix wrong GetInfoCmd struct (tiann/KernelSU#3256)
b48f40e03886 manager: Refactor custom background handling and predictive back transitions
83cd225ab3c9 manager: fix custom background not shown
6675346ea3b0 build(deps): bump quote from 1.0.44 to 1.0.45 in /userspace/ksuinit in the crates group (#87)
cac73d730b18 build(deps): bump the crates group in /userspace/ksud with 2 updates (#89)
ae3cb5366275 manager: Refactor navigation to Navigation3 and implement predictive back animation
ce7ba3bf9a8e chore(deps): bump deps
47167aa71e1d build(deps): bump the crates group in /userspace/ksud with 2 updates (#86)
bcee1d69fa18 build(deps): bump the actions group with 2 updates (#84)
1fc451141fca Revert "kernel: drop bitmap, always search manager when packages.list change"
ff9ac08c60b6 kernel: Use ksu cred to save allowlist (tiann/KernelSU#3243)
d8fd9e81c258 kernel: drop bitmap, always search manager when packages.list change
738e51932c67 workflow: use ndk for clippy
32bc4c166ec4 issus_template: add manager relevant label

git-subtree-dir: drivers/sukisu
git-subtree-split: 033b60b5ce9fcc75a60f92de16c1eb596eacef49
LeCmnGend pushed a commit to LeCmnGend/KernelSU that referenced this pull request Mar 15, 2026
Co-authored-by: 5ec1cff <ewtqyqyewtqyqy@gmail.com>
Co-authored-by: YuKongA <70465933+YuKongA@users.noreply.github.com>
Co-authored-by: KOWX712 <leecc0503@gmail.com>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Mar 15, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Mar 15, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 15, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 15, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
Flopster101 added a commit to FlopKernel-Series/flop_trinket-mi_kernel that referenced this pull request Mar 15, 2026
941ad6e1f407 ksud: magica: Set uid in forked process (tiann/KernelSU#3296)
50c75d0f94e3 manager: use reflection to reset and initialize MainShell in KsuCli
7c867bbd05c0 manager: fix wrongly metamodule warning
243c36552b97 ksud: allow metamodule is disbale
8743600c2dea script(ksubot.py): fix "<>" format error
eeaae63ca326 ksud: magica: use minify adb_client (tiann#3292)
2578cc296e54 ci: Migrate to python-telegram-bot & message handling improvements (#109)
6817076f5c62 manager: implement unofficial manager warning
033b60b5ce9f kernel: Fix RLIMIT_NPROC leak on root escape (#3286)
08d92684ab35 manager: trying fix ksud not release
daf724ef201b manager: unify Haze effect and refactor theme initialization
9deec27c577e manager: simplify kernel version requirements and cleanup UI
05387a745167 manager: bump MINIMAL_SUPPORTED_KERNEL to 34634
b338b1a69172 manager: enable ABI splits only for release builds
5c29099fa848 manager: enable ABI splits in manager app (#108)
ed234d64178d ci: try adjust build options (#107)
7c761877409d manager: update prebuilt susfs binary
8b046a529d97 manager: Add soft reboot (tiann/KernelSU#3272)
436d3330c6ff kernel, ksud, manager: jailbreak by Magica (tiann/KernelSU#3268)
1dc3f9c9cc4f kernel,CI(ddk): Enable multi manager support
adecabe77beb kernel: comment grammar fix (#101)
f1bfd0c27554 manager: sync translation from Crowdin (#26)
529c226a6a18 issue_template: add kernel version & hook type fields with auto-labeling (#98)
5a09074f0642 manager: fix padding issue
d5eead33aa7e kernel: enforcing selinux at late-load mode
ffa2be86d44a userspace: make cargofmt happy
5b9fee7ee7bd kernel: make clang format happy
b14bd99d8671 kernel, ksud, manager: add late-load mode support (tiann/KernelSU#3258)
96dc5fea947d kernel: use ksu_hook_init/ksu_hook_exit define for hooks init/exit
bc016ab8a966 kernel: refine stackprotector workaround (tiann/KernelSU#3264)
852483cc268f kernel: use an more clearly name for apk_sign_keys
5a22f75f0d0c kernel: add support for kowsu
5c9e92108aba kernel: deprecate set android_data_root_path/sdcard_root_path susfs cmd
301e21406493 kernel: update susfs kconfig descriptions
fca8d7e3d1a9 kernel: fix susfs_run_sus_path_loop() not executing when kernel umount is disabled
f593e7bc1f2b kernel: Only check CONFIG_STACKPROTECTOR_PER_TASK on arm64 (tiann/KernelSU#3263)
946524b3cb96 docs: add new icon assets and update README references (#95)
2f014aeadf8e build(deps): bump libc from 0.2.182 to 0.2.183 in /userspace/ksud in the crates group (#94)
2c10f6a63780 build(deps): bump libc from 0.2.182 to 0.2.183 in /userspace/ksuinit in the crates group (#93)
5c2497958910 kernel: ifdef MODULE for __stack_chk_guard
f110040091c2 kernel: add missing attribute
adbf01625215 manager: prevent duplicate push and rapid pop in Navigator
3bca52630fa4 manager: Implement new About and Open Source License screens
b7134ca4c616 ksud: Correctly fix command's args
2fcb4587a5e8 kernel: Provide own stackprotector symbol if necessary
ee7e986d35ce ksud: removed rustfmt rules
a4bdaf117b2e manager: fix Anykernel3 external install failed
b09dea678d02 manager: Refactor SearchAppBar and improve scroll behavior
f4d81094c3ea manager: Fix scale animation direction for right-edge predictive back gestures
8355009fbe00 build(deps): bump the maven group across 1 directory with 9 updates (#90)
d32e9e8bf558 ksud & ksuinit: fix wrong GetInfoCmd struct (tiann/KernelSU#3256)
b48f40e03886 manager: Refactor custom background handling and predictive back transitions
83cd225ab3c9 manager: fix custom background not shown
6675346ea3b0 build(deps): bump quote from 1.0.44 to 1.0.45 in /userspace/ksuinit in the crates group (#87)
cac73d730b18 build(deps): bump the crates group in /userspace/ksud with 2 updates (#89)
ae3cb5366275 manager: Refactor navigation to Navigation3 and implement predictive back animation
ce7ba3bf9a8e chore(deps): bump deps
47167aa71e1d build(deps): bump the crates group in /userspace/ksud with 2 updates (#86)
bcee1d69fa18 build(deps): bump the actions group with 2 updates (#84)
1fc451141fca Revert "kernel: drop bitmap, always search manager when packages.list change"
ff9ac08c60b6 kernel: Use ksu cred to save allowlist (tiann/KernelSU#3243)
d8fd9e81c258 kernel: drop bitmap, always search manager when packages.list change
738e51932c67 workflow: use ndk for clippy
32bc4c166ec4 issus_template: add manager relevant label

git-subtree-dir: drivers/sukisu
git-subtree-split: 941ad6e1f407e27fee7edc66d8076bff273c4ec9
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Mar 15, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Mar 15, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 16, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 16, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 16, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
sakana164 pushed a commit to sakana164/KernelSU that referenced this pull request Mar 16, 2026
pulling out policydb is the only big difference anyway

as for locking, if we can hold policy_rwlock, then we go for it.

upstream: tiann#3268 tiann@e31f84a

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
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.

6 participants