|
| 1 | +# BlueStacks Root GUI |
| 2 | + |
| 3 | +[](https://github.com/RobThePCGuy/BlueStacks-Root-GUI) [](https://youtu.be/zpihBs3FtEc) [](https://github.com/RobThePCGuy/BlueStacks-Root-GUI/commits/main) |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +BlueStacks Root GUI is a utility designed to easily toggle root access settings and enable read/write (R/W) permissions for your BlueStacks 5 instances (specifically targeting BlueStacks_nxt structure). It aims to simplify the process described in the original guide: **[Root BlueStacks with Kitsune Mask](https://github.com/RobThePCGuy/Root-Bluestacks-with-Kitsune-Mask/)** by providing a graphical interface. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Table of Contents |
| 14 | + |
| 15 | +- [Features](#features) |
| 16 | +- [Prerequisites](#prerequisites) |
| 17 | +- [Installation & Download](#installation--download) |
| 18 | +- [Usage Guide](#usage-guide) |
| 19 | +- [Troubleshooting](#troubleshooting) |
| 20 | +- [Development](#development) |
| 21 | +- [Changelog](#changelog) |
| 22 | +- [Contributing](#contributing) |
| 23 | +- [License](#license) |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## Features |
| 28 | + |
| 29 | +- **Auto-Detection:** Discovers BlueStacks installation paths via the Windows Registry (`SOFTWARE\BlueStacks_nxt`). |
| 30 | +- **Instance Listing:** Reads `bluestacks.conf` to find and list configured instances. |
| 31 | +- **Root Toggle:** Modifies `bst.instance.<name>.enable_root_access` and `bst.feature.rooting` in `bluestacks.conf`. |
| 32 | +- **Read/Write Toggle:** Modifies the `Type` attribute (`Normal` vs `Readonly`) for key disk files (`fastboot.vdi`, `Root.vhd`) within instance-specific `.bstk` files. |
| 33 | +- **Process Handling:** Detects running BlueStacks processes and attempts graceful termination before applying changes. |
| 34 | +- **Status Display:** Shows the current Root and R/W status for each detected instance. |
| 35 | +- **Responsive UI:** Uses background threads (`QThread`) for potentially long operations (file I/O, process termination) to keep the GUI responsive. |
| 36 | +- **Basic Internationalization:** Includes English and Japanese translations. |
| 37 | + |
| 38 | +--- |
| 39 | + |
| 40 | +## Prerequisites |
| 41 | + |
| 42 | +- **Operating System:** Windows 10 or later (due to registry keys and file paths used). |
| 43 | +- **BlueStacks Version:** BlueStacks 5 (specifically versions using the `BlueStacks_nxt` registry key and configuration structure). *Compatibility with other versions is not guaranteed.* |
| 44 | +- **Python (for development):** Python 3.7+ |
| 45 | +- **Administrator Rights:** **Required** to read the HKLM registry and terminate BlueStacks processes effectively. Run the application as an administrator. |
| 46 | +- **Dependencies:** Listed in `requirements.txt`. Key dependencies include `PyQt5`, `pywin32`, `psutil`. |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +## Installation & Download |
| 51 | + |
| 52 | +### For End Users (Executable Download) |
| 53 | + |
| 54 | +1. **Download the Latest Executable:** Go to the **[Releases](https://github.com/RobThePCGuy/BlueStacks-Root-GUI/releases)** page on GitHub and download the latest `.exe` file. |
| 55 | +2. **Run as Administrator:** Right-click the downloaded `.exe` and select "Run as administrator". This is necessary for registry access and process termination. |
| 56 | +3. **Important Pre-Run Steps:** |
| 57 | + * **Clean BlueStacks Install Recommended:** If you encounter issues, fully uninstall *all* previous BlueStacks versions using the official **[BlueStacks Cleaner tool](https://support.bluestacks.com/hc/en-us/articles/360057724751-How-to-uninstall-BlueStacks-5-BlueStacks-X-and-BlueStacks-Services-completely-from-your-PC)**. |
| 58 | + * **Install Latest BlueStacks 5:** Download and install the latest version from the official **[BlueStacks website](https://www.bluestacks.com/)**. |
| 59 | + |
| 60 | +### For Developers (Building from Source) |
| 61 | + |
| 62 | +1. **Clone the Repository:** |
| 63 | + ```bash |
| 64 | + git clone https://github.com/RobThePCGuy/BlueStacks-Root-GUI.git |
| 65 | + cd BlueStacks-Root-GUI |
| 66 | + ``` |
| 67 | +2. **Create a Virtual Environment (Recommended):** |
| 68 | + ```bash |
| 69 | + python -m venv venv |
| 70 | + .\venv\Scripts\activate |
| 71 | + ``` |
| 72 | +3. **Install Dependencies:** |
| 73 | + ```bash |
| 74 | + pip install -r requirements.txt |
| 75 | + ``` |
| 76 | +4. **Run the Application:** |
| 77 | + ```bash |
| 78 | + python main.py |
| 79 | + ``` |
| 80 | + *(Remember to run your terminal/IDE as administrator if running directly)* |
| 81 | +5. **Build the Executable (Optional):** |
| 82 | + ```bash |
| 83 | + pip install pyinstaller |
| 84 | + pyinstaller --onefile --windowed --icon=favicon.ico --name BlueStacksRootGUI main.py |
| 85 | + ``` |
| 86 | + The executable will be in the `dist/` folder. |
| 87 | + |
| 88 | +--- |
| 89 | + |
| 90 | +## Usage Guide |
| 91 | + |
| 92 | +1. **Launch as Administrator:** Start the GUI (`.exe` or `python main.py`) with administrator privileges. |
| 93 | +2. **Instance Detection:** The GUI will attempt to find your BlueStacks installation and list the instances found in `bluestacks.conf`. Statuses (Root, R/W) will be displayed. |
| 94 | +3. **Select Instances:** Check the box(es) next to the instance(s) you want to modify. |
| 95 | +4. **Toggle Root:** |
| 96 | + * Click **"Toggle Root"**. This enables the necessary settings in `bluestacks.conf`. |
| 97 | + * **Turn this ON only temporarily** while you are installing Kitsune Mask. |
| 98 | +5. **Toggle R/W:** |
| 99 | + * Click **"Toggle R/W"**. This sets the instance's disk files (`Root.vhd`, `fastboot.vdi`) to `Normal` (Read/Write) mode. |
| 100 | + * **This needs to be left ON** for the system modifications (like Kitsune Mask) to persist after the instance restarts. |
| 101 | +6. **Install Kitsune Mask:** |
| 102 | + * Ensure **Root is ON** and **R/W is ON** in the GUI for the target instance. |
| 103 | + * Download the latest **[Kitsune Mask APK](https://github.com/1q23lyc45/KitsuneMagisk/releases)**. |
| 104 | + * Launch the modified instance using the BlueStacks Multi-Instance Manager. |
| 105 | + * Install the downloaded Kitsune Mask APK onto the instance (drag-and-drop usually works). |
| 106 | + * Open the Kitsune Mask app inside the instance. |
| 107 | + * Tap **Install**. |
| 108 | + * Tap **Next**. |
| 109 | + * Select the option **"Direct Install to /system"**. |
| 110 | + * *Troubleshooting:* If the "Direct Install" option is missing, fully close and reopen the Kitsune Mask app *inside* BlueStacks. It should then appear. |
| 111 | + * Let the installation complete and reboot when prompted (the instance will restart). |
| 112 | +7. **Final GUI Step:** |
| 113 | + * **Crucially:** Once Kitsune Mask is successfully installed to `/system`, return to the BlueStacks Root GUI. |
| 114 | + * Select the instance again. |
| 115 | + * Click **"Toggle Root"** to turn the configuration setting **OFF**. |
| 116 | + * **Leave "Toggle R/W" ON.** |
| 117 | +8. **Verify:** Launch the instance. Open Kitsune Mask; it should show as installed and active. Root applications should now work. |
| 118 | +9. **Close:** Close the BlueStacks Root GUI. |
| 119 | +
|
| 120 | +--- |
| 121 | +
|
| 122 | +## Troubleshooting |
| 123 | +
|
| 124 | +- **"Path Not Found" / No Instances Listed:** |
| 125 | + * Ensure you ran the GUI as **administrator**. |
| 126 | + * Verify BlueStacks 5 is installed correctly and the registry keys (`HKLM\SOFTWARE\BlueStacks_nxt\UserDefinedDir` and `DataDir`) exist. |
| 127 | + * A clean reinstall of BlueStacks using the official cleaner tool might be necessary. |
| 128 | +- **Permission Errors during Toggle:** |
| 129 | + * You *must* run the GUI as administrator. |
| 130 | +- **R/W Toggle Doesn't Stick:** |
| 131 | + * Ensure BlueStacks processes (`HD-Player.exe`, `HD-Agent.exe`, etc.) were fully terminated before toggling. The GUI attempts this, but manual termination via Task Manager might be needed if issues persist. |
| 132 | + * Ensure you are leaving the **R/W** setting **ON** in the GUI after installing Kitsune Mask. |
| 133 | +- **"Direct Install to /system" Missing in Kitsune Mask:** |
| 134 | + * Make sure **Root** and **R/W** were both **ON** in the GUI *before* launching the instance and attempting installation. |
| 135 | + * Try closing and reopening the Kitsune Mask app within the BlueStacks instance. |
| 136 | +- **Errors during Toggle Operations:** Check the status bar in the GUI and the application logs (if run from source/console) for specific error messages. |
| 137 | + |
| 138 | +--- |
| 139 | + |
| 140 | +## Development |
| 141 | + |
| 142 | +Follow the steps in [Installation & Download > For Developers](#for-developers-building-from-source). |
| 143 | + |
| 144 | +Key modules: |
| 145 | +- `main.py`: PyQt5 GUI, application logic, threading. |
| 146 | +- `config_handler.py`: Reads/writes `bluestacks.conf`. |
| 147 | +- `instance_handler.py`: Modifies `.bstk` files, handles processes. |
| 148 | +- `registry_handler.py`: Reads BlueStacks paths from Windows Registry. |
| 149 | +- `constants.py`: Shared constant values (keys, filenames, modes, etc.). |
| 150 | + |
| 151 | +--- |
| 152 | + |
| 153 | +## Changelog |
| 154 | + |
| 155 | +*(See commit history for details)* |
| 156 | + |
| 157 | +--- |
| 158 | + |
| 159 | +## Contributing |
| 160 | + |
| 161 | +Contributions are welcome! Please follow these guidelines: |
| 162 | + |
| 163 | +- Maintain code style and structure. |
| 164 | +- Use the `logging` module appropriately. |
| 165 | +- Add/update docstrings for new/modified code. |
| 166 | +- Ensure UI remains responsive (use background threads for blocking tasks). |
| 167 | +- Update `constants.py` if adding new configurable values. |
| 168 | +- Submit pull requests with clear descriptions of changes. |
| 169 | +- Open an issue to discuss significant changes beforehand. |
| 170 | + |
| 171 | +--- |
| 172 | + |
| 173 | +## License |
| 174 | + |
| 175 | +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file (if included, standard MIT otherwise) for details. |
0 commit comments