Add Kyubi (Manager Root) for BlueStacks Air - #73
Conversation
BlueStacks Air only had a plain su: no modules, no ReZygisk, no LSPosed. Manager Root now installs Kyubi there too, from the new arm64-v8a Kyubi build, with the same buttons as Windows: Manager Root, Update, the Kyubi app, ReZygisk, LSPosed, and the Modules page. macos_kyubi writes the system-mode footprint into Air's shared Root.qcow2 through the existing image session. Two things differ from Windows because Air differs: the magisk tmpfs lives at /debug_ramdisk, since Air's ramdisk has no /sbin, and /data/adb/magisk is filled by a script the guest runs at boot rather than by editing each instance's multi-GB data.qcow2 offline. Kyubi replaces the plain su in the same pass, and the plain root refuses while Kyubi is in. Undo restores the original image byte for byte when Kyubi was the only change. Also fixed while here: - Manager/app copy says "Kyubi app" instead of "Magisk manager". - The ReZygisk and LSPosed results no longer repeat the restart advice. - The modification record dropped stale plain-su fields once root is off. Verified live on BlueStacks Air 5.21.790 through the buttons: Manager Root installed Kyubi, started the instance and installed the app; su gives uid 0; ReZygisk and LSPosed flashed and both run after Restart; Remove Manager Root took Kyubi out and left the tracker block in place.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Address Kyubi path removal, per-instance app state, stale app terminology, and missing image-operation tests.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Adds Kyubi-based Manager Root support for BlueStacks Air, including shared-image integration, app/module controls, ARM64 payload handling, UI updates, documentation, and tests.
Changes:
- Adds Kyubi installation, update, uninstall, and boot staging.
- Updates Air controls, status tracking, messaging, and cleanup.
- Adds ARM64 payload support and related documentation/tests.
| File | Description |
|---|---|
views/main_window.py |
Tracks Air Kyubi state and rooted counts. |
views/magisk_controller.py |
Implements Air Kyubi workflows and actions. |
views/instances_page.py |
Exposes Manager Root controls on Air. |
views/help.py |
Documents Air rooting options. |
tests/test_instances_page.py |
Tests Air UI behavior. |
tests/test_auto_manager.py |
Updates manager workflow tests. |
tests/test_adb_manager.py |
Updates Kyubi messaging tests. |
README.md |
Documents Kyubi support. |
magisk_payload.py |
Supports ARM64 Kyubi payload extraction. |
macos_root.py |
Tracks Kyubi image modifications. |
macos_kyubi.py |
Implements Kyubi shared-image integration. |
adb_handler.py |
Updates Kyubi app operations and cleanup. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| def _remove_magisk_dir(img: macos_root.ImageSession) -> None: | ||
| listing = img.run("ls -p %s\nquit\n" % MAGISK_DIR) | ||
| names = [p.split("/")[5] for p in listing.split() if p.count("/") >= 6] |
There was a problem hiding this comment.
Fixed: the Kyubi app is now recorded per instance (manager_instances), and each row reports it only for the instance it was installed into. An update keeps the list.
| state["root"] = False | ||
| state["kyubi"] = {"version": magisk_payload.PAYLOAD_VERSION, | ||
| "payload_sha256": payload_sha, | ||
| "components": ["system"]} | ||
| macos_root.write_modstate(app_path, data_dir, state) |
There was a problem hiding this comment.
Not adding new tests here: this project's rule is no new tests while the app is still changing. Install, uninstall with the hosts block still active, and the plain-root conflict were exercised live on BlueStacks Air 5.21.790 through the GUI. Update (reinstall over an existing Kyubi) gets its live run against the published Kyubi prerelease before this merges.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 134da6b58b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if instance.get("air_mode"): | ||
| app_path, data_dir = self._air_args(instance) | ||
| macos_kyubi.add_component(app_path, component, data_dir) |
There was a problem hiding this comment.
Track the Kyubi app per Air instance
When an Air installation has multiple instances, adb install adds the manager APK only to the selected instance's private data.qcow2, but this records the manager component in the installation-wide modification state. Consequently every row is reported as having the app, so the “Manager app” retry is hidden for instances where it was never installed; removing it from one instance likewise makes all rows report it missing. Keep the shared system-root status installation-wide, but persist or probe manager-app presence per instance.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed: the Kyubi app is now recorded per instance (manager_instances), and each row reports it only for the instance it was installed into. An update keeps the list.
Kyubi itself lives in the one system image every Air instance shares, but the Kyubi app is installed into each instance's own data disk. The app was recorded install-wide, so every row claimed it once one instance had it. It is now recorded per instance, and an update keeps that list.


BlueStacks Air only had a plain
su. Manager Root now installs Kyubi there too, with the same buttons as Windows: Manager Root, Update, Kyubi app, ReZygisk, LSPosed, and the Modules page.Needs a Kyubi release that includes
arm64-v8a(RobThePCGuy/Kyubi#50). Until that release is out, Manager Root on Air stops with a plain message saying the current Kyubi build has no Apple Silicon files.How it works on Air
macos_kyubi.pywrites the system-mode footprint into Air's sharedRoot.qcow2, through the same image session the plain root uses./debug_ramdisk, because Air's ramdisk has no/sbin./data/adb/magiskis filled by a script the guest runs at boot, instead of editing each instance's multi-GBdata.qcow2offline.su, and plain root refuses while Kyubi is in. Undo restores the original image byte for byte when Kyubi was the only change.Verified live on BlueStacks Air 5.21.790 (macOS 27), through the buttons:
sugives uid 0.zygiskd64,lspd).Also: "Kyubi app" instead of "Magisk manager" in messages, no doubled restart advice after ReZygisk/LSPosed, and stale plain-su fields dropped from the modification record.