yashsingh1/xdaforums huggingface dataset:
[Magisk] Evo_Shift:
I am using a Pixel 2 running Oreo with Magisk and was able to add a card and purchase an item in a vending machine using the steps outlined in the OP. I didn't hide anything that wasn't already hidden by default (Something under Google Play Services is hidden by default. I don't remember ever hiding anything). Thanks!
[Magisk] macigo:
Excuse me, did I want to know how can I set chmod 440 by opening the emulator? Thanks
[Magisk] jcmm11:
It's in the OP but here it is again:

Open the terminal emulator and get a command prompt.

Enter the following commands

su
chmod 440 /data/data/com.google.android.gms/databases/dg.db

su gets you root so if you already have root you can skip that
[Magisk] macigo:
Thank you so much for your help. Hello jcmm11
[Magisk] anndrenaline:
I need to know, i patched a magisk plus system file but its corrupted and phone is stuck. Is it possible to use a different phone to patch magisk install?
[Magisk] jcmm11:
Yes. You can patch a kernel for a different device
[Magisk] pprazzi:
Works perfect. Thank you sooo much :D:D:D
[Magisk] frozst:
Just tried on my S9 with Pie and works perfectly, I just thought that some inexperienced user may get a bit lost on some of the steps so allow me some rewording .

Thanks [MENTION=2449699]BostonDan[/MENTION] (I cannot click on thanks to your post for some reason).

1) download a SQL database editor. I used

https://play.google.com/store/apps/d...ditor&hl=en_US

2) download a terminal emulator program. Terminal emulartor by Jack PAlevich should be easier to use for this matter.

3) make sure Google pay is forced close, if it is open.

4) open SQL editor. Navigate to /data/data/com.google.android.gms/databases

5) open dg.db

6) change any value that contains "attest" in its name in the name (first column) to 0 in the third column. Mine was showing a value of 10 in the third column for each of these values. (Column c for sqlite database editor I used)

7) open the terminal emulator.

8) get root access (su) - meaning, type "SU" and Magisk should automatically grant root access to your terminal app

9) cd /data/data/com.google.android.gms/databases

10) type: chmod 440 dg.db

This makes dg.db read only (for owner and group, and no access for world.)

11) reboot
[Magisk] Hot-Proton:
I have a Xiaomi Mi 9T Pro with xiaomi.eu 9.9.6 Android Q and not working here.
[Magisk] laill:
If you want to go faster, you can use a file manager with root like root explorer to change the permission (step 7 8 9 10), easier and no need to tye a commend.
[Magisk] 73sydney:
Or if you want to do it the fastest way of all, you can just use the magisk module in my signature...or linked here....its automagic.....
[Magisk] smohanv:
I have xiaomi mi 9 and it works. Thanks OP.
[Magisk] painterKDM:
Worked

I used this method and worked. I just made "read only" in permissions via root explorer
[Magisk] maulwurf1909:
Thanks a lot! It worked!

:good:
[Magisk] SoWhy:
Hmmm...I tried both the Magisk module and the manual way and all values with "attest" are set to 0 but trying to add a card still fails with the error message that this phone is rooted or modified. Running Android 9.0 on Zenfone 6 with Magisk 19.3 and Magisk Hide everything Google-related. Interestingly, it worked without a fix until a few days ago and now it does not work even with the fix

Edit: Turns out, it was apparently a problem with SafetyNet as well. Not sure why because I didn't change anything but after following the tips in this thread: https://xdaforums.com/poco-f1/how-to/fix-magisk-safetynet-t3896695 it works again
[Magisk] rcayret:
Worked perfectly. Here I have the mi9se with xiaomi.eu miui11 weekly rom. Thks a lot.
[Magisk] Fentadroid:
Simply:

su

am force-stop /data/data/com.google.android.apps.walletnfcrel

chmod 777 /data/data/com.google.android.gms/databases/dg.db

sqlite3 /data/data/com.google.android.gms/databases/dg.db "update main set c='0' where a like '%attest%';"

