Working: Magisk with Google Pay as of gms 17.1.22 on Pie

73sydney

Senior Member
Jul 21, 2018
1,232
1,024
113
Sydney
Ah good, I'm not crazy! 😛

My thought is that I just tripped some deeper bootloader check in GMS earlier on before I rooted and despite MagiskHide and Play Store wipe getting me passing and certified the only way to clean out the old check was the SQLite hack.

Now that it's working I've removed the module, set up GPay the rest of the way, got all my loyalty cards, etc. back and all is still working, so fingers crossed it'll stay that way. 🤞
Just be aware that the uninstall script, in trying to be 100% reversible to the service script, resets the permissions on the database file so it can be edited again. So you *may* want to manually set the permissions to 440.

i.e. the module wasnt meant to be uninstalled after install

Also be very aware that flashing the module with loyalty cards present can lead to loyalty cards being purged (theres a warning during module install)
 
Last edited:
  • Like
Reactions: osm0sis

JeffXT

Senior Member
Jul 12, 2013
52
7
28
Just a heads-up:

I read here some had G Pay working without SQ Lite fix.

I've just rooted my Redmi Note 8T, and thought I'd check this, and was surprised to find G Pay works fine!... it's found in PlayStore, runs and is set up without issue (no warnings about modded device etc), and NFC payment works fine too.

I have MagiskHide toggled on of course, but NO modules as yet, SafetyNet fully passing w/ BASIC evalType, and PlayStore 'Device is Certified'; no other mods. Running Shock MIUI 12 / Android 10.

I don't know what's changed, but seems I don't / others may not need SQ Lite fix to have G Pay with root any longer!

Of course, this may well prove to be a temporary reprieve. 🙄

Perhaps Google is just getting soft?... Shucks, I feel all warm 'n fuzzy... 🥰 PW
Same! Can also confirm on Pixel 3 build 11.0.0 (RQ1A.201205.003.A1, Dec 2020, Verizon), Magisk v21. Although I'm cautiously optimistic, because I have a feeling we're on borrowed time until Google finally rolls out hardware backed attestation and it will be impossible to workaround.
 
  • Like
Reactions: pndwal and 73sydney

73sydney

Senior Member
Jul 21, 2018
1,232
1,024
113
Sydney
Same! Can also confirm on Pixel 3 build 11.0.0 (RQ1A.201205.003.A1, Dec 2020, Verizon), Magisk v21. Although I'm cautiously optimistic, because I have a feeling we're on borrowed time until Google finally rolls out hardware backed attestation and it will be impossible to workaround.
Youve just jinxed everyone..... :)
 

shaunoleary

Member
Jan 27, 2013
12
3
23
Rockhampton
Hello,

Just wanted to say THANK YOU - this worked like a treat just tonight!

I have a Pixel 3 (blueline) running LineageOS 17.1. I did a wipe and clean install, and followed the steps in the OP.

To get SafetyNet to pass, I used the Force SafetyNet option in Props, and also reset a fingerprint (in Props). For some reason, Props sees my Pixel 3 as a Nexus 5 (odd, as my old phone was a Nexus 5 - and much loved, may it rest in peace :)). And lo and behold - SafetyNet passed!

Then I installed the GPay Fix module, and (with bated breath) tried to add my card to Google Pay. And it worked first try!

I have yet to test it by making a payment, hopefully do that tomorrow, but otherwise - this is the first and only solution I have tried that worked. Google Pay working for the first time in months.

Thanks again :cool:
 

angiotell

Senior Member
Nov 5, 2010
742
57
58
50
Hello,

Just wanted to say THANK YOU - this worked like a treat just tonight!

I have a Pixel 3 (blueline) running LineageOS 17.1. I did a wipe and clean install, and followed the steps in the OP.

