yashsingh1/xdaforums huggingface dataset:
[Magisk] poulopoulosa:
As I said earlier in another reply in this thread, I tried to logcat for the weekend AP to see if it actually does "safety net caching". I read that reboot and disabling root immediately after boot works for some people as well.

The logcat failed to store the log (I am not expect in logging but I will find a way to log for the day) so I have nothing to show, though here are some findings.

a)I had enabled root for half a day then disabled it 1 hour before transaction, AP failed.

b) later on the next day (the root was already disabled from Saturday) I tried to make a transaction without reboot, AP succeeded.

So in my speculation again is that indeed AP caches safety net checks possibly at stable/random intervals. It is highly possible cuz it needs internet to work but also it has to work independently without internet in case of low signal so cached checks could be ideal.

Again these are my findings I may be completely wrong, and misinterpreting some facts. Will check again wth proper logging soon.
[Magisk] CSX321:
I wonder could we kind of invert how we're trying to do this, and leave root normally unmounted, but use Tasker to mount it only when running things that need it? That might greatly increase the chance that it will be unmounted whenever AP does a check. I may experiment with that.
[Magisk] westeight:
Working on my HTC 10 :)

LeeDroid, ElementalX, pnp

1. Flashed UPDATE-unSU.zip using TWRP

2. Flashed phh-superuser-17-magisk.zip

3. Flashed Magisk-v6.zip

4. Flashed xposed-v86.5-sdk23-topjohnwu.zip

5. Installed Magisk_Manager_v1.2.apk

6. Installed XposedInstaller_by_dvdandroid.apk

7. Ran SafetyNet checker with root toggled off

8. Added a card to AndroidPay
[Magisk] MrBrady:
Actually making a transaction is the real test.
[Magisk] cuneyttekinay:
I read in this thread many times that AP check periodically if root is mounted or not.

If this is periodically starting process and if is possible to determine then when ever this checking process starts, root can be unmounted automatically till the process finish.

Or if there is a file which hold information about root status is read by AP process, also in this time period root can be unmounted.

I don't know about these systems, I am just making prediction to help solutions.
[Magisk] FunkeeC:
I pretty much do this, just w/o tasker. It would be helpful to have an option to allow for root to be toggled off by default on a reboot. I just turn it on to occasionally update adaway or back up my apps w/ Titanium
[Magisk] adrman:
Device Model: Nexus 6P Angler

Android Version: 7.0 (OTA from Stock 6.0.1)

Root solution: phh's magisk superuser 17

Xposed Status: Not Installed

ROM: Stock ROM

Kernel: Stock

Android Pay App Ver: 1.5.130002920

Magisk Ver: 6

Magisk Manager Ver: 1.2

Android Pay Transaction: Success after disabling root, attempting to add a card and then backing out. FWIW, I disabled and did the add attempt about 20-30 minutes before the transaction.
[Magisk] westeight:
For anyone upgrading or dirty flashing a ROM: always make sure to the delete the 'SuperSU' folder many ROMs create. Android Pay finds it every time and SafetyNet fails.
[Magisk] l1ttl3z:
The whole add a card and then cancel for AP to work has tonbe done every time I want to buy something. Is it the same for everyone?
[Magisk] KrisDroid:
I only have to add/cancel following a reboot or if I've left root enabled for a period of time
[Magisk] MDHACK:
Device Model: Galaxy Note 4 N910T

Android Version: 6.0.1

Root solution: phh's superuser

Xposed Status: Not Installed

ROM: Stock ROM

Android Pay App Ver: 1.5.130002920

Android Pay Transaction: Failed. I tried doing the trick of adding a card and going back. The prosses to add the card looked fine, but when I went to make a transaction the phone keeps asking me for my backup password, no matter how many time I enter it, the phone keeps asking and transaction never completes. Root was disabled during the whole process, I keep it disabled during most of the time and only activate it when needed.
[Magisk] Cronus89:
I confirm this is how I got AP to work. It would not work until I tried to add a card, and exited out of that.

