[Nexus 6P General] TnT_:
Before I get into this guide I am going to start off with a disclaimer. If you break or harm your device. Or make it unbootable. This is not my fault, and you understand that you are doing this at your

OWN RISK.

Now let's get into the guide! :D

Tip for Section Number #1: If you are having trouble using the windows file explorer or any other OS, use Sync by BitTorrent and sync files to your computer, I am not promoting the app for any self gain, just a suggestion

NOTICE: ROOTING THE N PREVIEW IS ONLY POSSIBLE USING A DECRYPTED DEVICE FROM MY KNOWLEDGE

This will be separated into sections. As listed below:

Installing Android N with working TWRP

Rooting Android N Preview

Enabling Permissive SELinux without a instant reboot

More may be added in the future!

Installing Android N with a working TWRP

Easier method :

If you have Marshmallow already installed, you can enroll your device for a OTA of Android N Developer Preview. Or you can install Marshmallow and then do the same.

Longer method :

Backup all your userdata files (I MEAN EVERYTHING!) this will erase all of your files if you want a working TWRP.

1. Download the Android N .tgz file for your device from here -=OPTIONAL=-Download the modifed boot image with decryption on boot disabled for your Preview version here

2. Decompress/extract every file. (the main file and the image directory) I would recommend having all of them in the same folder

3. Make sure you have fastboot, then open a terminal/command prompt in that folder - Shift + right click in windows then open command prompt here

4. MAKE SURE YOU HAVE YOUR DATA BACKED UP, THIS IS NECESSARY IF YOU WANT TO KEEP YOUR FILES AND HAVING A WORKING TWRP - optional

5. Boot your device into the bootloader, power down your phone (this is for nexus 6p) and hold the power button + volume down until you see a Android figure laying down

6. Do the following commands in a terminal with fastboot installed - this is inferring you have a unlocked bootloader

fastboot flash bootloader bootloader.img

fastboot reboot-bootloader

fastboot flash radio radio.img

fastboot reboot-bootloader

fastboot flash vendor vendor.img

fastboot reboot-bootloader

fastboot flash system system.img

fastboot flash boot boot.img - the modified one you downloaded, if you did.

fastboot flash recovery twrp-xxxxx-angler

fastboot format cache

fastboot flash cache cache.img

-=OPTIONAL, FOR DECRYPTION AND WORKING TWRP=-:fastboot format userdata - do not flash the userdata.img unless you have a 32gb Nexus 6P.

fastboot reboot

Now, once the device boots. Set it up and go to Settings>Security and under encryption if you want a working TWRP, it should say Decrypt phone. If not, look back and see if you did a step wrong.

Rooting Android N Preview xx

1. Download the latest BETA of SuperSU - or anything above 1.74. BETA onto your device's sdcard directory. (otherwise known as /storage/emulated/0/)

2. Reboot your device to TWRP by powering off your device, then holding the power button + volume down. Once in the bootloader, tap the volume down button until you land on Recovery. Then press the power button.

3. Go to the install section, and flash your SuperSU zip.

4. Reboot, it may reboot a few times. Let the device run it's course until it lands at the lockscreen, this is important.

Enabling a permissive SELinux without a instant reboot

Follow the guide here

In other words, download the logd file and copy and paste it to /system/bin/ then replace the other file after backing it up.

Then do

setenforce 0

in a terminal with root access on your device and then do getenforce to check if it's working.

This enables you to restore backups using Titanium backup, as it doesn't work without doing this.

Credits

Credit for SuperSU goes to [MENTION=631273]Chainfire[/MENTION]

Credit for the modified boot.img goes to [MENTION=5317224]Tigerstown[/MENTION]

Credit for getting Permissive SELinux to work on Android N goes to [MENTION=2669141]gubacsek[/MENTION]

I do not take credit for any of the downloaded content, all of the downloaded files goes to their original creators.

PM me if anything is wrong, or edit this post!

Mods, if this post is in the wrong place. Move it to the correct place please!

Happy modding of your Nexus 6P on Android N Preview! :D ;)