GmsCore icon indicating copy to clipboard operation
GmsCore copied to clipboard

In-app purchase support ? [$15]

Open acsway878787 opened this issue 8 years ago • 59 comments

I installed Google Play store and microG service core. I found that In-app purchase sometimes worked and sometimes not. So is In-app purchase official support?

Bountysource

acsway878787 avatar Feb 12 '17 12:02 acsway878787

I can't test IAP so I can't support it. If it doesn't work and you find any issues in the log, you can report them here and I might try to handle them.

mar-v-in avatar Feb 12 '17 14:02 mar-v-in

@acsway878787: The best way to get the problem fixed is to post a logcat when the problem happens.

ale5000-git avatar Feb 12 '17 15:02 ale5000-git

Logcat between when trying to buy something. I can't get it to work with any custom ROM, though it works fine on Samsung TouchWiz. TouchWiz ROMs are granting much more permissions to system apps by default (alteast for MM, haven't tested Nougat). Though, for this test I used my lux (Moto X Play) with Ressurection Remix. Framework patched using Haystack and latest microG (0.24-79) with DroidGuard, GsfProxy, PlayStore (7.6.08.N).

03-21 18:09:26.403  2380  3653 W ActivityManager: Unable to start service Intent { act=android.support.customtabs.action.CustomTabsService pkg=com.android.chrome } U=0: not found
03-21 18:09:26.447  6554  6554 D AndroidRuntime: Shutting down VM
03-21 18:09:26.453  6554  6554 E AndroidRuntime: FATAL EXCEPTION: main
03-21 18:09:26.453  6554  6554 E AndroidRuntime: Process: com.android.vending, PID: 6554
03-21 18:09:26.453  6554  6554 E AndroidRuntime: java.lang.SecurityException: uid 10124 cannot get user data for accounts of type: com.google
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:1684)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:1637)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at android.accounts.IAccountManager$Stub$Proxy.getUserData(IAccountManager.java:887)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at android.accounts.AccountManager.getUserData(AccountManager.java:402)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.google.android.finsky.billing.auth.o.a(SourceFile:107)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.google.android.finsky.billing.auth.a.a(SourceFile:143)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.google.android.finsky.billing.lightpurchase.al.a(SourceFile:6940)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.google.android.finsky.billing.common.g.v(SourceFile:265)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.google.android.finsky.billing.common.g.a(SourceFile:260)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.google.android.finsky.billing.lightpurchase.l.a(SourceFile:34708)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.google.android.finsky.billing.lightpurchase.al.U(SourceFile:945)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.google.android.finsky.billing.lightpurchase.al.T(SourceFile:884)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.google.android.finsky.billing.lightpurchase.al.S(SourceFile:868)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.google.android.finsky.billing.lightpurchase.al.A(SourceFile:20108)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.google.android.finsky.billing.lightpurchase.e.j.x(SourceFile:20128)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.google.android.finsky.billing.lightpurchase.d.c.onClick(SourceFile:200)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at android.view.View.performClick(View.java:5637)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at android.view.View$PerformClick.run(View.java:22433)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:751)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:95)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:154)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6176)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
03-21 18:09:26.453  6554  6554 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
03-21 18:09:26.456  2380  4406 W ActivityManager:   Force finishing activity com.android.vending/com.google.android.finsky.billing.lightpurchase.PurchaseActivity
03-21 18:09:26.473  2380  4406 W ActivityManager:   Force finishing activity com.android.vending/com.google.android.finsky.billing.lightpurchase.LightPurchaseFlowActivity
03-21 18:09:26.523  2380  4406 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:877 com.android.server.am.AppErrors.crashApplicationInner:375 com.android.server.am.AppErrors.crashApplication:309 com.android.server.am.ActivityManagerService.handleApplicationCrashInner:13686 com.android.server.am.ActivityManagerService.handleApplicationCrash:13668 
03-21 18:09:26.527  2380  4406 E ActivityManager: Sending non-protected broadcast projekt.substratum.APP_CRASHED from system 2380:system/1000 pkg android
03-21 18:09:26.527  2380  4406 E ActivityManager: java.lang.Throwable
03-21 18:09:26.527  2380  4406 E ActivityManager: 	at com.android.server.am.ActivityManagerService.checkBroadcastFromSystem(ActivityManagerService.java:18106)
03-21 18:09:26.527  2380  4406 E ActivityManager: 	at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:18695)
03-21 18:09:26.527  2380  4406 E ActivityManager: 	at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:18786)
03-21 18:09:26.527  2380  4406 E ActivityManager: 	at android.app.ContextImpl.sendBroadcast(ContextImpl.java:881)
03-21 18:09:26.527  2380  4406 E ActivityManager: 	at com.android.server.am.AppErrors.crashApplicationInner(AppErrors.java:375)
03-21 18:09:26.527  2380  4406 E ActivityManager: 	at com.android.server.am.AppErrors.crashApplication(AppErrors.java:309)
03-21 18:09:26.527  2380  4406 E ActivityManager: 	at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:13686)
03-21 18:09:26.527  2380  4406 E ActivityManager: 	at com.android.server.am.ActivityManagerService.handleApplicationCrash(ActivityManagerService.java:13668)
03-21 18:09:26.527  2380  4406 E ActivityManager: 	at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:1660)
03-21 18:09:26.527  2380  4406 E ActivityManager: 	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2980)
03-21 18:09:26.527  2380  4406 E ActivityManager: 	at android.os.Binder.execTransact(Binder.java:565)
03-21 18:09:26.573  2380  2503 W BroadcastQueue: Permission Denial: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to de.amazon.mShop.android/com.amazon.mcc.crashreporter.android.CrashReportBroadcastReceiver requires android.permission.READ_LOGS due to sender android (uid 1000)
03-21 18:09:26.574  2380  2503 W BroadcastQueue: Permission Denial: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to de.amazon.mShop.android/com.amazon.mcc.crashreporter.android.CrashReportBroadcastReceiver requires android.permission.READ_LOGS due to sender android (uid 1000)
03-21 18:09:26.658  2380  6364 I OpenGLRenderer: Initialized EGL, version 1.4
03-21 18:09:26.658  2380  6364 D OpenGLRenderer: Swap behavior 1
03-21 18:09:26.974  2380  2503 W ActivityManager: Activity pause timeout for ActivityRecord{7376ff9 u0 com.android.vending/com.google.android.finsky.billing.lightpurchase.PurchaseActivity t4 f}
03-21 18:09:28.132  2380  4406 W ActivityManager:   Force finishing activity com.android.vending/com.google.android.finsky.billing.lightpurchase.PurchaseActivity
03-21 18:09:28.149  2380  4406 W ActivityManager:   Force finishing activity com.android.vending/com.google.android.finsky.billing.lightpurchase.LightPurchaseFlowActivity
03-21 18:09:28.153  1566  1566 W SurfaceFlinger: couldn't log to binary event log: overflow.
03-21 18:09:28.171  2380  4406 W ActivityManager:   Force finishing activity com.android.vending/com.google.android.finsky.activities.MainActivity
03-21 18:09:28.247  2380  4406 E ActivityManager: Found activity ActivityRecord{c8ed575 u0 com.android.vending/com.google.android.finsky.activities.MainActivity t4 f} in proc activity list using null instead of expected ProcessRecord{e8453f1 6554:com.android.vending/u0a124}
03-21 18:09:28.293  2380  4406 I ActivityManager: Killing 6554:com.android.vending/u0a124 (adj 100): crash
03-21 18:09:28.301  2380  4406 D ActivityManager: cleanUpApplicationRecord -- 6554
03-21 18:09:28.307  2380  2504 W art     : Long monitor contention with owner Binder:2380_8 (4406) at void com.android.server.am.AppErrors.crashApplicationInner(com.android.server.am.ProcessRecord, android.app.ApplicationErrorReport$CrashInfo, int, int)(AppErrors.java:385) waiters=0 in void com.android.server.am.ActivityManagerService.unregisterReceiver(android.content.IIntentReceiver) for 112ms
03-21 18:09:28.308  2380  2504 W InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
03-21 18:09:28.373  2380  4408 W ActivityManager: Unable to start service Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms } U=0: not found
03-21 18:09:28.375  2380  4406 W ActivityManager: Unbind failed: could not find connection for android.os.BinderProxy@5db1cb0