To get SafetyNet to pass, I used the Force SafetyNet option in Props, and also reset a fingerprint (in Props). For some reason, Props sees my Pixel 3 as a Nexus 5 (odd, as my old phone was a Nexus 5 - and much loved, may it rest in peace :)). And lo and behold - SafetyNet passed!

Then I installed the GPay Fix module, and (with bated breath) tried to add my card to Google Pay. And it worked first try!

I have yet to test it by making a payment, hopefully do that tomorrow, but otherwise - this is the first and only solution I have tried that worked. Google Pay working for the first time in months.

Thanks again :cool:
Could you send me Gpay fix please?
 

73sydney

Senior Member
Jul 21, 2018
1,232
1,024
113
Sydney
I need to do some updating of my modules documentation to encompass this new module for fixing hardware and hardware (masked as basic) attestation


Im just working on figuring out how to word it and fit it into my current instructions for the GPay Sqlite Module

It can be used in conjunction with Magisk Hide Props Config, to pass basic attestation with "a valid combination of device and model names, build fingerprints, and security patch levels "

Note this modules innards is now starting be incorporated directly into some ROMs (already a few for my Pixel 2/XL) and may be incorporated in more as time goes on.

Hopefully will have the documentation updated on the weekend
 
Last edited:

osm0sis

