Skip to content

Add Kyubi (Manager Root) for BlueStacks Air - #73

Merged
RobThePCGuy merged 2 commits into
masterfrom
kyubi-air
Sep 22, 2026
Merged

RobThePCGuy merged 2 commits into
masterfrom
kyubi-air

Conversation

@RobThePCGuy

Copy link
Copy Markdown
Owner

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.py writes the system-mode footprint into Air's shared Root.qcow2, through the same image session the plain root uses.
  • Magisk's tmpfs goes at /debug_ramdisk, because Air's ramdisk has no /sbin.
  • /data/adb/magisk is filled by a script the guest runs at boot, instead of editing each instance's multi-GB data.qcow2 offline.
  • Kyubi replaces the plain 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:

  • Manager Root installed Kyubi, started the instance and installed the Kyubi app.
  • su gives uid 0.
  • ReZygisk and LSPosed flashed, and both run after Restart (zygiskd64, lspd).
  • Remove Manager Root took Kyubi out and left the Privacy tracker block in place.

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.

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.
Copilot AI lite review requested due to automatic review settings September 21, 2026 23:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-21T23:40:28.755003Z 134da6b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 Medium severity · 1 Low severity

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.

Comment thread macos_kyubi.py

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]

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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.

Comment thread macos_kyubi.py
Comment on lines +245 to +249
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)

@RobThePCGuy RobThePCGuy Sep 21, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread views/magisk_controller.py Outdated
Comment on lines +72 to +74
if instance.get("air_mode"):
app_path, data_dir = self._air_args(instance)
macos_kyubi.add_component(app_path, component, data_dir)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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.
@RobThePCGuy
RobThePCGuy merged commit 5024a0a into master Sep 22, 2026
6 checks passed
@RobThePCGuy
RobThePCGuy deleted the kyubi-air branch September 22, 2026 00:11
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