Nanolx avatar Mar 21 '17 17:03 Nanolx

I'm having problems with inapp purchases as well. As soon as I press "buy" to confirm the purchase, it tells me Google Play store has stopped.

Ningyoplug avatar Mar 22 '17 14:03 Ningyoplug

Same issue, Google Play store has stopped. I can't make any in app purchases in Pokémon GO. No I'm not cheating, this is the standard apk from the Play store. I'll try to take a log later.

ShapeShifter499 avatar Apr 01 '17 08:04 ShapeShifter499

@mar-v-in did you have a chance to have a look at my logcat yet?

Nanolx avatar Apr 01 '17 08:04 Nanolx

@mar-v-in Here's a logcat, taken from boot all the way till I attempt a purchase in Pokemon GO and I see "Google Play Store has stopped" message. Pokemon_GO-In_App_Purchase-microG-logcat.txt

ShapeShifter499 avatar Apr 03 '17 13:04 ShapeShifter499

I'd like to see this resolved so I added $5 to Bountysource

ShapeShifter499 avatar Apr 03 '17 13:04 ShapeShifter499

The problem is that Play Store tries to call a method that it is only allowed to call if Play Services and Play Store are signed with the same key. As this is not the case when using microG with original Play Store, it crashes.

There are three solutions to this problem, one uglier than the other:

  • Sign Play Store and microG with the same key (and use signature spoofing on play store to have it look like Google signed). There won't be Play Store builds signed with the official microG key, but you can still do it yourself.
  • Modify Play Store to not do this call (possibly using Xposed).
  • Modify the operating system to allow Play Store to do this method call (possibly using Xposed).

