[GUIDE] Google Pay working SIMPLY with unlock/root on Pixel 4/XL [GUIDE]

Search This thread

wrongway213

Recognized Dev & Contributor / Retired Forum Mod
Jul 27, 2014
5,123
9,011
35
Canton, OH
Google Pixel 7
Hey guys... I've seen various methods to get Google Pay working and simply put, none of them worked for me. All that I could find left was advanced stuff involving SQLite editors and that's just not for everyone. So I started trying other known working methods from different devices, and this is what I did to get it going without issue.

1. Open Magisk, Magisk Hide, and tick the check box next to Google Pay. Proceed normally through the following steps after doing so.
2. Force stop Google Pay, clear app data/storage.
3. Open a root file manager
4. Using root file manager, find /data/data/com.google.android.gms/databases directory
5. Select a file called db.dg and chmod the permissions to 440, save and make sure it in fact saves
6. Reboot and set up Google Pay.

This should get you set up in no time without a need for modules or advanced user techniques. Hope it helps!

Edit: People seem to really dislike this method for some reason, so just throwing out there it seems everyone else recommends the SQL editing. This method worked for me, but YMMV and everyone else hates it :eek:
 
Last edited:

ilal2ielli

Senior Member
Oct 31, 2011
598
256
Google Pixel 2 XL
Google Pixel 4 XL
Hey guys... I've seen various methods to get Google Pay working and simply put, none of them worked for me. All that I could find left was advanced stuff involving SQLite editors and that's just not for everyone. So I started trying other known working methods from different devices, and this is what I did to get it going without issue.

Unlocked users start at Step 1 below. Rooted users - First open Magisk, Magisk Hide, and tick the check box next to Google Pay. Proceed normally through the following steps after doing so.
1. Force stop Google Pay, clear app data/storage.
2. Open a root file manager OR reboot to TWRP if you don't have one
3. Using root file manager OR TWRP file manager, find /data/data/com.google.android.gms/databases directory
4. Select a file called db.dg and chmod the permissions to 440, confirm if in TWRP, save and make sure it in fact saves if using a file manager.
5. Whether in TWRP or using a root file manager. reboot and set up Google Pay.

This should get you set up in no time without a need for modules or advanced user techniques. Hope it helps!

That will only work if the attestation values in the dg.db file haven't been changed to flag root/unlocked bootloader already.

If your values have already been changed, you will need to manually edit the dg.db file or use the Magisk modules from this post: https://xdaforums.com/apps/magisk/magisk-google-pay-gms-17-1-22-pie-t3929950/post79643248
 

wrongway213

Recognized Dev & Contributor / Retired Forum Mod
Jul 27, 2014
5,123
9,011
35
Canton, OH
Google Pixel 7
That will only work if the attestation values in the dg.db file haven't been changed to flag root/unlocked bootloader already.

If your values have already been changed, you will need to manually edit the dg.db file or use the Magisk modules from this post: https://xdaforums.com/apps/magisk/magisk-google-pay-gms-17-1-22-pie-t3929950/post79643248

Yeah... I'm not sold on making those kinds of edits or loading modules that do so without a working TWRP for this device anywhere in sight. That's precisely why I posted this thread - a working solution that doesn't involve editing things at that level - even if it doesn't work for everyone, I think it'll be more comfortale for those apprehensive to make certain changes without recovery :good:
 
  • Like
Reactions: bradical711

ilal2ielli

Senior Member
Oct 31, 2011
598
256
Google Pixel 2 XL
Google Pixel 4 XL
Yeah... I'm not sold on making those kinds of edits or loading modules that do so without a working TWRP for this device anywhere in sight. That's precisely why I posted this thread - a working solution that doesn't involve editing things at that level - even if it doesn't work for everyone, I think it'll be more comfortale for those apprehensive to make certain changes without recovery :good:

Having TWRP or not changes nothing for anyone that makes a mistake with those edits or Magisk. Editing the dg.db and messing that up doesn't require TWRP to fix it and there's already a boot image with Magisk core only mode posted by Tulsdiver that will save you in case a Magisk module screws things up (the Google Pay fix module is working perfectly, BTW).

People probably shouldn't be messing with any of this until they understand everything that entails getting Google Pay working on a modified device. I'd argue that changing permissions of the dg.db file is just as difficult for anyone who doesn't understand what they're doing as it is going all the way and modifying the actual values in the dg.db file. It's all a slippery slope for the overzealous people anyway.
 
  • Like
Reactions: ct_tec313

CyberpodS2

Senior Member
Mar 27, 2012
2,813
1,240
NE Pennsylvania Boonies
Yeah... I'm not sold on making those kinds of edits or loading modules that do so without a working TWRP for this device anywhere in sight. That's precisely why I posted this thread - a working solution that doesn't involve editing things at that level - even if it doesn't work for everyone, I think it'll be more comfortale for those apprehensive to make certain changes without recovery :good:
Grab the modified kernel in the themes area that forces modules to be deactivated. That way you can just temp boot it to fix your issues if it goes south on you. I've used it several times so far when needing around with different combos of mods, etc...