Which btw it takes an extra 15+ seconds to do this, oh well :(

Device Model: Nexus 5x (bullhead)

Android Version: 6.0.1

Root solution: phh's magisk superuser 17

Xposed Status: Not Installed

ROM: PureNexus

Kernel: Stock from PureNexus

Android Pay App Ver: 1.5.130002920

Magisk Ver: 6

Magisk Manager Ver: 1.2

Selinux Enforcing

Android Pay Transaction: Success after disabling root and trying to add a card and cancel
[Magisk] g2uzer:
Interesting results, going to have to give it a try with Pure Nexus ROM on my N6
[Magisk] CSX321:
Same here. So far it looks like I only need to add a card/cancel once after rebooting. After that it continues to work unless I reboot again. I'm now leaving su unmounted most of the time. I only mount it (automatically using Tasker) when I explicitly run an app that needs it, and unmount it afterwards (again, using Tasker). The only thing I couldn't get working well that way was CF.lumen, since it is always running a service, but I can do without that for now.
[Magisk] adomm420:
How are you un/mounting root with tasker?
[Magisk] CSX321:
I'm using the old v1 Magisk and DarkN3ss' version of the manager that has intents to enable and disable. I have Tasker widgets for apps that need root to mount root then launch the app. Then I have a profile to unmount root when those apps aren't running.
[Magisk] rgawenda:
I use a quick toggle:

<TaskerData sr="" dvi="1" tv="4.8u5m">
<Task sr="task90">
<cdate>1471178573008</cdate>
<edate>1471648484841</edate>
<id>90</id>
<nme>root off</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>158</code>
<Str sr="arg0" ve="3">root</Str>
</Action>
<Action sr="act1" ve="7">
<code>157</code>
<Str sr="arg0" ve="3">user</Str>
<Img sr="arg1" ve="2">
<nme>hd_ab_device_access_secure</nme>
</Img>
<Int sr="arg2" val="1"/>
</Action>
<Action sr="act2" ve="7">
<code>548</code>
<on>false</on>
<Str sr="arg0" ve="3">Disabling root</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act3" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">$(getprop magisk.supath)/su -c "setprop magisk.root 0"</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
</Task>
</TaskerData>

<TaskerData sr="" dvi="1" tv="4.8u5m">
<Task sr="task91">
<cdate>1471178800696</cdate>
<edate>1471648496286</edate>
<id>91</id>
<nme>root on</nme>
<pri>6</pri>
<Action sr="act0" ve="7">
<code>158</code>
<Str sr="arg0" ve="3">user</Str>
</Action>
<Action sr="act1" ve="7">
<code>157</code>
<Str sr="arg0" ve="3">root</Str>
<Img sr="arg1" ve="2">
<nme>hd_ab_device_access_not_secure</nme>
</Img>
<Int sr="arg2" val="1"/>
</Action>
<Action sr="act2" ve="7">
<code>548</code>
<on>false</on>
<Str sr="arg0" ve="3">Enabling root</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act3" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">$(getprop magisk.supath)/su -c "setprop magisk.root 1"</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
</Task>
</TaskerData>

I call the root on action on boot to create the toggle.

---------- Post added at 09:23 AM ---------- Previous post was at 09:16 AM ----------

$(getprop magisk.supath)/su -c "setprop magisk.root X"

Use 1 or 0 instead if X to enable or disable.
[Magisk] henry_gale:
Device Model: Nexus 6

Android Version: N DP5

Root solution: phh's magisk superuser 17

Xposed Status: Not Installed

ROM: Stock

Kernel: Stock

Android Pay App Ver: 1.5.130002920

Magisk Ver: 6

Magisk Manager Ver: 1.2

Android Pay Transaction: Success after disabling root, attempting to add a card and then backing out.

Thank you topjohnwu
[Magisk] Rohaq:
Finally got to do a test purchase:

Device Model: HTC 10

Android Version: 6.0.1

Root solution: phh's superuser

Magisk Version: v6

Xposed Status: Disabled/Not installed

ROM: Viper10 2.9.0 | 1.90.401.8

Android Pay App Ver: 1.5.130002920

Android Pay Transaction: Failed

Passes in SafetyNet Helper, and I was able to add a card in Android Pay, but it failed when I actually tried to make a purchase.
[Magisk] waylo:
Did you try adding a card immediately before the transaction? That's essential.
[Magisk] Rohaq:
I haven't tried that yet - I'll give it a go next time.

Guessing they've added some kind of root checks when the app isn't in use?
[Magisk] waylo:
That's the general consensus. No one is quite sure how often it occurs at this point though.
[Magisk] thechilipepper:
I have information regarding the timing of safety net root checks. But first, phone details:

Device Model: Nexus 5X

Android Version: 7.0

Root solution: phh's superuser 17

Magisk Version: v6

Xposed Status: Not installed

ROM: Stock NRD90M

Android Pay App Ver: 1.5.130002920

Android Pay Transaction: Success!

Last night, before bed, I unmounted root in magisk manager and tried adding a card, canceled, and remounted root. This was after midnight, while plugged into power. The next morning, I purchased a coffee around 11:30 am with no problems, having not tried adding a card since before bed and leaving root enabled since before bed. A few hours later, at 3:30 pm, I tried finale a purchase and it failed until I unmounted root and tried to add a card again.

This data leads my to hypothesize a few details about the check:

The check does not occur for at least 12 hours. I had last passed safety net a little after midnight, but was still able to make a purchase under 12 hours later. In the afternoon, it failed. Perhaps the check merely occurs at noon (and perhaps midnight as well). Tonight, I will plug in and perform the safety net check before midnight, then make a purchase in morning.

Anyway, these are the datapoints that I can contribute.
[Magisk] Rohaq:
Some timed tests would be good to see if there's any established pattern - we could add a timed event to Tasker/similar to disable root on a timer, then. Think you could drink 24 cups of coffee a day? :)

Though Google's response would likely be to add a degree of randomisation to the check schedule.
[Magisk] daleski75:
Device Model: OnePlus 3

Android Version: 6.0.1

Root solution: phh's superuser

Magisk Version: v6

Xposed Status: Not installed

ROM: CyanogenMod 13

Android Pay App Ver: 1.5.130002920

Fails safety check with CTS profile match: false
[Magisk] waylo:
There must be something about your install that, beyond root, Safetycheck is picking up on. Particularly with CM there are many other steps needed to first de-root, then re-root. Did you do any modification to the stock CM install?
[Magisk] habylab:
That's a great idea!
[Magisk] sansnil:
I've been testing out suhide and it does cloak root from AP so you don't have to trigger an AP root check but of course Xposed fails it. If we could combine Magisk's ability to hide Xposed with suhide doing the same with root it'd be perfect. :)
[Magisk] Rohaq:
Got any more info on suhide? Could be useful for us folks who don't have Xposed installed :)
[Magisk] sansnil:
Search is a wonderful thing...

