yashsingh1/xdaforums huggingface dataset:
[Magisk] hanneshoch3:
Same problem here, running pie on mate 10 pro using PayPal. Play services is 17.1.22. Not really looking to downgrade anything except possibly gpay.
[Magisk] eelsid:
CTS profile and basic integrity are both true and the root beer fresh app shows all tests with a green check and "not rooted". So strange. I would try relocking the bootloader to test that but I don't want to factory reset.
[Magisk] PuffDaddy_d:
17.1.22
[Magisk] bigknowz:
SQL

[MENTION=2449699]BostonDan[/MENTION] thanks for the SQL lesson, cards added and Play Store defrosted with GMS 17.1.22, the link for the Play Store isn't working, which app are you using? Chose aSQLiteManager, makes me queasy giving an app like this root. Thoughts appreciated.
[Magisk] jcmm11:
I've been using aSQLiteManager (plus aShell - companion app) for ages. I keep trying newer apps but so far all of them lack something in comparison (even if they are prettier)

If your phone is arm64 there's also a Magisk Module that will give you a sqlite binary enabling command line SQL.
[Magisk] bigknowz:
[MENTION=2449699]BostonDan[/MENTION] getting love from [MENTION=4470081]topjohnwu[/MENTION] on Twitter, congrats!
[Magisk] BostonDan:
Wow. That is a big compliment! Thanks for pointing this out to me, since I don't usually go on Twitter due to lack of time.

Cheers,

B.D.
[Magisk] PuffDaddy_d:
To be clear, should we have also changed the lines that say "attestation" to 0 as well? That's what I did, but got the card declined error.

Also, my cards were already loaded into GPay even though my GPay wasn't working. Now that it's working again, do I have to remove the cards and re-add them?

EDIT: I already disabled the card and reactivated it and it worked perfectly! My bank had cancelled my GPay access after Gpay stopped allowing me to use it. THANK YOU SO MUCH for this work around, and hopefully, it sticks this time!
[Magisk] BostonDan:
I changed anything in column a that had in it's name attest or attestation. The following are the ones I changed to 0 from 10:

attest

ad_attest

Tapandpay_attestation

Cheers,

B.D.
[Magisk] Nhyphk:
I've just come here to say that after the last update I didn't get the root error anymore. Maybe Google fixed it themselves? I meant not fix it but they're not able to recognize root anymore if we hide it well.
[Magisk] bravoxray23:
Tried just now. Still doesn't work. :(

Called bank so many times they keep saying they've reset their end and nothing seems to be wrong on their end.
[Magisk] lssong99:
Great! I just followed the instructions by [MENTION=2449699]BostonDan[/MENTION] and finally GPay allowed me to add a new card!!!! Will try to use it tomorrow to see if everything works.

You could find his original thread here--> https://xdaforums.com/apps/magisk/magisk-google-pay-gms-17-1-22-pie-t3929950

Anyway for those sqlite impaired (maybe 99.999% of world population) I have write a command line instruction for you here:

https://xdaforums.com/showpost.php?p=79538450&postcount=58
[Magisk] PriMieon:
As far as I know GPay doesn't work on Q yet
[Magisk] kaiser_tytnii:
It works! Thank you!
[Magisk] PuffDaddy_d:
I love this community! It's not as active as it once was during the golden days of Android development, but there is nowhere else on the internet where I can go to find a group of nerds like me who are dedicated to making technology work the way we want it to, and not just settle for stock. God bless xda! ?
[Magisk] Nosferatu.:
17.1.22 and gpay 2.88 just paid at Chic FIL a no issues. Haven't touched app since April

OxygenOS 9.0.13 rooted OnePlus 6T
[Magisk] woohoo83:
Fixed Google Pay Detected Root Error