https://xdaforums.com/pixel-4-xl/themes/magisk-modules-disabler-booting-magisk-t3990557
 

ct_tec313

Senior Member
Dec 28, 2010
792
249
49
Detroit,MI
While I appreciate your efforts this is a halfbaked hack and like the previous poster said it's will do nothing if those values have been tripped. I have always been a believer of figuring out things and going the long route that way you know why and how it was done it's very convenient for somebody else to do it and you just flash it but if you do it yourself you'll find out the intricacies of how Android and how rooting and modding works....
 

wrongway213

Recognized Dev & Contributor / Retired Forum Mod
Jul 27, 2014
5,123
9,011
35
Canton, OH
Google Pixel 7
Grab the modified kernel in the themes area that forces modules to be deactivated. That way you can just temp boot it to fix your issues if it goes south on you. I've used it several times so far when needing around with different combos of mods, etc...

https://xdaforums.com/pixel-4-xl/themes/magisk-modules-disabler-booting-magisk-t3990557

That's kind of my reason for not wanting to use mods on this device yet - being tied to Fastboot at any given time isn't practical for me. Being unable to buy gas because my phone isn't set up isn't practical for me. My goal is to use my device just like I did when I had working TWRP on other devices without losing functionality OR having to rush to a PC for fastboot. Neither are practical solutions for me - making simple modifications that are easily overwritten gives me much less anxiety than messing with things at a deeper level.
 
  • Like
Reactions: bradical711

vanydotk

Senior Member
Mar 31, 2006
323
72
Yeah... I'm not sold on making those kinds of edits or loading modules that do so without a working TWRP for this device anywhere in sight. That's precisely why I posted this thread - a working solution that doesn't involve editing things at that level - even if it doesn't work for everyone, I think it'll be more comfortale for those apprehensive to make certain changes without recovery :good:

No disrespect, it looks like you're active here and helpful, but I don't think editing some values some values in a SQL editor that is tested and proven in a thread that has 55+ pages is going to hurt anything.
 

wrongway213

Recognized Dev & Contributor / Retired Forum Mod
Jul 27, 2014
5,123
9,011
35
Canton, OH
Google Pixel 7
No disrespect, it looks like you're active here and helpful, but I don't think editing some values some values in a SQL editor that is tested and proven in a thread that has 55+ pages is going to hurt anything.

I'm apprehensive because of what SQL changes under the hood typically mean. I know most people haven't built ROMs, built kernels, maintained for a ROM Team, done platform development, etc. etc . - I have done all those things. One thing I learned is that there are TWO scenarios that will ALWAYS necessitate a clean flash no matter what - SQL changes and Android version changes. Given we don't know as much as we typically do about the state of Coral without TWRP due to Android 10 changes makes me unwilling to assume things proven to work on other devices will work when we get an OTA on this one. Chmod perms will be overwritten but SQLite changes can cause things to go south in my experience - none of which relating to this module. It's about SQL vs chmod for me. I'm doing what I trust and understand until recovery exists to fix things without needing a PC. If no one else finds use for it, I'm OK with that. For my use case - it makes perfect sense. :good:
 

vanydotk

Senior Member
Mar 31, 2006
323
72
Fair enough, I figured you knew what you were talking about, everyone needs to make their own decisions. Nonetheless, thanks for contributing!
 
  • Like
Reactions: wrongway213

spaceman860

Senior Member
Jan 11, 2012
2,642
3,278
Here's a simple way to get gpay to work on stock with root after you hide gms and gpay with magisk.

1. Install Termux app and open the app
2. Type pkg install sqlite hit enter and let it install.
3. Type su hit enter
4. Copy and paste this then hit enter

am force-stop /data/data/com.google.android.apps.walletnfcrel && chmod 777 /data/data/com.google.android.gms/databases/dg.db && /data/data/com.termux/files/usr/bin/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

5. Reboot
 

Kris Chen

Senior Member
It's weird that google pay to registry my credit cards is so unstable after flashing Gpay Sqlite fixer 1.7. When flashing Gpay sqlite fixer 1.7 at first time, I could registry my 1st credit card but it failed in next credit card. It showed up an error message and said that my phone has been rooted and .... ", So I returned commend mode to key-in few words to make me registry rest 3-credit-card successfully.
 

Paz9

Senior Member
Jan 3, 2011
2,728
792
Google Pixel 8 Pro
You could just delete the GMS folder while rooted and it also works
This is something myself and another user found on the p3 when Google started tripping the values on unlock
Rolling back to a previous version also works but we found that deleting that folder from /data/data along with gsf folder fixed it
Of course after clearing gpay cache.

This is working on my p4xl too
 

superchilpil