chmod 444 /data/data/com.google.android.gms/databases/dg.db

But... why not the magisk module???

https://xdaforums.com/showpost.php?p=79643248&postcount=176

Too simple?
[Magisk] Thaliya:
Not working anymore with todays update :(
[Magisk] Fentadroid:
Update of... what? I didn't receive any update on my Pixel 3a.... SafetyNet still passes.
[Magisk] nextgeek:
I'ts stop working for me too today (k20 pro)
[Magisk] Namelesswonder:
No longer working for me either. Worked flawlessly since May when I first applied it, but just now when I tapped the terminal nothing happened. Google Pay still opens, but NFC tap to pay no longer works. SafetyNet checks still pass and device is still certified (Netflix shows up in the Play Store for installing), so there's another Google Pay specific check we're failing.

Pixel XL on LineageOS 16.

Still works for me, tried a different terminal.
[Magisk] CSX321:
I just now used Pay at McDonald's successfully. I guess it's a change that's rolling out or something. Mine also says device is certified, but Netflix *isn't* available for me to install in the Play Store. <shrug>
[Magisk] Namelesswonder:
False alarm from me. Restarted my phone and tried a different terminal and it still works. I guess that terminal was just busted, someone must've done something to it because I had just used that same one yesterday. :laugh:
[Magisk] sliding_billy:
I used GPay on Android 10 at the terminal yesterday before the GPay app (and Play Store) was updated. This morning, I used it with the new Google apps in place. All is fine on the 3 XL with the original SQL modifications method (no module).
[Magisk] adi007:
Method not working for me since yesterdey :( I try with this https://xdaforums.com/poco-f1/how-to/fix-magisk-safetynet-t3896695 fix to pass ctsProfile, but didnt work. Interestingly, it shows that device is certified in Play Store, but i cant find for example Netflix App.
[Magisk] stavros:
Same here, Mi 9T/K20, Google Pay stopped working today all of a sudden and I get "ctsProfile: false" (not sure if I was getting that before). I really need a way to fix this but I don't know of one.
[Magisk] MrBrady:
Earlier i upgraded to today's Google Pay release (2.97) on my Pixel 2 XL and am using the Magisk fix module. Just made a payment at Whole Foods and it worked flawlessly.
[Magisk] Tuxedo.Bond:
Upon installing the zip file within TWRP, I receive the message "Updater process ended with ERROR: 1."

Any idea what the issue is?
[Magisk] bnwg:
I want to thanks OP for the method.

What I need to do is just chmod 440 to dg.db.

Even if there are many 10 for attest from dg.db the Google pay still work flawlessly.
[Magisk] italianquadcore:
I want to thanks OP for the method. I've used the commands inside "adb shell", and now Google Pay doesn't give me the advice regarding root, but unfortunately whenever I try to add a credit card it gives me the message "This card can't be set up to pay in stores - This feature isn't supported by your bank for this card yet". I've tried with three different credit cards, but I receive the same message for each of them. Anyway using the Google Play app I've added Paypal account to Google Pay payments, and in next days I will test it (hoping that it works as my Xiaomi MI8 has unlocked bootloader and I've no way to lock it again).
[Magisk] Terrigible:
Bruh the "This card can't be set up to pay in stores - This feature isn't supported by your bank for this card yet" issue is really because your bank doesn't support it.
[Magisk] Ce Doresti:
hi, anyone know how fix bank app ? really work first, but now no, and thank for gpay !!!!! work on note 9!
[Magisk] simplepinoi177:
just joking, but it sounds like you're thanking the OP for the actual Google Pay...! haha

joking aside....the only way I am able to get a "Device is certified" in my Play Store and Google Pay to actually let me run it and add cards was to run a custom kernel. I don't know how/if that works on the Note 9, or if you have to still run it in tandem to something like MagiskHide or some other root-hide method/process...

But I'm thinking you might have a good amount of luck if you can do something like that on a Note 9 -- but the Samsung Note and the Google Pixel are two very different devices, so I wonder.....

Good luck and hope this helps...!
[Magisk] zencooler:
I have rooted Note 9 with custom kernel and all my banking apps and GPay are working like a charm. Of course using this method + Magisk Hide.

Regards.
[Magisk] Ce Doresti:
sorry, what kernel you use? i use stock, and dr ketan rom. i talking about lloyds bank.

i tell, thank for this!!! greeat job work!!!

sorry for my bad english
[Magisk] zencooler:
I use Endurance kernel. I don't have Lloyds bank account but I use few others: Citi, Santander, Millennium, Nest Bank and Alior. All of them with no problem at all.
[Magisk] 73sydney:
Looks like you may need to reinstall magisk

Easiest way, assuimg youre using TWRP recovery:

1) On your PC, extract the boot image from whaever ROM youre using and copy to device

2) Flash the boot image to the boot partition using TWRP recovery

3) Reboot to recovery

