[Nexus 6P Android Development] nathanchance:
Android Pay and Pure Nexus

As of the June 21st build, Android Pay works right out of the box as Pure Nexus is not rooted by default, assuming you used the Pure Nexus GApps and did not install any other system modifications. You can install systemless root if you want root access.

ARCHIVED POST:

EDIT (1/29/16): It appears Google has discovered a way to block systemless root with SafetyNet. Multiple people in several threads have reported this, including people running stock, so it is not a ROM problem. You need to use the UnSU file listed below to unroot Pure Nexus then it will work. I will leave the post intact but I outlined the potential fail points in red. If you want AP to work 100%, skip the red parts which involve systemless root.

EDIT (2/18/16): Someone in the Nexus 5X forums posted a workaround here that will allow you to have systemless root and Android Pay at the same time. This may change and I stand by my point that going unrooted is the only 100% sure way to have AP working but I will put this here anyways for people to try. Follow the guide below, including the red parts, then do the chmod trick from that thread and it should work. If it doesn't, use that thread for support rather than this one OR do a full unroot.

EDIT (3/15/16): Chainfire has added the chmod trick as of SuperSU 2.68, making it a little easier to support. The process has been updated but I cannot confirm where or not it fully works.

EDIT (6/19/16): I have attempted to update this guide to the best of my ability without messing with my device too much. A lot continues to change and I will do my best to keep up with it.

How to install Pure Nexus for Android Pay (clean install):

1. Download the latest Pure Nexus zip, the latest PN GApps (Banks GApps are a minimal alternative), the latest SuperSU (preferably 2.68+), and a custom kernel if you want one onto your phone.

2. Backup any important data.

3. Boot into TWRP and wipe everything but internal storage in Wipe > Advanced Wipe.

4. Flash Pure Nexus.

5. Flash GApps.

6. Boot up, set your phone up, then go into Settings > SuperSU > Settings and perform a full unroot.

7. Boot into TWRP.

8. Go to Mount and tick System. Then go to Advanced > File Manager. Delete /system/etc/permissions/com.google.android.camera2.xml and /system/framework/com.google.android.camera2.jar.

9. Type these commands, one at a time, into Advanced > Terminal Command > Select current folder in lower right hand corner:

echo SYSTEMLESS=true>>/data/.supersu
echo BINDSYSTEMXBIN=false>>/data/.supersu

The first one forces systemless, the second prevents /su/xbin_bind from existing.

10. FlashSuperSU 2.68 or higher, your custom kernel if you want it, and the FiFix dialer.

11. Reboot.

12. Perform a chmod on /su/bin, changing the permissions to 751. This is not necessary with SuperSU 2.68 and above since this is already done.

How to install Pure Nexus for Android Pay (dirty, if you are already on Pure Nexus or updating Pure Nexus):

NOTE: In order for you to be able to get Android Pay working, you must already have the Dynamic Pure Nexus GApps OR Banks GApps installed. If you don't, you need to clean install using the above process.

1. Download the latest Pure Nexus zip and a custom kernel if you want one onto your phone.

2. Perform a full unroot in Settings > SuperSU > Settings (if you have done this process before, skip this step).

3. Boot into TWRP and make a backup (optional but HIGHLY recommended).

4. Type these commands, one at a time, into Advanced > Terminal Command > Select current folder in lower right hand corner:

echo SYSTEMLESS=true>>/data/.supersu
echo BINDSYSTEMXBIN=false>>/data/.supersu

The first one forces systemless, the second prevents /su/xbin_bind from existing.

NOTE: This only needs to be done once per clean flash so if you did it before and haven't wiped /data, skip this step.

4. Flash Pure Nexus zip.

5. Go to Mount and tick System. Then go to Advanced > File Manager. Delete /system/etc/permissions/com.google.android.camera2.xml and /system/framework/com.google.android.camera2.jar.

6. Flash your custom kernel if you want it and the FiFix dialer.

7. Reboot and profit

Android Pay still doesn't work!

At this point, there is a lot of stuff that is needed to make SafetyNet pass because of how much Google is locking it down. These steps may give you some stepping off points but [MENTION=5244502]micmars[/MENTION] is very dedicated to this cause and has provided a thread here for support.

1. Make sure SuperSU 2.64+ is systemless in SuperSU > Settings > Install SuperSU into /system (it will mention it isn't possible with systemless root). If it is system root, you must follow these steps to switch:

a. Delete /data/.supersu (if it exists)

b. Go into SuperSU > Settings and do a full unroot.

c. Boot into recovery and navigate to Advanced > Terminal Command.

d. Select the current folder (should be root or / by default) in the lower righthand corner.

e. Type the two lines below (one at a time):

echo SYSTEMLESS=true>>/data/.supersu
echo BINDSYSTEMXBIN=false>>/data/.supersu

The first one forces systemless, the second prevents /su/xbin_bind from existing.

f. Flash SuperSU.

g. Reboot and attempt to setup Android Pay.

2. Make sure /su/xbin_bind does not exist. If it does, delete it and reboot.

3. Make sure you do not have Xposed installed.

4. Make sure you don't modify your DPI.

5. Make sure if you are flashing anything additional to these steps (like adblocking or an app) that it works with systemless root.