Google rolled out the first developer preview of Android O almost a month ago. Quite shortly after, Chainfire, the developer of SuperSU, found a way to root the latest Android. That method only worked for the Nexus 6P and 5X and not the Pixel or Pixel XL. The Pixel and Pixel XL both have a dual partition system, and a patch of code that handled them seemed to be causing problems with the earlier method. But Pixel user Sachi315 has finally discovered a way to root Android O Developer Preview on the Google Pixel and Pixel XL.
The method involves installing Android 7.1.2 Nougat on one of the partitions and Android O on the other. This allows Android O to boot even after installing SuperSU.
- Android 7.1.2 for Pixel (XL) -N2G47E
- Android O for Pixel (XL)
- SuperSU RS4 2.79 Extra Delay
- TWRP RC1 bootable image & RC2 Flashable zip
–For Pixel XL
- Latest ADB and fastboot binaries for Windows/Mac/Linux
Set up the latest fastboot binaries
- Extract the fastboot/ADB binary folder “platform-tools” and place it in the C: drive inside a folder named Android. You can put it anywhere you want actually but it’d be better to place it somewhere that’s out of the way.
- Go to Control Panel> System and Security > System. On Windows 10, the Control Panel can be accessed by right-clicking on the start button. However, in the latest creator’s update to Windows 10, that options seems gone. You can still press the Windows key and then type System to search and open it directly.
- Under Computer name, domain, and workgroup settings click Change settings.
- Click on the Advanced tab then at the bottom click Environment Variables.
- In the new window that opens, double-click Path under the System Variables section.
- Click New and put in the location of the platform-tools folder earlier extracted. If you chose to put it in the location we specified, the path should be C:\Android\platform-tools
- Press Enter or click OK and it should be the newest entry at the bottom.
- Click OK again and reboot your PC.
The latest ADB and fastboot binaries should now be installed on your PC. To check if it installed correctly, open command prompt. Type fastboot and press Enter. This should display all the available fastboot commands including the new “–slot” commands. If you can see the new slot commands at the bottom, you are ready to move on.
Edit flash-all.bat in Android 7.1.2 and Android O factory images
- Extract the image file into a folder.
- Find the flash-all.bat file in the extracted contents and right click on it, then select edit.
- For working in the file, it’d be better if you clean up the mess it is. That is, separate the commands into several lines. This does not affect the code or the way it functions but makes it easier for us to work.
- Towards the end of the text in the file, add –skip-reboot between update and image-sailfish-n2g47e.zip. This command makes sure that the device will not reboot after the flashing is complete.
- Now we need to add some commands to make sure the image installs only into the first partition. Below you can see how it looks after adding the commands. Type in the –slot commands in the exact places as shown in the image below.
- If you are working on the Pixel XL (codenamed marlin) image file, the image name and the device codename will be different, but everything else is still the same. The same commands need to be placed in the exact same places.
- Once the changes are made, save the flash-all.bat file and close the folder.
- Do the exact same changes to the flash-all.bat of the Android O image. Except, this time ass –slot_b instead of –slot_a as shown below.
- Save it too and exit.
Flash the images
Warning: The process will completely wipe out your phone so make sure you backup all of your data on an external storage or you PC.
- Power off your Pixel/Pixel XL.
- Press and hold the power and volume down buttons to boot it into the bootloader mode.
- Connect your phone to the PC with a USB cable.
- Open command prompt and type
fastboot --slot _a -w
- When the command is executed and everything is done, type
fastboot --slot _b -w
- This wipes both the partitions on your device. Now enter the following command
- Then type
- Your phone will now boot into the bootloader again.
- Close the command prompt window and run the flash-all.bat file from the Android O Developer Preview folder.
- After the process is complete, run the flash-all.bat from the Android 7.1.2
- Once that is done, open a new command prompt window and type
- Then type
- When the phone boots into the bootloader mode again, make sure it says slot “a”.
Install TWRP and Root
- Boot your Pixel into recovery mode now using the volume and power buttons.
- Check on your PC if you can access your phone’s internal storage. If not, go to wipe>advanced wipe and check internal storage only, then wipe this partition. Unplug your phone and then plug it back in. You should now be able to access your device’s internal storage.
- Transfer TWRP RC2 and SuperSU sr4 2.79 Extra Delay to your Pixel/Pixel XL.
- Select Install and then flash the TWRP RC2 recovery.
- Switch to slot b in TWRP now and then reboot to recovery.
- When your device boots into recovery now, it should be in slot b. To check this, select Reboot and look at the bottom of the screen.
- If it says slot b, flash SuperSU SR4 2.79 Extra Delay.
- Reboot to the system now.
When your Pixel boots up, it should boot right into Android O. After finishing the setup, you should find SuperSU installed on your phone.