4) Re-flash magisk

Then try installing your magisk modules....
[Magisk] baxxter106:
Thanks to [MENTION=2449699]BostonDan[/MENTION], this method worked for me like a charme! (Google Pixel 2 XL with Android 10)
[Magisk] ssceddie:
Let US know which terminal Emulator you used before and after,pls
[Magisk] Tuxedo.Bond:
Thanks. I figured it out. Silly me saw a zip file and thought to install with TWRP. It's supposed to be installed within Magisk, hence why it is called a Magisk Module. Thus far I was able to set up my cards for in store purchases when previously I would receive an error message. I haven't tried a real transaction yet, but I will update when I do.
[Magisk] dipstik:
anyone try with todays patch on pixel 3/3xl?
[Magisk] xunholyx:
I'm using it on my P2XL, so it should't be a problem on the 3
[Magisk] sliding_billy:
I haven't used it at a store yet, but all attestation values stayed on Pixel 3 and Pixel 3 XL and GPay opens fine showing my cards. I used flash-all (minus -w) on both.
[Magisk] sadiku:
Confirm still work on my pixel2 with Oct update.

Download OTA image from Google and sideload it in TWRP, then flash TWRP and magisk again. No issue, use Google pay for my gas just now.
[Magisk] CSX321:
I also had no trouble patching the new boot.img with MM, doing flash-all minus -w, and flashing the patched img. I did a little experiment this time with the Play Store, and it looks like it was successful. I froze the Play Store app with Titanium Backup before applying the Oct. update, thawed it after flashing the patched boot img, and now it still says device is certified. :) Didn't have to clear data and wait.
[Magisk] sliding_billy:
Not sure what if anything was different this month, but all I had to do on Pixel 3 and Pixel 3 XL was force stop and clear data/cache on Play Store. I updated apps before clearing so that there were no updates pending or missed by clearung app data. Certification and installed apps came back immediately this time.
[Magisk] dipstik:
the freezing/clearing of play store is to keep the table from updating or what?

where do you check for certification?
[Magisk] CSX321:
At the bottom of Play Store settings it will say "Device is certified" or nothing at all. I think it only affects if certain apps are listed in the store.
[Magisk] m0narx:
Script

Thanks, it works on TicWatch Pro.

Packed your guide to script for Windows (adb must be installed systemwide, or must be in same folder with script)

View attachment SafetyNetFix_V2.zip
[Magisk] Microsoft_PowerPoint:
works great

thanks
[Magisk] ndg99:
Working fine on Pixel 3 XL on Android 10 with the October security release.
[Magisk] CSX321:
Mine doesn't. It still says Fails, but I was just now able to make a purchase anyway.

We probably don't know for certain yet, but I haven't so far noticed any problems or side effects.
[Magisk] sliding_billy:
Interesting. wabmorgan - did you notice that it started passing only after a successful purchase?
[Magisk] CSX321:
Weird, because I've added a card and made a purchase. Rebooted since then, as well. But I just checked, and it still says Fails. Is there more than one version of the GMS Toolbox? It's been a while since I installed it. Let's see...it says I have version 1.0.
[Magisk] zencooler:
Guys,

