How the BBM Android Application Get the Incoming Message

The routine to process incoming and outgoing message resides in BbmCoreService.java. This is after the libbbmcore.so library is loaded and proper authentication process is done successfully.

After libbbmcore.so is loaded and functional, periodically it will call a method in BbmCoreService class called prv_msgFromService. This is the incoming messages, which has many types, including advertising messages. This in turn will call the callback and other necessary routines, such as notifications, etc.

Likewise, the outgoing message is constructed to suitable format before sending it via the native method called prv_msgToService, also in libbbmcore.so.

Hope this small burst of information can help 🙂

After more detailed examination, I can added that the routine to handle incoming message resides in libtransport.so native library. It is implemented using socket, connect, select and recv socket functions.

On the start up of this library (i.e. the libtransport.so), it tries to connect to one of the BBM server IP Addresses, which is from 74.82.64.0 to 74.82.95.255, using SOCK_DGRAM connection type.

The received data is in encrypted form, and it is decrypted locally using SSL_read combined with BIO_write function, after properly set up the link between BIO and SSL functions using SSL_set_bio.

After the received data is processed, the libtransport.so routine will perform write to the created write end point of the pipe from libbbmcore.so routines. This will trigger the necessary functions such as showing the Notification with is BBM tone, etc.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: