Dishing Tech

Dishing Tech is a unique tech blog that offers news, how to's, tips, tweaks on pretty much anything tech related. We Dish out the latest news on gadgets and hardware. Provide Mac and iDevice reviews as well as provide tutorials on hacking, jailbreaking, internet security and visualisation.

16 January 2012

Installing Whatsapp on Mac or PC Doable?



WhatsApp is a multi smartphone instant messenger client and the best in my opinion. It is essentially as responsive as an SMS and different to many applications in that you do not need to have WhatsApp open to receive messages or media.


It gives users on BlackBerry, iDevices, Nokia (Ovi) or Android (Image 1) the ability to send text, photos, location, vCards and audio like messages to one another or via group chat using an internet connection. But can you install WhatsApp on a Mac or PC? After some research and looking at some WhatsApp programming code, this is what I found.

Image 1: Cross-platform, But no Mac or PC version...yet

Update Progress 21/3/2012: I was able to install WhatsApp on my Mac through Windows 7 Bootcamp with the YouWave Android emulator. Works pretty good. Here is how I did it and where to download it from: Installing WhatsApp, Android & Android Apps on PC. Doesn't work in Parallels Desktop though.


Methodology
After some digging into the file structure on the iPhone, I was able to determine that WhatsApp uses Jabber protocol (The same as what Facebook Chat uses) for communicating to other devices. I used iFile (Cydia app) and navigated to:

/private/var/mobile/applications/B5EE223-JD43-4354-4923492384/WhatsApp.app

To find the correct folder name to associate with WhatsApp. Yours will be different to mine: B5EE223-JD43-4354-4923492384. You can also find out the folder name through SBsettings (Cydia app) -> App Folders -> WhatsApp.


Downloading the Files
I used PhoneDisk to DL the files. Any application or method would do. E.g:

iFile (Bluetooth / Cydia)
iFile (WebServer / Cydia) WebDAV service with Bonjour

You just need to get the files on your computer. If you cannot access the root folders to get to the WhatsApp folder you will need to download afc2add in Cydia.

I navigated to the WhatsApp.app (10.8 mb) file and right clicked to show package contents. If you are on Windows, you might have to change the extension to .zip and extract the folders using WinRAR or use the Windows built in extraction utility

Combing the Code
Open the WhatsApp.app/WhatsApp document in textedit and browsed the code to see if there was anything of interest. There were:

26 instances of Jabber
2672 instances of XMPP
116 instances of server
At this stage it was easy to determine that WhatsApp uses Jabber and XMPP to communicate to other users. I copied and pasted anything that indicated a variable that might be used to connect WhatsApp to my Mac. I determined that Adium was probably the best choice as it supports Jabber and it has quite a number of settings. I opened Adium and went to:

File -> Add Account -> Jabber

Image 2: Adium Jabber Account Tab


Image 3: Adium Jabber Options Tab

Image 4: Adium Jabber Privacy Tab. WhatsApp allows you to see when other users are typing


Image 5: Adium Jabber Proxy Tab

Copied keywords: Jabber, ID, Password, Server, BOSH, Resource, SSL, TLS, Port, Proxies, Authentication, Proxy and Socks

Then used Command + F to find any instances of the above terms in the WhatsApp file.

What I found

Looking into the /Library/Media folder it was clear that WhatsApp's Jabber ID is made from your phone number (e.g: 67138360321@s.whatsapp.net). As far as the Jabber ID password goes, I am not sure if that is the SMS pin number that is received when you first open / setup WhatsApp, or if it is blank, or if it is automatically and randomly generated. 

Sniffing Packets
I decided to create see what communications were open between my device and WhatsApp. I created an unsecured WiFi network on my Mac (System Preferences -> Sharing -> Internet Sharing) and connected my iPhone. From there I turned off my iPhone:

3G in SBsettings
Email accounts (Made them all inactive)
Closed all background apps in the iPhone dock
Closed all the processes in SBsettings 
Free up memory in SBsettings

This was to ensure I was not getting any irrelevant non-WhatsApp packets.

Mac Packet Sniffers
I downloaded two freely available programs on my Mac called CocoaPacketAnalyzer and Eavesdrop (cannot recommend any Windows equivalent) to capture traffic and TCP connections. I found that Eavesdrop worked better and was more straight forward to use than CocoaPacketAnalyzer.  

I fired up Eavesdrop, selected en1 (Image 6) which is where my Airport Extreme (wireless card) is located and clicked start capture. There were no packets until I opened WhatsApp and received 15 (Image 7).

Image 6: Adding the right interface en1 for Eavesdrop

Image 7: Packets collected when WhatsApp opened

Packet Analysis
It was clear that WhatsApp was communicating to two destinations on port 443 (Image 8):


Image 8: Conversations and GoDaddy / security certificates

After running the test again, it appears that the IP addresses are not fixed, but dynamic. I got these two destinations, but the same conversations:


Another interesting find were references to GoDaddy and security certificates (Image 8). So clearly, GoDaddy is hosting the websites, servers and SSL certificates:

Scottsdale10U
GoDaddy.com, Inc.

U'Go Daddy Secure Certification Authority
Domain Control Validated10U*.whatsapp.net


The Go Daddy Group, Inc.110/U (Go Daddy Class 2 Certification Authority)

ValiCert Validation Network10U
ValiCert, Inc.1503U,ValiCert Class 2 Policy Validation Authority
info@valicert.com
http://ocsp.godaddy.com0DU=0;09†7†5Ü3

It is clear that the above .crl and .crt files can be downloaded and the .crt files can be imported into Mac OS X Keychain. But I am not sure how to get these to work with Adium.

Conclusions
I get to 50% connection in Adium but then the server rejects my connection, while some other servers simply hang on 25%. There are quite a number of variables and unknowns (Images 2, 3, 4 and 5) on how WhatsApp works and how it can be implemented into a multi-messenger client on a Mac or Windows PC. I believe it can be done and the developer is holding back because  it might flood their servers or reduce their revenue. I encourage anyone that wants to make a Adium plugin or create their own WhatsApp PC or Mac application to see if it can be done. 






14 comments:

  1. great research man, you deserve a medal.

    ReplyDelete
  2. Muchas gracias por la
    información, me ha sido de utilidad. Aquí os dejo otro artículo que se puede
    complementar con el post anterior.


    http://tecnologia.uncomo.com/articulo/como-usar-whatsapp-en-mac-5336.html


    Saludos y espero que os sirva!!

    ReplyDelete
  3. Keep digging!

    ReplyDelete
  4. Thanks for sharing your knowledge.  I was just thinking if it was doable to install Whatsapp on my Mac and google brought me to this article.

    ReplyDelete
  5. @adrian and @others. This is awesome....pls is it doable to link whatsapp to google talk. Since whatsapp uses jabber, is there a way. Already imported several other chat app contacts and hoping if u can figure out a way to add whatsapp

    ReplyDelete
  6. Still awaiting a response...anybody???

    ReplyDelete
  7.  wow! this is great Multi Smartphone

    Also try this : A new app to play games on PC Talking Tom for PC

    ReplyDelete
  8. Awesome effort trying to reverse engineer this thing. I have no idea why they don't have a desktop or web client - it should only give them even more locked-in users.

    ReplyDelete
  9. use http://bluestacks.com/bstks_mac.html

    ReplyDelete
  10. i dun think it would reduce their rev, since if the user already purchased the app on appstore or any other stores, their phone numbers can be used as license numbers.

    ReplyDelete
  11. its Good And Thanks For Sharing This And Nice Blog


    Photoshotoh

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...