This tool is not updated by Freshek to use new method of manual changing the database values. So it is not capable to check the attestation test status if you change something manually.
[Magisk] CSX321:
Yeah, makes perfect sense, but wabmorgan had reported above that it no longer said Fails for him or her, so we wondered.
[Magisk] sliding_billy:
Exactly. Thanks, zencooler.
[Magisk] wabmorgan:
No. It passed the GMS successfully before I made a purchase.
[Magisk] Dunge2:
Do you change only the rows called 'attest', or also those called 'ad_attest' and 'tapandpay_attestation'?

I started the process, but with 120 entries in the list where about half contains the word attest, and the editor always scrolling back up between each value, I gave up, it's just too long.

I wish there was an editor you could just write a query. I tested a few apps and didn't find any working (one looks good and request root but it say the file is in read only while the app you linked is capable of writing?). In any case, I can't test it but the query would look something like this in ms-sql, which would also probably works for sqlite:

Update main set c = 0 where a like '%attest%'
[Magisk] sliding_billy:
Thanks.
[Magisk] DamnYou08:
Did you skip step 8? If so, you need to get root access (su) https://play.google.com/store/apps/details?id=com.myapkapp.surootcommand
[Magisk] hammondegs:
Thank you for your contribution.

It wasn't so simple for me, but your process eventually worked. I had to leave the database folder chmod 771. Only then the process of adding my card would complete.

It did return "something went wrong" at the end of contacting bank for verification, yet my card is now set as default.

I have checked the dg.db and all lines with attest ar still set to 0.

I am using a Samsung s6 edge running stock nougat 7.0 debloated, magisk 19.1.
[Magisk] xumixu:
I changed everything that had attest in it, for example:

attest

ad_attest

tapandpay_attestation

are this later 2 necesary or do I turn them back to 10?

Changing all of them I could add my card, will have to see tomorrow if i can actually pay with it.
[Magisk] ooonea:
Perfectly working. Thanks a lot!
[Magisk] matt4321:
I had over 200 entries so deleted the DB, rebooted, had 3 and only 1 with attest. Edited that then carried on with the instructions. Added a card and have paid so it works.
[Magisk] paeddi:
I'm on Xiaomi.eu on Mi8.

With this workaround a was able to add payback again. I didn't pay yet, but it already looks promising.

Thanks!
[Magisk] Free4ever2:
Wow finally got Google Pay working after many months. Thanks, very well written instructions.
[Magisk] xytsrj:
Sorry I am new here. How to do it after installing?
[Magisk] lssong99:
[/COLOR]Thanks [MENTION=2449699]BostonDan[/MENTION] for this great method! My GPay just works now!

[Edited to add [MENTION=4355376]Karpfenhai[/MENTION]'s suggest to use TitaniumBackup's sqlite3 binary]

Anyway for those sqlite impaired (this means 99.9999% of world population), here is my steps:

If you have Titanium backup, please start from 3, if not, please start from 1

1. Install Magisk module "SQLite for ARM aarch64 device" by ianmacd from Magisk Manager

2. Reboot to enable this module

3. Install your favorite terminal emulator (I use Termux)

4. Enter Termux, then type "su" (Magisk might ask you for permission of root access, permit it.)

5. Enter following command line by line: (This is Magisk module version. Titanium backup version is down below)

am force-stop /data/data/com.google.android.apps.walletnfcrel

chmod 777 /data/data/com.google.android.gms/databases/dg.db

sqlite3 /data/data/com.google.android.gms/databases/dg.db "update main set c='0' where a like '%attest%';"

chmod 444 /data/data/com.google.android.gms/databases/dg.db

6. Reboot

7. Profit!

For using with TitaniumBackup's sqlite3 binary, you could modify the sqlite3 path as

/data/data/com.keramidas.TitaniumBackup/files/sqlite3 /data/data/com.google.android.gms/databases/dg.db "update main set c='0' where a like '%attest%';"