BostonDan and lssong99, you both rock! These instructions have finally got me past the dreaded Google Pay detected root!!! Great job and hope it holds.
[Magisk] eelsid:
After flashing back to stock Pie May update, I logged in to Google during the setup wizard and without restoring any of my backed up data of installing Magisk I installed Google Pay and still was not able to activate my card for instore payment. Thinking it was because of my unlocked bootloader I installed the Sultan kernel and still no dice. I then tried a different card and it worked! I'm tempted to go back to Q to see if it still works, because I did get rid of the "rooted" message on Q (using [MENTION=2449699]BostonDan[/MENTION] great info) and was only stuck on the "something went wrong" message which is also stopping me on Pie for that card. For anyone else having that error, it may be your bank has blacklisted your card due to too many adds and removes when Pay detects root over the last few months.
[Magisk] BostonDan:
When this happens (card not able to be activated for payment), try calling your bank to see if they can reset it. If it still does not work, I don't know what else to try.

Hope this helps.

Cheers,

B.D.
[Magisk] clambert11:
In my case GPay was working and then suddenly stopped. My card had already been added.

Someone on here mentioned running Magisk in core only mode. I don't use any modules so it seemed like a no-brainer to try. It actually worked for me. An easy fix.

YMMV though. It may behave differently if you have to add cards.
[Magisk] Pommefrais3:
What Issong99 means when he said : SQlite impaired ?
[Magisk] Itachisasuke:
I wonder if its possible to take advantage of some kind of file mirror within a Magisk Module to point the database location somewhere else where the attestation checks can be set as constants in a mirrored database.

Something similar to host file redirection.
[Magisk] Droiderat:
What are the downsides of using Magisk hide (on Google Pay and Google Play services)? By using it (with Magisk 18.2 Canary), I've re-enabled Google Pay, but I'm interested in the risks/trade-offs, if any.
[Magisk] habylab:
None AFAIK.
[Magisk] D-m-x:
Well, good that I found this Topic. Tried to pay for gas yesterday and was denied. Figured "what the hell" because in GPay everything seems fine. I love GPay but I would never ever leave my brief case at home completely because of those situations, even more prone to happen if you have customized/rooted your phone.

Let's hope John finds a fix to make it work again, until then I'm using physical cards. Don't have the intention to mess with Play Services or the system in any way, easier to wait, but thanks for the tutorial!
[Magisk] rgnf:
Worked for me too just a few minutes ago.
[Magisk] beatschubser:
Same here. Like everything from Google, GPay is not 100% reliable. And at least here in Germany there are still (very few) terminals that don't support wireless payment.
[Magisk] buffal0b1ll:
I got Pay to add a card for point of sale and succeed at a couple terminal transactions by following these steps. I'm using Magisk Canary 18.2 (18112) on March patched pixel 2.

1. In magisk hide all 11 play services (show system in hide interface and search play services to find them all).

2. Settings>security> Disable device admins for Find Phone and Google Pay

3. Settings Apps>Show system>Google Play Services>3 dot> Uninstall updates

4. Clear all app data for Play Services. I did this twice for good measure

5. Settings>apps>Google Pay>Clear all app data. I did this twice for good measure

6. Reboot

7. Update Play Services to beta 16.0.81. (get APK from APKmirror)

8. Reboot

9. Launch Google Pay and add the card for point of sale transactions

10. Reenable device admin for Find Phone
[Magisk] andmail:
This is what I need for Magisk 18.1 to work again (in full mode).
[Magisk] joeyddr:
so i got mine to work on my 2xl/stock I followed the initial fix and downgraded, after i downgraded i went into airplane mode and installed the latest canary build. I rebooted then went into magisk hide and hid gpay and all related google play services i could find in there, after that i turned off airplane mode and registered my card again in gpay along with paypal. I then went to test at a terminal and it worked, I then let play services upgrade to 15.0.90 and rebooted tested again and it still worked, this morning on my way into work I tested at another terminal and it still working.
[Magisk] nowster:
It looks like Canary hides Google Pay and Google Play services by default (in build 18112).
[Magisk] joeyddr:
They were not checked when i hid them unless its kinda a given.
[Magisk] nowster:
Maybe the default is applied for new installs, but not on upgrades?
[Magisk] joeyddr:
maybe, when i did canary clean install the app would crash trying to open it so i wound up doing 18.1 then upgraded via custom channel and it worked fine.
[Magisk] GizmoTheGreen:
have people in this thread got magisk working on Marlin march update?