This problem was not present in older Play Stores afair so you might as well be able to just downgrade it.

mar-v-in avatar Apr 03 '17 13:04 mar-v-in

@mar-v-in Which version do I try? If I try the one suggested in the "Flashable Zip by @ale5000-git", Google Play Store 5.1.11, some apps get blacklisted from downloading. I'm guessing because Google thinks my device is running too old of a Operating System due to a out of date Google Play Store.

ShapeShifter499 avatar Apr 03 '17 13:04 ShapeShifter499

@ShapeShifter499 I can't help you there, I never used original Play Store.

mar-v-in avatar Apr 03 '17 13:04 mar-v-in

@mar-v-in "Sign Play Store and microG with the same key" Does there need to be any changes to the current code? Or should this work right now if I attempted it? Any caveats to this?

ShapeShifter499 avatar Apr 03 '17 13:04 ShapeShifter499

You won't be able to update microG through F-Droid or Play Store anymore and you need to add signature spoofing the Play Store (similar to how it is done in microG), which requires some modification of Play Store's AndroidManifest.xml

mar-v-in avatar Apr 03 '17 14:04 mar-v-in

That's to much work every time I want to update microG, or when there is a Google Play Store update, or even when I want to update my ROM.

"Modify the operating system to allow Play Store to do this method call" -- This seems like the best way, maybe it can be added to the set of patches already in use. But I'm just pulling things out of thin air at this point, I don't have much knowledge past this point.

ShapeShifter499 avatar Apr 03 '17 15:04 ShapeShifter499

@ShapeShifter499 this modification would be about reducing android's security by punching a hole in it's security system. I will not write or support such a patch. The best solution IMHO would be a Xposed module, but I won't be the one to create it.

mar-v-in avatar Apr 03 '17 15:04 mar-v-in