Actually I put all those commands in a Tasker task so I could run it during each reboot (with "Monitor Start" Event). Tasker xml as attached.

Also, if your system come with sqlite3 binary (Actually I use the one from Termux) you don't need even to install the Magisk sqlite3 module.

I am not responsible for what you have done with your phone, but hey, just let me know if you guys have any issue and I am glad to help!
[Magisk] Walhalla:
Titanium Backup also comes with a sqlite3 binary.

/data/data/com.keramidas.TitaniumBackup/files/sqlite3
[Magisk] xxqsxqs:
I tried a way based on the way of Boston Dan, but with a change.

I had a working Gpay with the play store turned off,

I copied dg.db just in case.

I only changed permissions dg.db to 440,

I updated play services to 17.4.53.

Restart and everything else works and the play store is on! I can add gpay cards and pay in stores.
[Magisk] jlariviere:
On my OnePlus 3, I can't get it to work. Tried a completely fresh flash of LineageOS, tried Magisk, tried using Magisk Hide, tried not using Magisk Hide, tried disabling OEM Unlocking, tried disabling root access, tried disabling USB Debugging, the SQLite fix.

Nothing seems to get Google Pay to work under LineageOS...

OnePlus 3

Android 9, LineageOS 16.0-20191013-NIGHTLY-oneplus3

Magisk 20.1-59fd38bb (20001) (tried regular, beta, canary...)

Magisk Manager 7.3.5-de969a9d

Google Play Services 19.5.28 (100400-273329419)

Google Pay 2.98.272088169

Tried GPay SQLite Fix (Full Edition) v1.7

Tried MagiskHide Props Config v4.0.3-v63