on mine the Magisk Manager just acts like it's not installed.

but installer in TWRP says it is... "Magisk patched boot image detected"
[Magisk] sash11:
Yesterday Google Pay started to detect root and refused to work in store payments. I removed all cards, removed Google Pay from device admins, cleared data from GPay and Google Services Framework rebooted the phone, added the two apps to Magisk hide and issue was resolved. I'm on latest beta Magisk channel.
[Magisk] joeyddr:
yeah it seems it holds onto that it was flagged and the only way around it is to do what you said in one way or another like it has to be manually hidden before any setup is done.
[Magisk] godzulu:
This works! Pixel 3XL, latest canary - just added my card :) high five......next I'll test in store

---------- Post added at 04:22 PM ---------- Previous post was at 04:21 PM ----------

This works! Pixel 3XL, latest canary - just added my card :) high five......next I'll test in store.
[Magisk] bbender716:
How did you magisk hide from Google services framework? I can only see Google Play Services...
[Magisk] Sojourner353:
I've let Google Play Services update to latest after downgrading to setup my cards and they all still work on the latest version, seems the downgrade is only needed for the initial setting up.
[Magisk] Windroid-user:
Interesting...

Also thank you OP for this thread
[Magisk] sash11:
You have to click the three vertical dots in Magisk hide top right corner and check show system apps.
[Magisk] joeyddr:
maybe along the lines of the way it does systemless hosts file.
[Magisk] jcmm11:
People that don't know how to use SQL.

impaired: Functioning poorly or incompetently
[Magisk] Pommefrais3:
Thanks for your explication.

English is not my native language, I learned something today! ;)
[Magisk] Emoclaw:
Yes, just create the other two dummy folders and it'll work.
[Magisk] Nosferatu.:
Just wanting to make sure I'm not missing something? I read the last few pages. I'll keep tabs on it but I've had a working Google Pay for the last month and a half.

I'm on 17.1.22 Play Services and Google Pay 2.88 with Magisk 19.1 and Manager 7.1.2. Magisk is NOT repackaged but the Google apps (Pay and Play Services) are being hidden. Works fine. Were 17.1.22 Play Services and 2.88 of Pay the versions that everyone is doing the SQL tweaking or is there a later version that I'm bound to start having issues with? If it's this version that's a problem I'll just not "modify" anything further on my phone and not rock the boat because it's working like a charm with all the Play Service updates and Pay updates that have been going through the past 6 weeks. I followed this guy's directions back in April.

Currently, I backed up my GMS folder just in case for future usage when I was on 16.x. I'll do it again on version 17.x. May I suggest others give this guy's steps a try because I've been fortunate with Pay. Perhaps, downgrade Play Services to whatever was live back in early April as that's when I applied this user's methods.

Otherwise it's likely phone/ROM dependent. OxygenOS is happy with Gpay with this fix. Is there anything I can provide on my phone that may help since everything is working without any fancy trickery.

https://xdaforums.com/showpost.php?p=79246020&postcount=792

EDIT: Pictures for configuration....
[Magisk] MC_Ohr:
That is defenetly too much in the hide list. Never put all apps to it, only the ones that are not running with rooted devices.

Gesendet von meinem HTC U11 life mit Tapatalk
[Magisk] Nosferatu.:
1.) It's not all apps. Not even close.

2.) It's any application I have that's tied to some sort of payment or subscription service. Work software, banking software, apps with a payment attached to them, sports subscription software. No reason for them to ever see device is rooted.

3.) What's the big deal?