http://xdaforums.com/apps/supersu/suhide-t3450396/page22
[Magisk] Alxoom33:
Goooooooogle ;-}
[Magisk] Dyspr0sium:
Device Model: OnePlus 3

Android Version: 6.0.1

Root solution: phh's superuser

Xposed Status: Enabled

ROM: Stock (3.2.4)

I could tap and pay no problem with my bank's app, NAB (National Australia Bank) on version 7.4.7. Recently they updated the app to 7.4.8 and NAB Pay doesn't work (can't add cards, can't tap and pay) any more even with root unmounted. It seems that they have a way of detecting Magisk (apparently ASB New Zealand works on the same system, and doesn't work any more either). Downgraded back to 7.4.7 and Tap and Pay works again.
[Magisk] cbarai:
Device Model: Oneplus 3

Android Version: 6.0.1

Root solution: phh's superuser

Xposed Status: Installed and enabled

ROM: Oxygen OS 3.2.2

Android Pay App Ver: 1.5.130002920

Android Pay Transaction: Success

Updated to the latest version of Magisk ( v6) and transactions are now going through. :)
[Magisk] g2uzer:
Now I'm confused lol, do I flash phhs superuser, magisk and install both apps( phhs and magisk app) in order to get AP to work?
[Magisk] thechilipepper:
Yes, you need phh's superuser app to grant root to apps and magical manager to unmount and remount root. In order to actually pay, you'll have to unmount root in the magisk app and then try to add a card in android pay. You don’t actually have to add one, you just have to get to the select a card screen. Back out, and android pay will work.

