Finally Google pay working on my Mi9


Jose Rosario

Members
Sep 8, 2017
2
13
Doesnt matter if you have Magisk installed just follow this in the same order

1) Boot into TWRP, delete "/data/data/com.google.android.gms/"
2) Boot to System
3) Delete GPay App Data (Cache & Data)
4) Start Gpay Once an close it right now, without adding or changing something
5) Boot into TWRP
6) check the name of Folder inside "/data/data/com.google.android.gms/app_dg_cache", only one should be here but I found 2 folders so ordering by date the list I left the older one and deleted the other folder
7) Boot to System
8) Download the SafetyNet App from the play store, and run the test should be green and no errors
9) Boot into TWRP, now there are 2 Folders in "/data/data/com.google.android.gms"
10) delete "/data/data/com.google.android.gms/<FOLDER FROM POINT 6 which is the one we didnt delete the last time>", the other Folder should stay untouched
11) now in the same folder "/data/data/com.google.android.gms/app_dg_cache" press the folder with the tick in it and run CHMOD after that replace the 0000 with 0551 and thats all
12) Reboot to System and set up GPay dont forget when youre gonna pay to change the option with HCE WALLET
Thanks !! it works
 

dcdead

Members
Sep 5, 2019
3
3
Not working for me with Paypal unfortunately. On all other Roms except Q Roms it works flawlessly with Magisk by making the dg.db database read only as described on XDA forums (Or by using the SQLite fix module for Magisk), but on the xiaomi.eu Q roms, it gets stuck on adding card and then says card can't be added after 1 minute.
 

dahuu

Members
Apr 7, 2019
12
13
Not working for me with Paypal unfortunately. On all other Roms except Q Roms it works flawlessly with Magisk by making the dg.db database read only as described on XDA forums (Or by using the SQLite fix module for Magisk), but on the xiaomi.eu Q roms, it gets stuck on adding card and then says card can't be added after 1 minute.
same here... after I did op's workaround it looked like it will work for the first time. but then it stucks in "adding your account" and after a minute it says "cant add card right now - please try again later. you can also try adding a different card"
i'm on 9.9.6 - android q ...
 

Mali2

Members
Jan 3, 2017
99
30
Mi 9, eu 9.9.6 (Android 10)
Gpay works with Visa and PayPal after install
and SQlite Fix 1.7 for magisk
 
  • Like
Reactions: dahuu

dahuu

Members
Apr 7, 2019
12
13
Thanks for sharing your solution. But this only possible with magisk...
Do you have to repeat everything after flashing a new weekly?
 

RedWave

Members
Aug 6, 2019
19
5
Thanks for sharing your solution. But this only possible with magisk...
Do you have to repeat everything after flashing a new weekly?
Problems with Google Pay are mostly because of root or bootloader unlock, so Magisk is part of the problem AND the solution.
I don't use Google Pay regularly, but the SQL DB shouldn't be modified when flashing a new rom.

Since the database is on the Data Partition (/data/data/com.google.android.gms/databases), it should stay the same.

If you have a problem with Google Pay only because you are unlocked, doesn't want root and only wanted to change roms easily, I suggest you root.
This needs a bit of work, but it allows you to fix problems comming from bootloader unlock.
 
  • Like
Reactions: dahuu

dahuu

Members
Apr 7, 2019
12
13
Thank you for your response and explanation.
I have no problem rooting my device. But for me personally there's no bonus and I don't really have a use-case. Ok.. Now it's gpay :) And I always appreciated Titanium Backup...

So, you guys are flashing the weekly and right after that magisk and everything works like before with gpay?
 

Mali2

Members
Jan 3, 2017
99
30
Thanks for sharing your solution. But this only possible with magisk...
Do you have to repeat everything after flashing a new weekly?
No, only after change from Android 9 to Android 10.
After dirty flash weekly and magisk, gpay works as before without extra work.
 
  • Like
Reactions: dahuu

dahuu

Members
Apr 7, 2019
12
13
hm... It doesn't work here. I'm rooted now, installed gpay-gms script and sqlite-fix.... I'm still stucking in "adding your account..." and "cant add card right now - please try again later. you can also try adding a different card"

Do you have Google Play Services <=17.4.55 installed?

Edit: In which order did you install the script and the sqlite-fix? did you reboot in between?
 
Last edited:

Mali2

Members
Jan 3, 2017
99
30
hm... It doesn't work here. I'm rooted now, installed gpay-gms script and sqlite-fix.... I'm still stucking in "adding your account..." and "cant add card right now - please try again later. you can also try adding a different card"

Do you have Google Play Services <=17.4.55 installed?