BTW, literally just tried again still chugging along fine.
[Magisk] Tr4sHCr4fT:
create triggers each for before insert and before update which set field = 0
[Magisk] jcmm11:
Because of the way they work, since you're modifying the record that you're triggering on, you need after triggers. Other than that yeah, it would be the way to go.
[Magisk] MC_Ohr:
It is because it lags your phone on every app start. But if your phone rings smooth, it's no big deal.

Gesendet von meinem HTC U11 life mit Tapatalk
[Magisk] Tr4sHCr4fT:
shouldn't a before trigger ensure that a positive value will never be written to the database, in case something reads at the same time? i mean at the moment we don't even have to check if OLD <> 0 because we want it to stick at 0 no matter what...
[Magisk] johnd123321:
Can anyone confirm this works? I don't actually have root I just have a rom that hides unlocked bootloader (Xiaomi EU) except it doesn't work for gms 17.1.22

So that would make it hard to use BostonDan's method
[Magisk] Tr4sHCr4fT:
I see, SQLite does not allow updating NEW before Insert.

CREATE TRIGGER i AFTER INSERT
ON main WHEN (NEW.c <> 0)
BEGIN
UPDATE main SET c = 0 WHERE ROWID = NEW.ROWID;
END;

CREATE TRIGGER u AFTER UPDATE OF c
ON main WHEN (NEW.c <> 0)
BEGIN
UPDATE main SET c = 0 WHERE ROWID = OLD.ROWID;
END;

but this should do...
[Magisk] jcmm11:
Like I said, because of the way it works. Quoting from the docs: "If a BEFORE UPDATE or BEFORE DELETE trigger modifies or deletes a row that was to have been updated or deleted, then the result of the subsequent update or delete operation is undefined. Furthermore, if a BEFORE trigger modifies or deletes a row, then it is undefined whether or not AFTER triggers that would have otherwise run on those rows will in fact run.

The value of NEW.rowid is undefined in a BEFORE INSERT trigger in which the rowid is not explicitly set to an integer.

Because of the behaviors described above, programmers are encouraged to prefer AFTER triggers over BEFORE triggers."

I would make some small modifications to your code. First to change any existing records, next to ensure we only trigger on attestation records. Also I hate non-descriptive names. ?? So put it all together and I think the end result should look like

UPDATE main SET c='0' WHERE a LIKE '%attest%';

CREATE TRIGGER attestation_insert AFTER INSERT
ON main WHEN (NEW.a LIKE '%attest%' AND NEW.c <> 0)
BEGIN
UPDATE main SET c = 0 WHERE ROWID = NEW.ROWID;
END;

CREATE TRIGGER attestation_update AFTER UPDATE OF c
ON main WHEN (OLD.a LIKE '%attest%' AND NEW.c <> 0)
BEGIN
UPDATE main SET c = 0 WHERE ROWID = OLD.ROWID;
END;

Use OLD.a in UPDATE since it's possible to only update 1 column

Only other thing I would add is since I'm not sure when triggers were enabled in sqlite and since the version in Titanium is rather old (3.7.6.3) compared to the one in the Magisk mod (3.27.2) I'd suggest using the SQLite Magisk Mod.

You can save all the code in a file. Actually I've attached a file with all the code (zipped to allow upload to XDA) named attest.sql

Assuming you save it in sdcard you can apply it by running (as root)

sqlite3 /data/data/com.google.android.gms/databases/dg.db ".read /sdcard/attest.sql"

You can see ąll the SQL associated with that db by

sqlite3 /data/data/com.google.android.gms/databases/dg.db ".fullschema"
[Magisk] jcmm11:
Forgot to attach file
[Magisk] V0latyle:
This worked for me on Pixel 2 running the May OTA with Caesium 2.4 and Magisk 19.1.
[Magisk] andrewwdai:
Worked for me: both Pixel 2XL bootlegger ROM and Xiaomi Mi 8 Syberia ROM
[Magisk] jcmm11:
I expanded the trigger SQL a bit. The app that checks the attestation state (GMS toolbox by [MENTION=7655583]Freshek[/MENTION]) is looking at a different table in a different db (Wallets in android_pay) as opposed to the method by [MENTION=2449699]BostonDan[/MENTION] which is looking at main in dg.db.