You can actually remount root after trying to add a card and before you pay. The app doesn’t check the status at the time of purchase. We're not sure how long the window lasts, but I've waited 11 hours in between safety net check and purchase.
[Magisk] cpetersen2791:
UnSU, Suhide 0.16 + supersu 2.76 on AICP for shamu with latest AP = successful transactions! No xposed! Woo Hoo
[Magisk] HamsterHam:
Suhide stopped working for safetynet just now. Chainfire confirmed it.
[Magisk] waylo:
This is not the suhide thread, so let's keep the 2 separate.

(But good/sad to know that safetynet is catching up).
[Magisk] cpetersen2791:
It was a way to communicate so maybe the two can "borrow" ideas from each other.

But it looks like Google plugged the "suhide" hole right now.
[Magisk] Pig Vomit:
Is Magisk / phh combo still working with Android Pay? Before I reinstall (switched to suhide), I want to make sure the overnight SafetyNet changes didn't kill that as well.
[Magisk] Captain_Throwback:
I can confirm that I was able to add my Chase cards to Android Pay today after disabling root in Magisk Manager. As far as transactions go, I haven't gotten that far yet.
[Magisk] M@XLOL:
On mobile I can't see what phone or ROM you are using if it's in a signature. I was not able to add my card Nexus P
[Magisk] Captain_Throwback:
I have an HTC 10.
[Magisk] sansnil:
My two (unsolicited) cents: I think the Magisk approach which disables root temporarily but globally will prove to be the more reliable approach. Hiding root on a per app basis is going to wind up being a game of whack-a-mole.
[Magisk] westeight:
Finally had a chance to attempt a purchase today.

Card added, SafetyNet passed, root disabled and NFC enabled.

Then... nothing. Tried swiping the phone in all directions. Screen on and screen off. Terminal didn't receive a response from the phone.

Am I supposed to press something? I thought it was literally just a matter of swiping the phone near the terminal, as you do with a credit card.
[Magisk] adrman:
I was able to add my Chase card to AP on my N6P without issue, but of course when I went to buy something, the terminal was dead, so I had use cash. :silly:
[Magisk] johnhazelwood:
I added a Chase card today and made a payment as well.
[Magisk] voland66:
You don't swipe it, you "tap" it wherever the Android/Apple Pay icon is on the card reader. Which basically means you put the phone (back side, I guess) next to/touching the reader and wait a little bit. It helps to know where in your phone the NFC chip is -- I think the range is quite short, so before I knew where my chip is, it would sometimes take me a while before it reacted (but that might just be self-deception though I am pretty sure that it is reacting quite quickly most of the time now).

I believe the phone should be unlocked and/or screen on (but I might be mistaken; since fingerprint unlock is easy, I always do it before paying).

Even if AP pay won't work it should at least come up and say that it won't work on rooted phone. If it does not even come up, it is probably not related to root but rather not tapped correctly.
[Magisk] jhedfors:
Oneplus One. No Exposed. Used Chase Visa, no problem :)
[Magisk] MrBrady:
Did you do the "add card and back out" trick? Or just disabled root?
[Magisk] jhedfors:
I did not, as I had not rebooted since I actually added the card. I keep root disabled by default.
[Magisk] habylab:
Device Model: OnePlus 3