Did I miss something?
[Magisk] theredbaron1834:
I assume gpay sqlite fix is an app that automates it? Try doing the sqlite editing and chmoding by hand (aka follow the instructions in OP). An auto app might be having issues. A fresh install last night of Lineage nightly, gapps mini (did have to use an older gapp, current ones wouldn't boot my XA2) and used it today, worked fine.
[Magisk] jlariviere:
Yeah, i tried the manual edit before going to the automatic one...

I had tried the current nano package, now tried with oldest 9.0 available mini from MindTheGApps instead of the current nano from OpenGApps.

Installed LineageOS 20190903

OpenGApps mini 20190203

Latest Magisk

Still didn't work. Tried the steps in the original post, and it still didn't work. Can't get Google Pay to activate a card, and ctsProfile won't pass in Magisk Manager.

For those for whom it is working, which OS release and App versions are working for you?

Thanks!
[Magisk] jcmm11:
You need to pass safety net (both ctsprofile and basicintegrity). If you don't pass Google Pay won't work.

See https://www.didgeridoohan.com/magisk/MagiskHideSafetyNet

The following may help pass ctsprofile

https://xdaforums.com/apps/magisk/module-magiskhide-props-config-t3789228
[Magisk] theredbaron1834:
I have

lineagesOS, 20191011

OpenGapps mini 200190929 (newer wouldn't boot)

latest MagIsk.

However, my rom passes safetynet without any issues by default. If yours does not pass both safetynet, you should look into the safetynet fixers for magisk.
[Magisk] Meowdib:
Stock Pixel 2 rooted, just added a card right now.
[Magisk] Jakob1379:
I would very much like to hear if anyone have any concerns regarding this method?
[Magisk] simplepinoi177:
I'm unsure what device you're using, jlariviere, but if it's possible; I highly suggest you try flashing a custom kernel to pass safetynet and/or assist in "hiding" Magisk...

Originally, on my Pixel 2 XL, I was on stock kernel, and was never able to even launch GPay, but I went ahead and installed a custom kernel for other reasons, and was pleasantly surprised that an added benefit was now to be able to launch (and for a long time, use) GPay -- for a long time, all that was necessary (for me) was to simply have this custom kernel.

Just a thought...good luck!
[Magisk] jlariviere:
I was able to get it to work on my OnePlus 3! Not entirely sure which combination got it to eventually work, or if they're all necessary. With that Props module, I picked the certified fingerprint, then changed the Treble GSI ROMs to enabled then back to disabled, then both boot stage options set to post-fs-data, also made sure enabled the hiding option. All after the OP options.
[Magisk] YoshiFan501:
So I ran the SQL patch and it fixed the root check but now gpay is telling me to double-check my card info. Even though it is correct. Adding an existing card or a new card does the same thing. Adding a PayPal account works though. Any ideas on how to fix this?

I have a pixel 2 xl. Stock. October patch. Magisk 19.3 because anything above breaks safetyner for me.
[Magisk] Terrigible:
It's literally your card. Check again. Call your bank if you're sure you're right.

EDIT: You might want to wait a few hours before trying again.
[Magisk] YoshiFan501:
tried it again this morning and yeah same thing. weird. its like that with 2 different cards of mine.
[Magisk] morgs640:
This works for me but when trying to use a loyalty card with NFC added to google pay it refuses to read it whereas it worked fine on my MI5 when this fix was not necessary. Any ideas?
[Magisk] mhrussell1:
Just used first page OP to install on Pixel 3 on latest stock ROM and GPay. Card successfully added. Will try payment at next opportunity. Also latest v20 of Magisk. Using hide on Gpay and com.google.android.gms under Google Play Services.
[Magisk] xfighter11:
I'm on Xiaomi Mi 8 with Pixel Experience. SafetyNet check passes without an issue. GPay adding card worked fine as well. But I wasn't able to pay with my phone in McDonald's today. Phone wasn't detected. I did everything BostonDan wrote in the initial post. GMS Toolbox always say "Couldn't copy android_pay database". Any help?
[Magisk] HerrT:
Maybe a stupid question, but as you wrote "Phone wasn't detected"...: do you have NFC turned on? and did you unlock the phone?
[Magisk] xfighter11:
Yeah, both done ?. Otherwise this would have been a simple solution ?.
[Magisk] ssceddie:
Did u tried this on a other nfc phone?
[Magisk] xfighter11:
With this app m wife's smartphone detects mine as a card without a problem. So I should be fine now?
[Magisk] ssceddie:
Yes it should bebfine then
[Magisk] Kakari:
Xfighter11, are you on Gpay 2.98 or 2.99? The latter landed on 14-Oct according to my Play Store and I haven't seen anyone report it working yet while 2.98 has been working in the last couple pages here.

Edit: Also forgot to mention the easiest test I've found is adding a debit/atm card and going to an ATM as some tap to pay terminals can be weird even with Apple or Google Pay but work with a tap card.
[Magisk] ssceddie:
I payed successful with GPay 2.99
[Magisk] xfighter11:
Yesterday I updated to the newest version 2.99 but just downgraded again to 2.98 and will try again when possible. Unfortunately going to an ATM and get money with phone is not possible in Germany. We are a third world country regarding digitalization :(.
[Magisk] YoshiFan501:
2 days later same issue. i even tried my brother's card and it still says double check card info
[Magisk] Terrigible:
Do you both of you have the same bank?
[Magisk] YoshiFan501:
Yes. But also my Amazon prime credit card, which is by Chase and not my bank, nor the same brand of card, gives the same error.
[Magisk] Terrigible:
Where do you live?
[Magisk] YoshiFan501:
St. Louis.

Is there a blackout I'm unaware of?
[Magisk] Terrigible:
Make sure your card is in this list https://support.google.com/pay/answer/7351835

Contact Google for more support. I'm out of ideas
[Magisk] YoshiFan501:
im out of luck too. i dont want to factory reset but i might have to. strangely i was able to add a regions bank card.
[Magisk] elreydenj:
Sometimes you have to clear devices on your credit card company's side. After flashing different versions of Android, ROMS, or factory resets it looks to your credit card provider as if you have Gpay set up on many phones. Basically tell them to remove all devices and then try.