Before the release of the first Android Q beta, XDA Recognized Developer topjohnwu announced that he had rooted Android Q. He accomplished this feat thanks to a leaked build of Android Q that we also obtained. When the official beta dropped for all three Google Pixel smartphone lines, topjohnwu once again dived in to see if he could get Magisk working. He quickly realized that rooting the latest Android version is more difficult than it seems. However, earlier today he managed to root Android Q, but only for the Google Pixel, Pixel XL, Pixel 2, and Pixel 2 XL. Sadly, the Google Pixel 3 and Pixel 3 XL can’t be rooted just yet.
If you have a Pixel, Pixel XL, Pixel 2, or Pixel 2 XL, you can root your phone by switching to the Magisk Canary channel. Once you’ve rooted your phone, one thing I highly recommend you try is enabling the system-wide dark mode but disabling the forced dark in third-party apps. Enabling the dark mode can be done without root, but disabling the forced dark in apps like Google Photos required root to change a system property. As for Pixel 3 or Pixel 3 XL owners, you’ll have to wait for topjohnwu to figure out how to make Magisk work on the latest update for these two devices.
So what’s holding up Magisk support on the Pixel 3? The reason has to do with logical partitions and overlayfs. Logical partitions involves one real partition of storage, divided into dynamically resizable partitions like system, vendor, odm, oem, product, etc. Overlayfs, or overlay file system, basically overlays the contents of one directory tree on top of another. Conceptually, it’s kind of like Magisk, though the way it works is different. Both logical partitions and overlayfs have been implemented to make Dynamic Android possible in Android Q, though XDA Recognized Developer phhusson believes they’ll be used for more than that.
The Google Pixel 3 and Pixel 3 XL have logical partitions, while the Pixel, Pixel XL, Pixel 2, and Pixel 2 XL do not. topjohnwu says that the Google Pixel 3’s logical system partition is no longer recognized as an EXT4 image, so his previous system mounting methods don’t work. According to topjohnwu, Magisk hijacks the mounting of everything including system, vendor, product, odm, etc., during the booting process, then “copies the root directory from system to rootfs,” then patches sepolicy using data from the mounted partitions, and lastly patches the init process to load the patched sepolicy. He says that he needs to look into how to mount logical partitions in the early boot stages, which involves learning how device-mapper works.
That’s where Magisk is at right now with regards to rooting Android Q. If topjohnwu makes progress on rooting the Pixel 3 running the beta, we’ll let you all know.