Android Version: 6.0.1

Root solution: phh's superuser

Xposed Status: Enabled

ROM: Stock (3.2.4)

I cannot add a card, after trying the method of backing out. Turns out my banks support of Android Pay is two weeks away, so hopefully we'll find a solution.
[Magisk] KAsp3rd:
Tasker project/task/profile for Android Pay uses KC Tasker and Secure Settings plugins for Tasker.

Import all files into Tasker after you download them.

Checks every 10 seconds if Android Pay is running for startup and exit (only while the screen is on); not sure of battery impact if any.

I have been unable to fully test as I currently do not have a supported card.

Startup

1. Watches for Android Pay to run (requires KC Tasker as well as Accessibility for Tasker enabled)

2. Checks for Magisk supath (errors/stops if Magisk supath cannot be found)

3. Unmounts root (using setprop magisk.root 0)

4. Enables NFC (Secure Setting plugin required)

Exit

1. Once Android Pay is no longer running (in the foreground or in recent apps)

2. Remounts root

3. Disables NFC
[Magisk] rebretz000:
Thank you to the Dev man. I was able to add my CC with no issue. Now just need to find a store in my town that accepts NFC payments.
[Magisk] westeight:
First real life attempt to pay failed today:
[Magisk] westeight:
Imported the Profile .prf and the Task .tsk files. How do you import the Project .prj file?

EDIT: By disabling 'Beginner Mode'
[Magisk] KAsp3rd:
I do believe you should be able to tap the "+" or tap and hold on it and import should be one of the options.
[Magisk] westeight:
Thanks. Seems to have imported successfully:
[Magisk] soder:
Great. Will use this for other apps as well.

Would you please help me with a tasker script to disable Xposed?

/Söder

---------- Post added at 06:28 PM ---------- Previous post was at 06:28 PM ----------

Great. Will use this for other apps as well.

Would you please help me with a tasker script to disable Xposed?

/Söder
[Magisk] habylab:
Fantastic work.

Does this somehow make it work if the other current methods do not work?

Thanks!
[Magisk] westeight:
Do you have a link / more info for this project?
[Magisk] KAsp3rd:
No it does not. When I have some time I'm going to try to track down when it does the safetynet API call and try to force that action when you open Android Pay
[Magisk] soder:
Also, I edited to actives on more then Android Pay. Is it possible to save the app that is stunning, that activates the Tasker task, as we kind of variable, the later use for running just that app at the end of unrooting?

/Söder
[Magisk] rgawenda:
AFAIK xposed can't be (un)loaded without a reboot
[Magisk] soder:
It can, in the systemless version.

/Söder
[Magisk] rgawenda:
Sure?
[Magisk] chrisc93:
I got this:

/system/xbin/su
[Magisk] mrjiggywiggy:
On the Nougat DP5 on my Nexus 6 I can pass SafetyNet but get the unroot your device message when paying. I'm using phh's su and it works fine without root. Any info I can provide to try and fix it?

Edit: I did a reflash of the system, magisk, and su and it works now. Weird.
[Magisk] topjohnwu:
This means your rom is prerooted.

Delete that file in TWRP!
[Magisk] chrisc93:
Hmm. That's odd because I compile PN on my own and I removed (and so has Beans) flashing SU after the kernel. AP works on a dirty flash too.

But I'll try deleting that file.

EDIT: That file didn't exist
[Magisk] topjohnwu:
OK thanks for the info. May you contact me on Hangouts?

PM me your email, thanks a lot!
[Magisk] joeyddr:
Symlink?
[Magisk] chrisc93:
It must be. I'm reflashing PN now but I ran the Systemless SU commands before.

EDIT:

Okay so it is a symlink. I ran ls -la on /system/xbin and this is what I got.