So I created triggers for both tables. There's 2 sql files in the attached zip file. One will set any non-zero attestation values to zero and also create both insert and update triggers for both tables.

The second file drops (removes) the triggers from both tables, but doesn't change any values.

This solution doesn't need any permission changes and should, in theory, be good for any updates going forward - unless they change the table structure. If it works it's apply and forget.

I strongly recommend using the Magisk Mod for SQLite. To apply these files feed them into the sqlite3 binary. Assuming you have them in the root of sdcard, and using attest.sql as the example just run, as root

sqlite3 < /sdcard/attest.sql

If you've already applied the previous files I posted these won't hurt anything, you can apply these over those with no problems. Contents of attest.sql

.open /data/data/com.google.android.gms/databases/dg.db
UPDATE main SET c='0' WHERE a LIKE '%attest%';

CREATE TRIGGER IF NOT EXISTS attestation_insert AFTER INSERT
ON main WHEN (NEW.a LIKE '%attest%' AND NEW.c <> 0)
BEGIN
UPDATE main SET c = 0 WHERE ROWID = NEW.ROWID;
END;

CREATE TRIGGER IF NOT EXISTS attestation_update AFTER UPDATE OF c
ON main WHEN (OLD.a LIKE '%attest%' AND NEW.c <> 0)
BEGIN
UPDATE main SET c = 0 WHERE ROWID = OLD.ROWID;
END;
.schema main

.open /data/data/com.google.android.gms/databases/android_pay
UPDATE Wallets SET fails_attestation=0 WHERE fails_attestation <> 0;

CREATE TRIGGER IF NOT EXISTS fails_attestation_insert AFTER INSERT
ON Wallets WHEN (NEW.fails_attestation <> 0)
BEGIN
UPDATE Wallets SET fails_attestation = 0 WHERE ROWID = NEW.ROWID;
END;

CREATE TRIGGER IF NOT EXISTS fails_attestation_update AFTER UPDATE OF fails_attestation
ON Wallets WHEN (NEW.fails_attestation <> 0)
BEGIN
UPDATE Wallets SET fails_attestation = 0 WHERE ROWID = OLD.ROWID;
END;
.schema Wallets
.quit

Contents of drop_attest.sql

.open /data/data/com.google.android.gms/databases/dg.db
DROP TRIGGER IF EXISTS attestation_insert;

DROP TRIGGER IF EXISTS attestation_update;
.schema main

.open /data/data/com.google.android.gms/databases/android_pay
DROP TRIGGER IF EXISTS fails_attestation_insert;

DROP TRIGGER IF EXISTS fails_attestation_update;
.schema Wallets
.quit
[Magisk] Zilla0617:
I applied Dan's method without the Magisk module, how do I go about adding the file if there's no binary file created for SQL. Thanks
[Magisk] jcmm11:
You need a way to enter SQL commands. The absolute easiest way to do this is to install the Magisk module. Beyond that it depends on the capabilities of whatever SQL editor you're using. Some allow for custom queries, some don't. Either way it's more work for you.
[Magisk] coolzizi:
I gave up. Yesterday i relocked my bootloader in my pixel3. Maybe in future I'll relock bl again. But now I have gpay with any errors and I'm very happy with this [emoji6]

Wysłane z mojego Pixel 3 przy użyciu Tapatalka
[Magisk] zencooler:
"with" or "without"? ;)
[Magisk] lucaspog:
Thank you very much for the tips :highfive:. On the Samsung Galaxy S9 + works on Google Play 17.1.22 and Google Pay 2.88.248767160
[Magisk] coolzizi:
Of course without :) sorry, im speak a little english :)

Wysłane z mojego Pixel 3 przy użyciu Tapatalka
[Magisk] Tr4sHCr4fT:
Out of curiosity, can you still add/remove/reorder cards and select default afterwards?

After i once edited android_pay DB with aSQLliteEditor during my experiments, GPay totally bugged out.