@mar-v-in thanks for that solution! I re-signed microG GmsCore and Play Store with the same (debug) signature and modified Play Store Manifest for correct fake signature: et voila. It's working.

I test-bought that 0,10 € Piano app Google is currently offering.

The only thing I notices so far is that my only installed paid app on my Moto X Play (Flux Substratum Theme) needed to be re-installed to verify the purchase process. Haven't tested on my Tablet yet, where I have a few paid games installed. Maybe all paid apps need a re-installation if not coming from a clean flash, but that's only a one-timer.

If someone wants to give it a try:

Install at your own risk, Play Store TOS violation, bla, bla.

[The strange thing is: on TouchWiz ROMs (atlest Marshmallow, haven't tested Nougat) Samsung has made so many changes to the framework files that in-app-purchases work just perfect with only patching framework files using tingle/haystack. Also Maps is auto-granted permission to accounts, unlike on other ROMs where you manually have to allow it, else it won't find the account.]

Nanolx avatar Apr 03 '17 17:04 Nanolx

I added 10 $ to the bounty for native solution, btw.

Nanolx avatar Apr 03 '17 18:04 Nanolx

Nanolx, do i just have to install the two apks you linked for it to work properly or do I need to do something else? If I need to do womething else, then could you tell me the steps?

Ningyoplug avatar Apr 03 '17 18:04 Ningyoplug

@Ningyoplug install them the same way you did with the original ones, so usually both in /system/priv-app/

Nanolx avatar Apr 03 '17 18:04 Nanolx

@Nanolx trying to install your gmscore but it tells me "the package appears to be corrupt"

Ningyoplug avatar Apr 03 '17 18:04 Ningyoplug

@Ningyoplug move it manually into /system/priv-app/ replacing the original file and reboot. The solution with the debug-signed apks is a bit tricky.

Nanolx avatar Apr 03 '17 19:04 Nanolx

@Nanolx I don't even have a Phonesky folder in priv-app.... and Play Store keeps giving me "server error" and idk how to fix it.

Ningyoplug avatar Apr 03 '17 19:04 Ningyoplug

@Ningyoplug Dunno, you can either try my whole project, checkout http://www.github.com/Nanolx/NanoMod, be sure to read all of README. I uploaded a snapshot zip: https://www.androidfilehost.com/?fid=745425885120721657 In case you wanna try, be sure to move any further discussion to the NanoMod repository (as it's not related to microG).

Or wait for someone to add native (in-)app-purchase support to microG.

Nanolx avatar Apr 03 '17 19:04 Nanolx

@Nanolx I tried your package, same issue.

ShapeShifter499 avatar Apr 03 '17 21:04 ShapeShifter499

I even tried uninstalling and reinstalling problem apps

ShapeShifter499 avatar Apr 03 '17 21:04 ShapeShifter499

Clear PlayStore data. Might give that a try, else please a logcar in the other git repo.

Nanolx avatar Apr 04 '17 00:04 Nanolx

I created a new snapshot of my Magisk Module. Many internal changes, especially now possible for example to only populate microG (see part "Alter Installation" in the README).

  • Download: https://www.androidfilehost.com/?fid=673368273298945033
  • README: https://github.com/Nanolx/NanoMod/blob/master/README.md
  • completely remove anything regarding microG from your device first, including Play Store

Edit: beta 3 with installer changes.

Nanolx avatar Apr 04 '17 16:04 Nanolx

@Nanolx I left a logcat on a new issue over on your repo for NanoMod

ShapeShifter499 avatar Apr 07 '17 12:04 ShapeShifter499

can I re-sign the play store and microG apk with same key, then install, can it solve this issue?

WanderMax avatar May 09 '17 07:05 WanderMax

@WanderMax nope, you need to modify PlayStore for signature spoofing, too.

I made this here: http://github.com/Nanolx/NanoMod

You can find the apks in Overlay/system/priv-app

  • GmsCore for microG
  • Phonesky for PlayStore

Nanolx avatar May 09 '17 07:05 Nanolx