microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
7.78k stars 1.63k forks source link

Threema 2.6: GCM push messages not processed #104

Closed Tentos closed 8 years ago

Tentos commented 8 years ago

As requested by @mar-v-in , I open a new issue because Threema 2.61 does not seem to work with GMS Core.

Here my old problem description. As far as I can tell, it still describes the problem. ---------------- Beginning of old problem description ---------------- Since the upgrade to Threema 2.6, there seems to be again an issue with GCM. I am not sure whether this is (again) related to some undocumented command of GCM/C2DM that Threema uses or to a bug in Threema itself. (In the latter, maybe a version 2.61 will fix this. Note that I have indeed seen some reports about Push problems with Threema 2.6 and the official Google Play Services, but they may or may not be related to my problem. The general userbase does not seem to have any major problems.)

The problem: Threema no longer seems to be able to register at the GCM service (com.google.android.c2dm.intent.REGISTRATION) nor does it receive any messages (com.google.android.c2dm.intent.RECEIVE - this is probably related to the failed registration).

Threema offers the possibility to force a new REGISTRATION action ("Reset push token", see https://threema.ch/en/faq/push_andr ). The Threema log of Version 2.53 then reports:

Wed Jan 27 13:46:16 MEZ 2016     acquireConnection: source = activityResumed, refCount = 1
Wed Jan 27 13:46:17 MEZ 2016    GCM register forced.
Wed Jan 27 13:46:17 MEZ 2016    GCM register in background.
Wed Jan 27 13:46:18 MEZ 2016     GCM registered, token = APA***E
Wed Jan 27 13:46:18 MEZ 2016    Sent push token to server.
Wed Jan 27 13:46:20 MEZ 2016     releaseConnectionLinger: source = activityPaused, timeout = 60000
Wed Jan 27 13:46:20 MEZ 2016    releaseConnection: source = activityPaused, refCount = 0
Wed Jan 27 13:46:20 MEZ 2016    onTrimMemory: 20

XPrivacy shows that a REGISTRATION was executed, and the logcat (captured with catlog) shows that GMS Core connected to the Google push server. Receiving messages works as expected.

This does not happen with version 2.6. The Threema log only shows

Wed Jan 27 11:54:50 MEZ 2016    acquireConnection: source = activityResumed, refCount = 1
Wed Jan 27 11:54:51 MEZ 2016     GCM Registration Token: APA***E
Wed Jan 27 11:54:53 MEZ 2016     releaseConnectionLinger: source = activityPaused, timeout = 60000
Wed Jan 27 11:54:53 MEZ 2016    releaseConnection: source = activityPaused, refCount = 0
Wed Jan 27 11:54:53 MEZ 2016    onTrimMemory: 20

XPrivacy does not show a REGISTRATION action, and the logcat does not show anything either (not even an error).

The only REGISTRATION that seems to happen is after the installation of Threema 2.6 (which is also intercepted - and allowed - by XPrivacy). It does not seem to have any effect because push messages do not arrive. (As mentioned, resetting the push token should again lead to a new REGISTRATION, which does not happen.)

I am aware that this description (with a logcat that does not show anything special...) does not really help. To begin, I therefore can only ask: Does anyone use Threema 2.6 with the newest version of GMS Core, and it works?

Should a developer want to look into this and not have a Threema licence, just send me a message, I will gladly sponsor one.

To conclude, my system: Android 4.2.2 Version 0.2.0 of GMS Core (downloaded at http://files.brnmod.rocks/apps/GmsCore/Latest) Signature spoofing with the FakeGapps Xposed module Push works with WhatsApp & Push Notification Tester

EDIT: I have (finally) installed the tools to capture logcats via USB. As I am a noob, I will have to find out how I can capture more or useful information. Or does anyone know how to capture the information specifically of GMS Core?

2nd EDIT: I must do something wrong, the logcat does not show any information with entries like "GmsGcmMcsSvc." Have I to set GMS Core to a "verbose" mode or something similar? ---------------- End of old problem description ---------------- What I have discovered with the Threema log:

Sat Feb 20 09:23:26 MEZ 2016 NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: "[removed]", roaming: false, failover: false, isAvailable: true, simId: 0

Sat Feb 20 09:24:14 MEZ 2016 Handling incoming GCM intent.

Sat Feb 20 09:25:42 MEZ 2016 NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: "[removed]", roaming: false, failover: false, isAvailable: true, simId: 0

GitteHuber commented 8 years ago

My system, when I tested GmsCore:

Result:

Attached is a logcat I saved back at the time when I experimented with GmsCore. I hope, there's something useful in it, but I can't say for sure. I uninstalled GmsCore back in March, because I just couldn't get it to work with Threema (and Small World 2), which are - to be honest - my primary scenarios for a working push service. logcat_CM_12.1_Xposed_FakeGapps_GsmCore_0.2.1.log.zip

Tentos commented 8 years ago

Threema has released version 2.7 of the messenger. Unfortunately, push still does not work. The wrong behaviour seems to be like in version 2.6x.

DatGizmo commented 8 years ago

Same for me.

Setup:

Results:

Is there a way to see, which app have a (active) connection to the GCM?

zoff99 commented 8 years ago

+1 i would really be cool to have some sort of status screen in GMS app, to display what apps are registered right now. and other useful statistics.

maybe this could be implemented?

Tentos commented 8 years ago

A status screen is a good idea. My impression is however that Threema is indeed registered, but received GCM notifications are not processed by the app. (In fact, the Threema log shows that a GCM message has been received, but the app does nothing.) The reason is not clear, maybe something in the GCM message is missing?

mar-v-in commented 8 years ago

@Tentos can you please try if Threema push notifications do work with version 0.2.2-4?

Tentos commented 8 years ago

@mar-v-in Good news: It seems to work as expected! :+1: The Threema log shows that the GCM message was received, and Threema then directly connects to the Threema server. I think that the problem has been fixed. Still, I will do some additional tests.

GitteHuber commented 8 years ago

Just wanted to confirm that with 0.2.2-4 Threema is working on my phone, too.

mar-v-in commented 8 years ago

Alright, I will close this issue then.