A bug affecting Magisk versions prior to 28.0 causes applications using Magisk's root access to become unresponsive. This issue primarily manifests when using methods to execute commands as root, such as the `ProcessBuilder` class with `su`.
Affected users have reported that their applications become stuck indefinitely when attempting to execute commands as root, regardless of the specific command used. This includes commands like `mount`, `cat`, reading `/proc/mounts`, `/proc/self/mounts`, or `/proc/self/mountinfo`. The `process.waitFor()` method will indefinitely report that the process hasn't exited.
**Affected Devices:**
Magisk version: v28.0 and some earlier. NOT on v26.4
Android version: any. Tested around 10-13
**Steps to reproduce:**
- Set Magisk to auto allow root requests.
- Create a demo Android app.
- Add the following code:
- Run the app. Stuck forever. waitFor with timeout reports
process hasn't exited
Process process = new ProcessBuilder("su", "-c", "mount").start();
process.waitFor(); // this blocks forever
The code running `mount` can be replaced with `cat` and any one of ` /proc/mounts`, ` /proc/self/mounts`, or `/proc/self/mountinfo`. They will all get stuck.
This article is created by nurl and is licensed under the Creative Commons Attribution 4.0 International License.
All articles on this site, unless otherwise specified as reprints or sources, are either original works or translations by this site. Please ensure proper attribution before reprinting.