lrwxrwxrwx root root 1970-11-04 08:13 su -> /magisk/phh/su
[Magisk] bouchigo:
Did you actually disable root using the Magisk Manager app before running the adb shell command?
[Magisk] chrisc93:
I did. Other apps like RootExplorer and Terminal Emulator can't gain root. But this symlink sticks. After 5 minutes all apps can access root again
[Magisk] bouchigo:
I'm on DP5 and I get this (first command is with root enabled, second is with root disabled):

Are others on PN having the same issue as you, or do you seem to be the only one?

Root Explorer didn't want to work, so I had to install FX Explorer; it must be a DP5 issue.
[Magisk] chrisc93:
Others on PN are having this issue, so it has to be related to the ROM. I'm going to dig into the rom source to try to find the culprit.
[Magisk] :
Since I still cannot make purchases with AP even with the V2 stuff I am going back to stock unrooted so if there are any updates to test let me know I can quickly flash them and try again

Cleanup:

fastboot flash boot boot.img

fastboot format system

fastboot flash system system.img
[Magisk] n2phoenix:
Hey everyone,

I saw that you needed testers, so I thought I'd contribute my findings here:

I have a Nexus 5X H791, originally unlocked and rooted with systemless SuperSU. When I ran into the Magisk projects, I got really psyched about trying it out! I removed root via the SuperSU app and for good measure I restored my entire phone except the data partition (thereby leaving my apps) to the latest August 5th factory image from Google. I then flashed the following zips in this order:

1. Magisk v2

2. phh-superuser-magisk-v2.zip

3. xposed for magisk zip

However, on rebooting, I found that the Magisk Manager wasn't installed. Even on installing phh's superuser app from the Play Store, I couldn't run any root apps on my phone. I was finally able to resolve it by flashing the Magisk v1 zip, which gave me the app.

Using Magisk Manager to toggle root mount to disabled but keeping SELinux Status on Enforcing, I attempted to add a card in Android Pay - and it worked! I don't have a credit/debit card to try making payments on right now, but I hear that you've passed the CTS test if you can open the app immediately after installing it, trying to add a new card, and while making a payment.

Seeing as it worked on the second method, I'll hazard a guess that it really does work.

Found something more:

1. Tried entering the Add A Card page before disabling root mount in Magisk Manager (MM). Didn't show up, having failed the CTS/AP check.

2. Toggled root mount to disabled in MM, then tried opening the Add A Card page in AP. It worked fine.

3. Mounted root again in MM and trying to add a card again in AP - it worked, again!

However, I did find that while SELinux was enforced, other root apps still didn't work. On setting it to permissive, they worked - and Android Pay also still worked! However, I'll keep it on Enforced for now because I'm not sure what security vulnerability this leaves open.

But as a whole I think this method is a success until Google finds a workaround. A great thank you to all the developers behind all the code, especially topjohnwu!
[Magisk] waylo:
Unfortunately, there have been multiple reports of being able to add a card but not actually getting a transaction to go through. It's still unclear where the hangup is.
[Magisk] Chahk:
Being able to add a card is not a true test of AP working. If you have Xposed enabled, the payment will not go through. Can you try disabling Xposed via Material Xposed Installer, rebooting, and trying to buy something?
[Magisk] datafoo:
Ditto, Magisk Manager doesn't appear in the app-drawer after flashing Magisk V2.

Appeared fine with Magisk V1

HTC 10 Stock 1.80.617.1 on Marshmallow 6.01 using PHHs superuser magisk v2.

Also I'll post this in PHHs thread but his superuser app is buggy and once you turn off logs, glitches and then doesn't allow you to modify the app notifications. Doesn't appear to be as reliable as SuperSU FWIW.
[Magisk] nomadism:
The new FAQ added in the OP address this issue. You can delete the former Magis manager and try intalling PHH superuser v2 again, or if that didn't work (like me!), unzip the PHH superuser file and install the Magisk.apk as a system app.