Senior Recognized Developer / Recognized Contribut
Mar 14, 2012
14,401
32,367
263
Halifax
Had to do this again yesterday after wiping my device and booting up without MagiskHide enabled briefly (since that's the default now 🙄), so they're not being super lenient on everyone.

Had to FC+wipe Play Store and Google Play Services, then FC+wipe Google Pay and manually ran the sqlite3 command to get it working again. 🤷‍♂️

@73sydney please remember to update your module with the fix we discussed here: https://forum.xda-developers.com/t/...-17-1-22-on-pie.3929950/page-55#post-84138189 (y)
 
Last edited:
  • Like
Reactions: dr4go

73sydney

Senior Member
Jul 21, 2018
1,232
1,024
113
Sydney
Had to do this again yesterday after wiping my device and booting up without MagiskHide enabled briefly (since that's the default now 🙄), so they're not being super lenient on everyone.

Had to FC+wipe Play Store and Google Play Services, then FC+wipe Google Pay and manually ran the sqlite3 command to get it working again. 🤷‍♂️

@73sydney please remember to update your module with the fix we discussed here: https://forum.xda-developers.com/t/...-17-1-22-on-pie.3929950/page-55#post-84138189 (y)
I did fix that the day you pointed it out

service.sh:

Code:
# set script to run SQL commands
runsql=1
I did not make a new release just for that fix, so you may need to download the zip again

 
  • Like
Reactions: osm0sis

stangn99

Member
Jun 16, 2013
14
2
23
Can someone help me out here (Pixel 3xl, Android 11)?

I've got Termux with SQLite3 binary copied in /files of Termux.
I installed them magisk module by @73sydney (thank you).
I get no errors during install.

I can setup my cards in Gpay, but I get a "/" through the wireless icon and it reads "Not set up".

Am I missing something? I used the manual method noted on the first post on Android 10 without issues.
 

osm0sis

Senior Recognized Developer / Recognized Contribut
Mar 14, 2012
14,401
32,367
263
Halifax
Can someone help me out here (Pixel 3xl, Android 11)?

I've got Termux with SQLite3 binary copied in /files of Termux.
I installed them magisk module by @73sydney (thank you).
I get no errors during install.

I can setup my cards in Gpay, but I get a "/" through the wireless icon and it reads "Not set up".

Am I missing something? I used the manual method noted on the first post on Android 10 without issues.
You need to wipe data on Play Services and Play Store first.
 
  • Like
Reactions: 73sydney

stangn99

Member
Jun 16, 2013
14
2
23
You need to wipe data on Play Services and Play Store first.
I've done this, but still fails with the following:
Screenshot_20210217-142540[1].png


This is what i've done:
  1. clear data on Play Services
  2. clear data on Play Store
  3. run Magisk module, press volume up, completes successfully
  4. close Magisk and open GPay
  5. Add card (adds just fine)
  6. It says "not set up" above the card
 

osm0sis

Senior Recognized Developer / Recognized Contribut
Mar 14, 2012
14,401
32,367
263
Halifax
I've done this, but still fails with the following:
View attachment 5225061

This is what i've done:
  1. clear data on Play Services
  2. clear data on Play Store
  3. run Magisk module, press volume up, completes successfully
  4. close Magisk and open GPay
  5. Add card (adds just fine)
  6. It says "not set up" above the card
That was the problem I had, but force closing and clearing all of Play Services data was the key. I have Google Pay and default Play Services items in MagiskHide and ran the sqlite3 command manually instead of the module. Otherwise I followed the directions on @73sydney's Page 9 module post to make sure I had Play Store showing Certified and SafetyNet passing and everything first.
 
  • Like
Reactions: stangn99

stangn99

Member
Jun 16, 2013
14
2
23
Finally got it working.

  1. Did a full wipe
  2. Rooted with Magisk Canary
  3. Used MagiskHide Props Config module AND Unversal SafetyNet Fix (didn't work without it)
  4. edited the dg.db file with SQL editor, chmod' to 440
  5. Reboot.
Thanks for the help
 

73sydney

Senior Member
Jul 21, 2018
1,232
1,024
113
Sydney
Updates to Gpay SQLite Fix Module


First up documentation ....


Added the advice to try Universal SafetyNet Fix by @kdrag0n if failing CTS with hardware, instead of the previous advice to force basic via MagiskHide Props Config. It still may be necessary to install a fingerprint via MagiskHide Props config in addition to this.

Adjusted the pre installation steps to reflect this change from using MagiskHide Props Config to force basic to using Universal SafetyNet Fix, hopefully it makes sense. Im sure @pndwal will let me know if it doesn't :)


Module update

v2.3 - 20/12/2020


Changes to service.sh:
  • setting variable runsql=1, as noted by @osm0sis it was missing and script expected it to be set
I had fixed this and just reuploaded the v2.2 zip file, lazy at the time i didnt increment the version or document it here or on github. Fixed now. As noted, this fix has been in effect since the 20th December last year. Apologies for my laziness in updating the thread/github
 
Last edited:

heathrow1

Member
Mar 7, 2016
8
7
3
Hi, thank you so much for your effort. Works great on my Xiaomi redmi note 9 pro.

I have a question regarding the installation of OTA updates:
When a new OTA update is available I have to restore images in magisk, apply the update, create a new patched boot.img in magisk and flash it to have root with magisk again.

After this is done, the play store certification is gone. I then have to delete data and cache of play store and play services and reboot.
Afterwards the play store certification is back but all cards in Google pay are gone and I have to add them again.

Is there any better way to apply OTA updates?

Best regards from Germany!
 
  • Like
Reactions: 73sydney

shaunoleary

Member
Jan 27, 2013
12
3
23
Rockhampton
Hello all,

As we speak, my Pixel 3 (Blueline, running LineageOS 17.1) is still working perfectly with the GPay fix I applied; EFTPOS payments can be made no problem at all using my phone.

I have a likely stupid question, and apologise in advance, but would like to get the skinny on this before I proceed.

Is it safe to do an upgrade of LineageOS - either by downloading and "dirty" flashing through ADB, or by doing an OTA upgrade directly on the phone? I ask because it is currently difficult (if not impossible) to complete a NANDROID backup on my phone, as running recoveries such as TWRP are very tricky.

Or for that matter, if upgrading the GPay patches themselves (and/or the ROM) may mean screwing up my GPay install.

I'd hate to potentially lose my working GPay install, and have to start from scratch.

Thanks in advance, and once again I apologise if this is a dumb or annoying question.
 
  • Like
Reactions: 73sydney