Edit: In which order did you install the script and the sqlite-fix? did you reboot in between?
First, under Android 9, i had magisk and SQlite Fix installed, hide all google play services and framework, hide PayPal, hide magisk ..... Gpay works.
After clean install of Android 10, i flash magisk and boot, hide all services and apps: Gpay don't work.
Then i installed the gms patch and gpay works.
Play services seems 18.7.19

Update. .. and in settings, i switched under NFC from hce-app to sim and back to hce-app
 
Last edited:

dahuu

Members
Apr 7, 2019
12
13
It just won't work... I'm getting absolutely insane
I did a complete wipe... Flashed the rom, flashed magisk, executed the script, mentioned above and install sqlite-fix...
Gpay still showing in the last step "adding your account..." till timeout ...
 

RedWave

Members
Aug 6, 2019
19
5
Gpay still showing in the last step "adding your account..." till timeout ...
From my experience:
- Apply one of the fix, or the other. Not the two at once, because then you cannot do it again and verify that the value is read-only, for example
- Verify that your Google Account is NOT SET to "USA", either in the Google App, or in Google Play (unless you live in the US)
- Verify that Google Pay is available in your country
- Verify that your bank is compatible with Google Pay
- Verify that you have selected in MAgisk Hide "Show system apps" and that you did hide magisk from all of them
- Verify that Magisk itself is in "hide mode"

etc....
 
  • Like
Reactions: Mali2

fryeBE

Members
Oct 16, 2017
46
20
Done eve
From my experience:
- Apply one of the fix, or the other. Not the two at once, because then you cannot do it again and verify that the value is read-only, for example
- Verify that your Google Account is NOT SET to "USA", either in the Google App, or in Google Play (unless you live in the US)
- Verify that Google Pay is available in your country
- Verify that your bank is compatible with Google Pay
- Verify that you have selected in MAgisk Hide "Show system apps" and that you did hide magisk from all of them
- Verify that Magisk itself is in "hide mode"

etc....
Done everything you said...
But i'm getting an error, can't add after "contacting bank".
 

RedWave

Members
Aug 6, 2019
19
5
Are you Dutch or Belgian?

> Google Pay is NOT available in the Netherlands.

And in Belgium, basically, it's N26 and online banks.

You might had Google Pay working by error previously.
 
  • Like
Reactions: Mali2

fryeBE

Members
Oct 16, 2017
46
20
I live in Belgium & bank KBC, supported for Google Pay.
Everything was working before android Q. :(
 

dahuu

Members
Apr 7, 2019
12
13
From my experience:
- Apply one of the fix, or the other. Not the two at once, because then you cannot do it again and verify that the value is read-only, for example
- Verify that your Google Account is NOT SET to "USA", either in the Google App, or in Google Play (unless you live in the US)
- Verify that Google Pay is available in your country
- Verify that your bank is compatible with Google Pay
- Verify that you have selected in MAgisk Hide "Show system apps" and that you did hide magisk from all of them
- Verify that Magisk itself is in "hide mode"

etc....
so... I deleted once again the /data/data/com.google.android.gms
(this will reset the patching done by the script, won't it? Or will I have to do a complete wipe? )

Then rebooted and executed the script.
Reboot once again and tried to add PayPal it goes complety through the process till "adding your account..."
This stays for 1-2 minutes and then "cant add card right now - please try again later. you can also try adding a different card"

the necessary apps are hidden by the script mentioned above and the database is patched by the script.
Google-Play-Services is 16.9.10
 

jstremmler

Members
Jun 12, 2019
13
5
I got Google Pay to work with my Mi9 (EU ROM 9.9.6) and a VISA credit card but I cant link my PayPal account to it.

Tested it today in a supermarket with the credit card and payment works, but not with PayPal.

Does anybody have an idea, what is different when installing PayPal?
On my old Samsung Galaxy S7 PayPal everything works. Have contacted PayPal with no response. (I have also deinstalled Magisk)
 

einsteinx2

Members
Sep 9, 2019
21
5
Hello Together,
has anyone a working gpay(with paypal) with Android Q (9.8.22)?
I dont use Magisk.
The workaround doesn't work since update to Q

Thanks
I fresh installed the Android Q based 9.9.6 on my Mi 9 and had working Gpay without doing anything (at least for purchasing from the Play Store, I don't use it for anything else). Also I only use a debit card with it, never tried PayPal so maybe as @jstremmler mentioned PayPal only doesn't work. Sorry I can't help more.
 

dahuu

Members
Apr 7, 2019
12
13
I got Google Pay to work with my Mi9 (EU ROM 9.9.6) and a VISA credit card but I cant link my PayPal account to it.

Tested it today in a supermarket with the credit card and payment works, but not with PayPal.

Does anybody have an idea, what is different when installing PayPal?
On my old Samsung Galaxy S7 PayPal everything works. Have contacted PayPal with no response. (I have also deinstalled Magisk)
Same here...
Meanwhile I got my Visa connected to gPay.
But PayPal just won't work...