Note that the latest module is arm64 only and the 32bit one is very old.

So if you happen to own some older ARMv7 phone or even x86 (Intel) you need to compile SQLite yourself: https://github.com/EXALAB/sqlite3-android

I can alos upload the latest binaries compiled for all archs if someone is interested...
[Magisk] dwane3:
Sorry,please upload SQLite Magisk Mod and full manual for inexperienced users.Thanks.
[Magisk] Zilla0617:
So I downloaded the module, how am I supposed to add the files? I tried opening the bin file and directly pasting the files but the bin will not open correctly. Also, the script "sqlite3 < /sdcard/attest.sql" should be typed in terminal? Thanks in advance
[Magisk] Nekromantik:
working here on Pixel 2 XL also using that method.

thanks!
[Magisk] habylab:
Zero issues on the latest play services and Magisk.
[Magisk] Needles_one:
Without any aforementioned workarounds?
[Magisk] habylab:
Nope. Not sure how, but seen a lot of discussion here about issues and thought I'd post I'm experiencing none.
[Magisk] dardack:
So using this, I can let play store be enabled and services update?

Do I have to do these things before I run the SQL commands?

If I add a card do I have to run this again?

EDIT: OK i updated to 17.xx play services. I ran this. My 4 cards are still listed as I can pay but if I add a card it says can't use in store. I can't add a new card to use in store, lets me know can't be used to pay in stores. But as soon as I go back home my 4 are still listed as can use in store (haven't tried yet tho, but before when this happened all 4 were removed from that list and under their names was, setup payment in store, now it just has set as default).

---------- Post added at 02:03 PM ---------- Previous post was at 01:25 PM ----------

Somehow you are insanely lucky if you haven't done anything. As soon as my pixel 3 updates to 17.xx, boom google pay disabled in stores. Play services updates as soon as I enable Google play store on wifi. I'm trying to sql fixes now.

EDIT3: Once I made dg.db read only, rebooted, was able to now verify my card. Going to make back read-write, see what happens.

EDIT4: made back read-write, rebooted, pay made attest 10 in one of the rows at some point. Do I have to run this sql every reboot if I don't leave it read only? Also, I have verified that I can add a card with read only and successfully get it for store pay, but with read-write it fails.

EDIT5: leaving it read-write, gsm toolbox eventually shows failed, unsure with read only. Going back to read only since I can add new cards and what not. I'm sure I'll get an error next time play services tries to update and I can read--write it back then I hope without issue.
[Magisk] Seriel:
Have been previously using the 16.x downgrade and disable service stuff, after a LineageOS update it somehow re-enabled the update service and now Play Services is at 17.4.53.

Took the opportunity to update Magisk to 19.2 since it offered to, and for whatever reason I don't have issues with Google Pay anymore.

Even removed and re-added my card, it all works fine.

Device is Sony Xperia XA2 (pioneer) on official LineageOS nightly 20 May 2019.
[Magisk] GryphonBR:
Don't get me wrong, but at least at this point I think you're overcomplicating things a bit. I followed [MENTION=2449699]BostonDan[/MENTION] suggestion and, with it alone, was able to add cards to my GPay wallet and make payments. It also keeps the payment history I already had, and I was already on GPS 17.1.22 before even attempting the method and I never tried downgrading or anything similar - just uninstalled GPay (which, looking back, wouldn't have been necessary in the first place), reinstalled it and followed that method. I did also create a Termux script using this as a base. Works pretty well for me.
[Magisk] dardack:
The sql scripts imo are easier/quicker than the manual method. But was hoping to leave files read-write for future updates without issue. Guess not. I was just posting what I tried and what worked.

What does the Script do for you? Just a 1 time thing changing the attest to 0? Yeah the attest sql code from jcmm11 did that for me. However, the drop_attest.sql was supposed to make it so you could go forward without changing read/write on the DB file. However, as I've stated that did not work for me for adding cards. It did work for just keeping cards/paying.