Senior Member
Sep 26, 2009
4,278
1,432
Texas
OnePlus 8 Pro
Nubia Red Magic 6
I'm apprehensive because of what SQL changes under the hood typically mean. I know most people haven't built ROMs, built kernels, maintained for a ROM Team, done platform development, etc. etc . - I have done all those things. One thing I learned is that there are TWO scenarios that will ALWAYS necessitate a clean flash no matter what - SQL changes and Android version changes. Given we don't know as much as we typically do about the state of Coral without TWRP due to Android 10 changes makes me unwilling to assume things proven to work on other devices will work when we get an OTA on this one. Chmod perms will be overwritten but SQLite changes can cause things to go south in my experience - none of which relating to this module. It's about SQL vs chmod for me. I'm doing what I trust and understand until recovery exists to fix things without needing a PC. If no one else finds use for it, I'm OK with that. For my use case - it makes perfect sense. :good:

It might work for you but like it's been said multiple times, if the values are already tripped then your method is useless. Then it would REQUIRE SQL editing.
Posting an incomplete or half baked method can cause issues with newer people on these forums no matter how "simple" it may be.


How hard is it to enter a few lines in terminal? Lol

People should learn how to fix things without always relying on a module or a zip they can flash.

This 100%


Sent from my Pixel 4 XL using Tapatalk
 

Donric13

Senior Member
Nov 10, 2014
757
205
Nexus 9
Samsung Galaxy Tab S2
Hi there. Just a question. With this mod google pay works flawlessly all the time? No need to redo the procedure all few days when there are updates to play service? Because i need a real stable google pay when i am out only with my mobile to pay.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 28
    Here's a simple way to get gpay to work on stock with root after you hide gms and gpay with magisk.

    1. Install Termux app and open the app
    2. Type pkg install sqlite hit enter and let it install.
    3. Type su hit enter
    4. Copy and paste this then hit enter

    am force-stop /data/data/com.google.android.apps.walletnfcrel && chmod 777 /data/data/com.google.android.gms/databases/dg.db && /data/data/com.termux/files/usr/bin/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

    5. Reboot
    7
    Hey guys... I've seen various methods to get Google Pay working and simply put, none of them worked for me. All that I could find left was advanced stuff involving SQLite editors and that's just not for everyone. So I started trying other known working methods from different devices, and this is what I did to get it going without issue.

    1. Open Magisk, Magisk Hide, and tick the check box next to Google Pay. Proceed normally through the following steps after doing so.
    2. Force stop Google Pay, clear app data/storage.
    3. Open a root file manager
    4. Using root file manager, find /data/data/com.google.android.gms/databases directory
    5. Select a file called db.dg and chmod the permissions to 440, save and make sure it in fact saves
    6. Reboot and set up Google Pay.

    This should get you set up in no time without a need for modules or advanced user techniques. Hope it helps!

    Edit: People seem to really dislike this method for some reason, so just throwing out there it seems everyone else recommends the SQL editing. This method worked for me, but YMMV and everyone else hates it :eek:
    2
    Hey guys sorry if this been answered already but is anyone having some issues with the hardware fox Magisk zip that enables GPay to work for rooted Android 11 beta 2 like At A Glance widget/lockscreen weather keeps disappearing then reappearing, app updates downloading slow or not at all in Play Store and even the gpay gesture for lockscreen disappearing as well?

    Thanks in advance
    This is an issue that I have been going on with being on Android 11 beta 2 it is an issue thru magisk, read this article...https://t.me/Pixel4Development/3095..it will tell you all about it And if anybody knows of a fix that involves getting to keep root with magisk please let me know

    Thanks in advance
    2
    No disrespect, it looks like you're active here and helpful, but I don't think editing some values some values in a SQL editor that is tested and proven in a thread that has 55+ pages is going to hurt anything.

    I'm apprehensive because of what SQL changes under the hood typically mean. I know most people haven't built ROMs, built kernels, maintained for a ROM Team, done platform development, etc. etc . - I have done all those things. One thing I learned is that there are TWO scenarios that will ALWAYS necessitate a clean flash no matter what - SQL changes and Android version changes. Given we don't know as much as we typically do about the state of Coral without TWRP due to Android 10 changes makes me unwilling to assume things proven to work on other devices will work when we get an OTA on this one. Chmod perms will be overwritten but SQLite changes can cause things to go south in my experience - none of which relating to this module. It's about SQL vs chmod for me. I'm doing what I trust and understand until recovery exists to fix things without needing a PC. If no one else finds use for it, I'm OK with that. For my use case - it makes perfect sense. :good:
    1
    That will only work if the attestation values in the dg.db file haven't been changed to flag root/unlocked bootloader already.

    If your values have already been changed, you will need to manually edit the dg.db file or use the Magisk modules from this post: https://xdaforums.com/apps/magisk/magisk-google-pay-gms-17-1-22-pie-t3929950/post79643248

    Yeah... I'm not sold on making those kinds of edits or loading modules that do so without a working TWRP for this device anywhere in sight. That's precisely why I posted this thread - a working solution that doesn't involve editing things at that level - even if it doesn't work for everyone, I think it'll be more comfortale for those apprehensive to make certain changes without recovery :good: