Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can GCM/Firebase push notifications be intercepted with proxy software like Charles?

I have set up Charles proxy to intercept network traffic coming into an Android app running on the Android Emulator.

In Charles, Help > SSL Proxying > Install Root Certificate on a Mobile Device or Remote Browser

In Android emulator, ... enter image description here

The regular network traffic of the app comes through Charles proxy but not the push notifications.

Is there a way to intercept the push notifications with Charles?

I've seen that the documentation says that they come through on ports 5228-5230 on HTTP. https://developers.google.com/cloud-messaging/http

I can imagine for security this might be made more difficult. I've seen this previous answer Intercept all GCM push messages(for any app) but it doesn't give any detail of why it can't be done.

like image 584
TTransmit Avatar asked Apr 05 '18 13:04

TTransmit


People also ask

What is difference between FCM and GCM?

FCM is a cloud platform that provides messages and push notifications for operating systems- ios and Android, and websites as well. Google Cloud Messaging is a messaging service that enables the message transfer from server to clients apps.

What is GCM push notification?

Google Cloud Messaging (GCM) was a mobile notification service developed by Google that enables third-party application developers to send notification data or information from developer-run servers to applications that target the Google Android Operating System, as well as applications or extensions developed for the ...

What are the two types of notifications in Firebase?

With FCM, you can send two types of messages to clients: Notification messages, sometimes thought of as "display messages." These are handled by the FCM SDK automatically. Data messages, which are handled by the client app.


1 Answers

I think GCM notifications does not come directly to your app as http traffic. I think they work with Google Play Services installed on your phone which then triggers your app with "something".

After searching for it I've found this which I will quote here for reference:

There is simply a TCP socket waiting in accept mode on a cloud Google server. The TCP connection had been initiated by the Google Play application. That's why Google Play must be installed on the device for making Google Cloud Messaging (GCM) (formerly Android Cloud to Device Messaging Service - C2DM) work.
When this TCP client socket receives some message, the message contains information such as the package name of the application it should be addressed to, and of course - the data itself. This data is parsed and packed into an intent that is broadcast and eventually received by the application.
The TCP socket stays open even when the device's radio state turns into "idle" mode. Applications don't have to be running to receive the intents.

like image 159
Marian Paździoch Avatar answered Oct 20 '22 17:10

Marian Paździoch