The SuperSU root package does not work on the new Android M preview and installing it results in boot loop. The developer of the root, recognised XDA member, Chainfire, had also said that the Android M preview root needed to be fixed, although there are some modified workable kernels, which are SELinux disabled.
The custom kernels are available for both Nexus smartphones Nexus 6 and 5, which are on the Android M developer preview, with due credit to recognised developer, DespairFactor, for releasing the Despair kernels. Hit the thread over the XDA forum here and here to know more about the Despair Kernel.
You can now root the Nexus phones but you need to flash the new SuperSU beta version 2.49, after flashing the Despair custom kernels for respective Nexus devices, through TWRP recovery.
The Nexus phones should be running Android M preview build MPZ44Q. Do not try this on any other models. Also, do not forget to create a backup before rooting following the root method. Rooting your phone will nullify its manufacturer's warranty.
Neither IBTimes UK nor the developer will be held responsible for any damage to the device.
How to root Android M developer preview MPZ44Q on Nexus 6 and Nexus 5
Step-1: Install TWRP recovery for the Nexus phones
Step-2: Download the custom kernel and SuperSU file from the above download links
Step-3: Move the downloaded files to the phone's storage and remember the location
Step-4: Boot the phone into recovery mode.
- Switch off the phone
- Press Volume Up, Volume Down and Power buttons together. Your phone will be in Fastboot mode
- Now press Volume Down button twice to get recovery option then press Power button to select it
Step-5: Create a backup of all data of the phone. This is optional. In recovery select Backup then swipe on the Swipe to Back Up option at the bottom of the screen. Wait until the process is complete
Step-6: Root Nexus 6/5 on Android M preview build
- Flash the custom kernel first. From the main recovery menu, select Install, navigate to and select custom recovery file (Despair kernel) and do a swipe on the Swipe to Confirm Flash option
Step-7: Follow the similar process to flash the SuperSU file
Step-8: When the root package has installed, reboot the phone, select Reboot>> System
Your phone will restart with the Android M firmware rooted successfully.