maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   [WIP] Porting Whatsapp to Meego/Maemo (N9, N900) (https://talk.maemo.org/showthread.php?t=82384)

rash.m2k 2012-02-16 19:37

[WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Thought I'd start a new thread in the dev section for people to post stuff specifically related to porting whatsapp, hopefully I can and other devs can find things much easier if it's in a single dev only thread.

So to start of with Whatsapp uses XMPP according to wikipedia:

http://en.wikipedia.org/wiki/WhatsApp

So this google code will probably help with that;

http://code.google.com/p/qxmpp/

Whats different about whats app is that it allows >1 person to be involved in a conversation, not sure whether XMPP supports this (this shows im not an XMPP expert).

The following post in the original thread is very helpful, credit to ColaCheater very very useful post:

Quote:

Originally Posted by ColaCheater (Post 1160118)
Great to see that somebody is working on WhatsApp for the Nokia N900.

A few weeks ago I also tried to look a little bit into WhatsApp but had to give up because of my final exams at school.
I used the Symbian S40 Client and decompiled the .jar you can find via google to look a little bit into it.
I'm not a programmer but had done some "Hello World" stuff on Java before so I tried to understand a little bit what is going on in the Client. (In the following work I always pretended to be an Nokia C3-00 just that you know when it appears i.e. in the User-Agent)


I don't know if it's helpful for you but I will try to share the things I found out by looking into the code even though I can't gurantee they are right:

The first thing is the login-Name and the password needed to login:
Matching with reports from some other threads here and in other forums the login name I found was some sort of:
Code:

international area code without the 0's or + in the beginning + phone number without the first 0 + @s.whatsapp.net
For example if you live in germany and having the phone number 017612345 it would be 4917612345@s.whatsapp.net -> 0049 for germany without the 0's and the phone number without the 0.

The Password is set during the registration process but usually it is an transformation of the IMEI of your phone (in case you don't want to stand out you should also do it like this). I must admit I don't exactly know how this transormation works but I have the code that does it.
I just wrapped it _very dirty_ in a standalone Java program to test it. source: http://pastebin.com/npbwcj1s
I really don't know what it exactly does and didn't look deeper into it but it isn't a "real" md5 I think... (Maybe someone who knows how to create an MD5 in Java can look at it what is different except the reverse of the imei?)


The second thing I searched for is the registration process.
With this I got so far that I got an Registration-Code and I also get the response from the Server that the account exists but I can't login because I hadn't enough time to look excatly at the login process. Just logging in via XAMPP in Pidgin doesn't work expectedly :D

The registration process works this way: (no gurantee that it is right and don't try it with your "real" number. I tried it with an old SIM I had lying around)

0) All these API-Request are done with an User-Agent like:
Code:

WhatsApp/2.1.0 S40Version/04.60 Device/nokiac3-00
The Code generating this is: http://pastebin.com/K79wrfnS
I used information I found in the web to fill the information for the Nokia C3-00.
As said by the pw: I don't think you really have to fake it to look like this but it maybe makes it harder to find you.

1) The first step ist requesting the Registration-code from the Server (the Code you get i.e. via SMS)

The API-call looks like this:
Code:

https://r.whatsapp.net/v1/code.php?cc=49&in=17612345&to=4917612345&lc=DE&lg=de&mcc=000&mnc=000&imsi=00000000000000&method=sms
The Arguments are as following:
cc = area code without 0's
in = number without first 0
to = number where the sms or call should go to (maybe security weakness?)
lc/lg = Language-Code(?) splittet up - e.g. DE_de goes to lc=DE&lg=de US_en would be lc=US&lg=en
mcc/mnc/imsi = Should be the "Mobile Country Code", "Mobile Network Code" and the "Mobile Subscriber Identification Number"
-> I don't know how to get to them and the App has as "fallback" just the 0's in it when the system-request for them fails so it should work with the 0's (and it does)

The metod is maybe the most interesting thing.
There are 3 methods: self, sms and voice
When choosing sms you get the Code via SMS as you may know it, choosing voice you get a call at the to-number where it reads the code (I didn't test but it would match with informations you find at some other places in the web). I don't know what self exactly does and I didn't really looked for it because the SMS-Way seemed the best for me, especally because I just wanted to know my Code :>

The Answer after calling the API is an xml saying:
Code:

<code><response status="sucess-sent" result="30"></code>
What error-Messages look like I don't know because it worked for me (and I just looked into the code again and I didn't find any code that works with an specific error, it just closes the App when an error occurs if I'm right) ^^

Also you should get an sms (in case you used the method sms) at the "to" number conatining the WhatsApp-Code which looks like this:
Code:

WhatsApp code abc
abc is the necessary Code ;)

2) With the given code you can then register your Whatsapp-Account

API-Call:
Code:

https://r.whatsapp.net/v1/register.php?cc=49&in=17612345&udid=asdf&code=abc
cc/in = the same as in code.php
udid = the calculated password as explained in the login-data
code = the just recieved WhatsApp-Code

The XML response looks like:
Code:

<register> <response status="ok" login="4917612345" result="new" /> </register>
The login-value is your login-Name for the connection and built like explained.
I think that there are error-messages when the account already exists etc. but as said: I didn't have more time and It worked ^^

3) As third API-call you can check if an accounts exists. This isn't necessary for registration I think.

API-call:
Code:

https://r.whatsapp.net/v1/exist.php?cc=49&in=17612345&udid=asdf
Parameters are the same like above.

Resonse when account with this number and pw exists:
Code:

<exist><response status="ok" result="4917612345" /></exist>
The result again gives the login-name for this account.
I did some tests with this and even though I didn't save the exact answers I found out that it just checks if the account with the given number and the given pw exisists. You can't check if another numer has an WhatsApp-Account with this API-call. (or I just was to stupid to find out how to do this)


The last thing I searced for before studing for my exams was the server connection.

It Baisicly is - as said everywhere - an XAMPP Connection. At least it looks like.
I think there are some small differences between the default XAMPP and the way WhatsApp does it.

But nevertheless the URL I found to where it tries to connect is:
Code:

socket://bin-short.whatsapp.net:5222
When connecting to the URL with Pidgin and default XAMPP it also gets an connection but the connection gets closed by the server after sending the xml and xampp information.
When I connected to a "default" XAMPP server after these two "sendings" the Client gets an response from the Server.
WhatsApp instead sends the Auth directly after the features so I think the Server quits the connection because Pidgin is waiting for Information and the Server also is waiting for information.

The Login-Process in the WhatsApp-Code looks like:
Code:

out.streamStart(connection.domain, connection.resource);
                System.err.println("sent stream start");
                sendFeatures();
                System.err.println("sent features");
                sendAuth();
                System.err.println("sent auth");
                in.streamStart();
                System.err.println("read stream start");
                String challengeData = readFeaturesAndChallenge();
                System.err.println("read features and challenge");
                sendResponse(challengeData);
                System.err.println("sent response");
                readSuccess();

Because WhatsApp uses a "default" XAMPP-Libary which is just modified and the default functions are still there I think the default Login-Process of XAMPP looks like:
Code:

                send1();
                send2DigestMD5Mechanism();
                read1();
                String challenge = read2Challenge();
                send2SASLResponse(challenge);
                send2UselessResponse();
                read2Challenge();
                read2();
                send3();
                read3();
                send4();
                send5();

-> as said, after the send1 and 2 (which are doing baisicly the same as the streamStart and sentFeatures in the WhatsApp-Version) it waits for information instead of sending the Auth.

Here I stopped working on it because of the exams. I think it should be not too difficult to make a login work when completely re-writing the Original functions.
Just as orientation the whole (sub)class of the WhatsApp-Login: http://pastebin.com/X8gv2XRU


Thats all I did up to now (or more exactly before my exams).
I would really like to see somebody working on this and making it work on the N900. At first I wanted to look at it again after the exams but eventhough I finished my exams two weeks ago I didn't found the time to work on this and because I'm not a programmer it also would take at least a _very_ long time to work, if it would work at all :D


If some beta-testers are searched for the programm I would really like to test it from a hobby-programmer or more non-programmer point of view :rolleyes:



PS: Eventhough I personally don't like it when people ask for forgiveness for their bad english I would like to do the same right now :D
I'm from Germany and not really good in languages. I really hope my text ist readable and you understand what I wanted to say with it ^^ (if you don't understand something feel free to ask what it was meant to say ;) )


rash.m2k 2012-02-16 19:41

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
I have successfully decompiled the source for the whatsapp APK.

And can upload this upon request for anyone that wants to save themselves some hassle.

I am a Java dev, but currently working on some (>1) QML/Qt based apps for the Nokia N9 plus I have a full time job. Regardless I will try to help as much as I can.

kamo.6 2012-02-16 21:00

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Please PM me the link to the APK, would like to look into it and possibly assist if I can. :)

rash.m2k 2012-02-16 21:44

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
I'm uploading now,

the file contains two things:

a) smali decompiled code, this is purely so you can see the XML files.

b) Actual source from the WhatsApp APK, this is a zip file inside the WhatsApp-smali-decompiled and has src in the filename.

Upload link:

http://www.mediafire.com/?ssc3awthw99kl9s

rash.m2k 2012-02-16 22:53

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Turns out the framework apk i was using was for android eclair.

I has decompiled it but not quite correctly. Seems to get confused with the object type of some variables.

hobarrera 2012-02-16 23:01

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Let me quote some useful info from the previous thread for anyone nt willing to navigate through pages and pages of "thank you"s and fanboys complaining.

Quote:

Originally Posted by hobarrera (Post 1165475)
Let me clarify some things I've noticed some people get messed up about after reading this entire thread:

Telepathy is a framework for building IM clients. Plugins can be written for telepathy, that allow any application using it to connect to different protocols.

Empathy (the gnome chat client) uses it as a backend, as well as the maemo chat client, and probably some other clients do as well.

This means that writting an Y-protocol plugin for telepathy, enables all these clients to connect to Y-protocol.



On the other hand, there's pidgin (http://pidgin.im). It's a multiplatorm IM client, that also uses plugins for different protocols; there are called "prpls".

Finally, there's a telepathy plugin, that in turn, uses prpls. So, by writting a plugin for pidgin, you allow pidgin to use it, and telepathy as well.

I'd vote for a pidgin plugin, since this mean that we allow a greater number of clients to use it.


Also, a LICENSE AGREEMENT forbids you from reverse engineering. If it's enforcable or not, depends on where you live, BUT, if person A provides the dumps, and person B develops, person B has never agreed to any license, so he's surely in the clear.
[...]

Quote:

Originally Posted by hobarrera (Post 1165844)
[...] I've come across something interesting; "telepathy-butterfly" (the msn plugin) is implemented in python.
I'm currenly writting a foursquare client in python for maemo, so once I'm done and have some more time on my hands, I might be able to help you guys implementing a WA plugin (depends if I find some good XMPP implementation to use as a reference, since this is strongly XMPP-based).

I've read QML is rather slow on N900, or something alike. PLEASE make sure I'm wrong if you plan to use it.

I *might* be able to help in future when I finish my current proyect.
If there's any more python dev here, patching stuff from telepathy-butterfly and possibly xmpppy might be a cool idea.

Whatever you do, don't use some really not-popular language. :)

On any case, I've given this some though, and I think we might use some small app to retreive password/etc, and then store it into a file.
This means the telepathy plugin can be separate, and requires *no separate gui*. It'd be just a backend, and therefor, reusable in innumerable platforms.

Oh, and XMPP *does* support multiple persons in a single conversation. Google Talk is an XMPP service, and most things you can do there, are standard XMPP. For multi-people chat, a "chat room" is created temprarily. Read, as a minimum, the wikipedia page for some info on XMPP.

tgalal 2012-02-17 05:49

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
I'm a python dev, I've implemented registration and now I'm trying to get the login part to work.

www.rzr.online.fr 2012-02-17 11:27

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
would icedrebot project help to run the android parts ?

ibrakalifa 2012-02-17 12:15

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
wait for chrome mobile ported, :D

ColaCheater 2012-02-17 13:24

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Eventhough I'm still waiting for teamer to write what he exactly knows about the protocol it's great to see other people also working on it.

For my part I wrote in my post about registration everything I know so I can't give you much more information, the only thing I can do is looking for some specific actions in the code, e.g. how an request is build or something like this.


Quote:

Originally Posted by rash.m2k (Post 1165934)
I have successfully decompiled the source for the whatsapp APK.

And can upload this upon request for anyone that wants to save themselves some hassle.

I am a Java dev, but currently working on some (>1) QML/Qt based apps for the Nokia N9 plus I have a full time job. Regardless I will try to help as much as I can.

If you're a Java-Developer it may be better for you to decompile the S40 Version of WhatsApp? - Thats the version I had a look at and is written in Java ;)


Oh and maybe it would be better not to share the "original" WhatsApp code here, just the things we found out about how it works.
I don't know the legal positon but sharing code that is (c) by WhatsApp isn't that good I would say :rolleyes:


The last thing I think maybe would be good to know: Is somebody having a phone with an official WhatsApp version to do some sniffing? This may also would be helpful, especally to get to know i.e. what information the mobile phone really sends u.s.w.
-> A Nokia S40 Phone (which supports WhatsApp) would be the best I think because at least that would be the source where most of us are getting their information from?!

DataGhost 2012-02-17 16:23

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Thought I'd give you an update... nothing much happened since my last post, my work is progressing slowly as I do have some spare time, but only some. Also, I'll be gone the entire next week so don't expect anything happening then.

For anyone else who wants to have a crack at this: go ahead but unfortunately I can't/won't share the information I have because of the simple fact that it's all in my head or scrambled around in text files and putting it together in something coherent and usable will take too much time. Anyone experienced enough to reverse engineer WA won't have too much trouble gathering this information anyway so I don't expect that to be a problem.

rash.m2k 2012-02-17 19:13

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
I do have an official whatsapp on my android device, not really sure how I will sniff the data on the whatsapp?

Setup up a wireless network using my laptop as a gateway and sniff the traffic that way? i do have a usb wireless dongle so could do that once I am able to setup the routing tables.

The android code is pretty much the same as s40 I would assume, but I couldn't get the s40 app thats why I got the android one.

Probably not a good idea to share code from whats app - it's a grey area but i'm just saving people the hassle of doing it themselves.

What we really need is a working and compilable version of android whats app currently mine doesn't compile!

We also need a place to share ideas and put some of this code (not in a public place ofcourse) - that would help this project along immensely!

Quote:

If you're a Java-Developer it may be better for you to decompile the S40 Version of WhatsApp? - Thats the version I had a look at and is written in Java


Oh and maybe it would be better not to share the "original" WhatsApp code here, just the things we found out about how it works.
I don't know the legal positon but sharing code that is (c) by WhatsApp isn't that good I would say


The last thing I think maybe would be good to know: Is somebody having a phone with an official WhatsApp version to do some sniffing? This may also would be helpful, especally to get to know i.e. what information the mobile phone really sends u.s.w.
-> A Nokia S40 Phone (which supports WhatsApp) would be the best I think because at least that would be the source where most of us are getting their information from?!

ColaCheater 2012-02-18 10:50

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Quote:

Originally Posted by rash.m2k (Post 1166331)
I do have an official whatsapp on my android device, not really sure how I will sniff the data on the whatsapp?

Setup up a wireless network using my laptop as a gateway and sniff the traffic that way? i do have a usb wireless dongle so could do that once I am able to setup the routing tables.

Because WhatsApp sends at least it's messages without encryption sniffing shouldn't be that hard I think. I don't have too much experience with this but using Wireshark with an IP filter for the phone in a non-encrypted Wifi maybe could to the job?


And just a small Update:
I noticed that I think my S40-Version of WhatsApp isn't the newest.
The newest MIDlet-Version should be 2.3.9 and mine is (as I wrote) 2.1.0 when I saw it correctly... - Does anybody with the S40-Code have a newer version?

Update: The newest version actually is 2.3.12 and I now was able to download this Version. Isn't that hard, you just have to look what the newest Version is :D

Update 2: I really should look at things before posting... >.< - The 2.3.12 now is obfuscated so I think it doesn't help that much :rolleyes:

rash.m2k 2012-02-18 11:39

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Old versions are no longer on the server anymore!

Need to grab them from other places. Working on that now.

teamer 2012-02-18 12:23

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
i don't think we need any newer version
for now i still did not understand what is required to build a plugin like (like skype or gtalk ones) for n900 ? empathy ? telepathy ? pidigin ? what exactly ?????????????

for now we have the login and registration procedures that works (yes !) lets implement them into "something" as a start , then after , implementing xmpp to that all won't be hard . 2-3 days of development would set that all . but the problem is WHAT TO DEVELOP ? get me an answer for that !

ColaCheater 2012-02-18 12:45

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Quote:

Originally Posted by teamer (Post 1166527)
i don't think we need any newer version
for now i still did not understand what is required to build a plugin like (like skype or gtalk ones) for n900 ? empathy ? telepathy ? pidigin ? what exactly ?????????????

for now we have the login and registration procedures that works (yes !) lets implement them into "something" as a start , then after , implementing xmpp to that all won't be hard . 2-3 days of development would set that all . but the problem is WHAT TO DEVELOP ? get me an answer for that !

As far as I understood hobarrera in his post we would need to write an Telepathy plugin so that it works with the N900.
The alternative would be to write an Pidgin plugin that then could be used in telepathy/N900 via a plugin for telepathy(?!)

rash.m2k 2012-02-18 12:50

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Say we did create a plugin for something (one of those frameworks mentioned). Would we still be able to send files, have >1 party IM sessions, be able to send broadcast messages? (I have zero knowledge of this)

Porting WhatsApp is one thing, but the reason people use it is because of the above features, we need to make sure they are done otherwise it not really going to help many people.

ColaCheater 2012-02-18 13:06

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Quote:

Originally Posted by rash.m2k (Post 1166548)
Say we did create a plugin for something (one of those frameworks mentioned). Would we still be able to send files, have >1 party IM sessions, be able to send broadcast messages? (I have zero knowledge of this)

Porting WhatsApp is one thing, but the reason people use it is because of the above features, we need to make sure they are done otherwise it not really going to help many people.

This would depend on the Client using the Plugin.
The N900 i.e. supports file transfers for xampp, IM-Sessions with more than 1 person also is avaiable in xampp (don't know if the N900 offers this in the xampp Plugin), brodcast messages just are .xyz sound files send i think and so on. By this I would say yes, it is possible to do.
And even when we wouldn't be able to integrate it 100% into the n900 conversations, I think it still would be possible to create a program for handling this special things and letting the "normal" conversation work via the N900 conversations...

teamer 2012-02-18 13:15

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Quote:

Originally Posted by rash.m2k (Post 1166548)
Say we did create a plugin for something (one of those frameworks mentioned). Would we still be able to send files, have >1 party IM sessions, be able to send broadcast messages? (I have zero knowledge of this)

Porting WhatsApp is one thing, but the reason people use it is because of the above features, we need to make sure they are done otherwise it not really going to help many people.

i don't know about files and group chat , but this is xmpp potocol so i think it would be possible , and for me , i'd rather send files via email ! for group chat ... i don't need it , i just want the whatsapp to be able to chat with my friends who have problems with skype(it takes lots of battery on other devices) and cuz 99% of my friends have whatsapp . thas my point of view . so basically i think only being able to IM other would be enough and a good start , other features might come later via an upgrade !

rash.m2k 2012-02-18 13:50

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Could some download the whatsapp from here and also save them?

http://www.filecrop.com/search.php?w...inc&order=size

OzJD 2012-02-18 15:41

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
The problem you guys are going to have is that the code you are in possession of is way out of date.
It's easy enough to sniff out the new data connections if you use a Man in the middle attack.

I'm still not sure how the activation code is done; The rest I am sure of.
I can successfully get both username and password by providing Phone Number and IMEI.

It's all really simple, and I don't want to say too much on a public here atm, the only thing I can't work out is the activation code.

I'm considering building a web client soon.

Hint for future... don't use iq.php to get a list of available contacts; the current official clients don't use this anymore. It will be obvious to WhatsApp staff that you've gained access.

I do know for sure that the 3 digit verification code can be calculated by NUMBER + NETWORK only. It's not a random number.


If you want more info, circle me on Google+ (and let me know who you are, and that you're a Maemo user)
https://plus.google.com/u/0/105182152373033008678/


Edit: Verification code does not rely on MNC.
Edit2: Verification code does not rely on MCC.
This means it only requires Country Code & Phone Number to be calculated.

What's really annoying...
I thought I got lucky when adding the digits of my MCC + MNC + CC, then multiplying it by my local number, the last 3 digits were my verification code.

OzJD 2012-02-18 17:27

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
You can find your WhatsApp username & password easily using this tool:
http://www.jeltel.com.au/whatsapp/password.php

It will only show WhatsApp username and password AFTER entering a correct phone number and IMEI.

hobarrera 2012-02-18 19:36

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Quote:

Originally Posted by ColaCheater (Post 1166542)
The alternative would be to write an Pidgin plugin that then could be used in telepathy/N900 via a plugin for telepathy(?!)

Yes, some protocols are already implemented this way in the N900.
I belive the avahi/bonjour plugin in particular, is a pidgin plugin, being loaded this way.

Quote:

Originally Posted by rash.m2k (Post 1166548)
Say we did create a plugin for something (one of those frameworks mentioned). Would we still be able to send files, have >1 party IM sessions, be able to send broadcast messages? (I have zero knowledge of this)

Multi-person IM sessions are supported on XMPP, but I can't remember if I've ever had one on the N900.
File sending is missing from the N900 chat UI.

I don't know what you mean by broadcast, but if it means "sending to everyone", there's probably some specific account that you send the message to (ie: everyone@s.whatsapp.com), and it gets re-sent to everyone by the WA server.
I'm just guessing though, this will probably be verifiable by sniffing :P

OzJD 2012-02-19 03:30

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
CONNECT_BINARY_DOMAIN_ASCII = "bin-short.whatsapp.net";
CHAT_BINARY_PORT = 5222;
PRODUCTION_CHAT_XMPP_DOMAIN = "s.whatsapp.net";
CHAT_XMPP_PORT = 443;
URL_CRASHLOG_UPLOAD = "https://crashlog.whatsapp.net/upload.php";
URL_MMS_UPLOAD = "https://mms.whatsapp.net/client/iphone/upload.php";

?from=<user>&to=<remote_jid>
URL_QUERY_STATUS = "https://sro.whatsapp.net/client/iphone/bbq.php";
?v=3&cc=<countrycode>&me=<phonenumber>&u[]=<contactnumber1>&u[]=<contactnumber2>...&bbfr=1
Note: only use bbft on first use.
URL_UPDATE_MY_STATUS = "https://s.whatsapp.net/client/iphone/u.php";
?v=1&cc=<countrycode>&me=<phonenumber>&clear=1&s=< newStatus>
Note: Only use either 'clear' or 's' paremeters, not both.
URL_OTA_INSTALL = "http://www.whatsapp.com/s40/WhatsApp.jad";
PRODUCTION_CHAT_XMPP_DOMAIN = "s.whatsapp.net";


Just sticking this here. I'm sure it will help someone whoi isn't up to date on the HTTP stuff.

tgalal 2012-02-19 11:55

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Updates:

I'm putting much dedication into this and hopefully will come out with something good soon.

I managed to compile FunXMPP.java in the decompiled version of whatsapp which greatly helped in tracing and understanding the code. I'm creating the app using python and BIG THANKS to the very informative guide posted by ColaCheater. I created the 3 functions concerned with registration (obtaining reg code from server, registering the whatsapp account, and checking account existence). That was easy to implement.

And then moving on to login, things turned out a bit complex, I rewrote the whatsapp login functions in python:

Code:

out.streamStart(connection.domain, connection.resource);  sendFeatures();
sendAuth();
in.streamStart();
String challengeData = readFeaturesAndChallenge(); sendResponse(challengeData);
readSuccess();

which is working great and I'm able to login now.

An interesting thing to point out too is that when I looked at the whatsapp logs stored on my phone (the original whatsapp and not the one I'm creating), the data appears to have been logged from python code! There are traces of Whatsapp.py, xmpp.py, chat.py and others:
Code:

00:00:05.005000 : appviews.py(1017) : chats/relative-times-update
00:00:12.663375 : chat.py(918) : chat/send-delivery-report

But there is also:
Code:

00:00:53.689500 : python_appui.cpp(807) : HandleForegroundEventL - aForeground: 0
which suggests that whatsapp for S60 3rd edition, 5th edition, Symbian^3 and Symbian Anna is written mainly in python (not Symbian C++ as many believed), and only embedded in a Symbian C++ code. This guide explains how to do that.

That's all for now, more to come soon (I hope :rolleyes: )

rash.m2k 2012-02-19 12:02

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Excellent work tgalal, I have managed too gather many whatsapp versions including blackberry, android, symbian s60, s40.

PM me if you need any of these.

Edit: Wish I had the free time to spend on this. Unfortunately I don't have that much free time.

teamer 2012-02-19 12:39

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
What version ?

rash.m2k 2012-02-19 12:42

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Quote:

Originally Posted by teamer (Post 1166892)
What version ?

I have the following versions of whatsapp the reason for this is that the latest versions are obfuscated, unlike older versions;

android/WhatsApp2.3948-cht.apk
android/com.whatsapp-2.apk
android/WhatsApp_v2.6.4401-cht.apk
android/WhatsApp_v2.6.4531-cht.apk
android/WhatsApp_Messenger_2.7.382.apk
android/WhatsApp_Messenger_2.7.950.apk
android/WhatsApp_v2.6.2200-cht.apk
android/whatsapp_Ver_2.6.6459.apk

s40/WhatsApp_2_0_7.jar
s40/WhatsApp v2.2.33(15234) S40 by DeaDKiSs.jar
s40/WhatsApp_2_3_12.jar
s40/WhatsApp_2_3_9.jar

blackberry
blackberry/WhatsApp5.0.rar
blackberry/WhatsApp47.rar
blackberry/WhatsApp46.rar
blackberry/WhatsApp45.rar
blackberry/Whatsapp-248868.rar
blackberry/WhatsApp.All.BB.krak.rar

s60/WhatsApp_S60_3_1_1_7_22.sisx
s60/WhatsApp_2_2_27.sis
s60/WhatsApp_2_0_6.sis
s60/WhatsApp_2_6_20.sis
s60/WhatsApp_2_6_22.sis
s60/WhatsApp_2_6_7 on E.sis

wp7/Whtspp_v1_1.zip
wp7/.directory
wp7/Whtspp_v1.0.1.zip

OzJD 2012-02-19 13:23

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
I've been chatting alot with tgalal alot over on Google+/Google Talk.
I'm creating a PHP client for registration with proper password support etc.

I've been using Whatsapp v2.7.3581 on Android/4.0.2 (Samsung Galaxy Nexus) as a base.
I've got decompiled Nokia & Android versions, but I'm primarily working on it based on packet sniffing (with MITM attack, as it's SSL)

Any client that I or tgalal release will support any password, as well as IMEI.

This *should* allow us to login to whatsapp with more than 1 device, at the same time (untested as yet)

johnnygdaou 2012-02-19 14:29

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Can't we have a chat only version for testing now ???
(Which means only to send text between contacts and it would be a text-only version) :)

OzJD 2012-02-19 14:51

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
There's still nothing usable, it's all dev stuff atm.

There's PHP, Java and Python code (as far as I know) between us. There's no application, yet.

ColaCheater 2012-02-19 15:17

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
@hobarrera: I understood "broadcast" so that you can send voice-messages but maybe thats my mistake :rolleyes: (I didn't use WhatsApp anytime, I just saw it on other phones so I don't exactly know what it actually offers in the clients)
Regarding the File-Transfers: You can do File-Transfers i.e. a picture by viewing it in the gallery and then using the share-option "Share via IM". It then says in my case "only aviable with Jabber Accounts" because I don't have any activated on my phone ;)
But I actually wounder rhight now why it is in english even though my phone is set to german and everything else is in german. Maybe I have an program installed that I don't know right now that enables this?


@OzJD: Why do you mean the Code you need to register isn't random? - If I'm not confused and we mean the same code you get this Code via an API-Call and when you call for it more than one time with the same number/imei you get different codes (as far as I now atm)


@tgalal: Can you verfiy that the phone-number you used to register the account is found as registered with an official WhatsApp Client?
That was a problem I had when registering the way I described: The registered Account wasn't found by an official client.
Maybe you need to be logged in to get found?
But great to see that you are now able to make a connection to the server!

rash.m2k 2012-02-19 15:26

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
The link that you provided to get the whatsapp username didn't work - not for UK anyway, I put in country code GB and my mobile number and imei and just keeps erroring.

I also tried MCC for UK (234 and 235) also didn't work.

EDIT:::::

Country code is NOT MCC but rather 44 (for UK).

phpXpert 2012-02-19 16:06

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Hi guys,

I am a new member here and found this thread while searching for WhatsApp help.

I am trying to create a client in PHP, I've got the code by de-compiling the s40 version. I also configured a sniffer by using MITM attack.

I almost understood how WhatsApp connects but I am struggling in getting PHP to connect to the xmpp server.

It would be really great if anyone can help me by giving me some code snippets or some hints.

I also can help you based on your needs as much as I can.

Thanks

johnnygdaou 2012-02-19 16:47

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Quote:

Originally Posted by OzJD (Post 1166945)
There's still nothing usable, it's all dev stuff atm.

There's PHP, Java and Python code (as far as I know) between us. There's no application, yet.

OK, what if we convert the php code to c++ code then it would work as an application on n900 ;)
or, we can run a webpage that run the code to login and chat online over any browser on any mobile phone.

Please if anyone has the php or java code, send it to me to make some tests.
my e-mail : johnnydaou@hotmail.com

johnnygdaou 2012-02-19 16:51

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Quote:

Originally Posted by rash.m2k (Post 1166954)
The link that you provided to get the whatsapp username didn't work - not for UK anyway, I put in country code GB and my mobile number and imei and just keeps erroring.

I also tried MCC for UK (234 and 235) also didn't work.


It worked for me and I got my username @s.whatsapp.net with the password.
My country code is 961.

OzJD 2012-02-19 22:39

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Quote:

Originally Posted by ColaCheater (Post 1166950)
@OzJD: Why do you mean the Code you need to register isn't random? - If I'm not confused and we mean the same code you get this Code via an API-Call and when you call for it more than one time with the same number/imei you get different codes (as far as I now atm)

Yes, the 'code' as it's referred to in the API call, is the 3 digit verification code.
Whenever I have attempted to use it, it always provides me with the same code - dependant upon number only (MNC, MCC, etc. can be changed and you still get the same code). Can you re-check for me please?

Quote:

Originally Posted by rash.m2k (Post 1166954)
Country code is NOT MCC but rather 44 (for UK).

(+)44 is correct. Did it work for you after you tried this? It will only print a password for a verified (already registered) account.


It's great to see some traction in the thread. Development is going well :-)

If anyone that's doing development is on Google+, add me on the link found on previous pages and I'll create and share a circle with all of us.

rash.m2k 2012-02-20 09:12

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Yep putting in 44 (no plus), worked for me just fine and got my whats app username and password.

I did try to wireshark the whatsapp traffic to no avail. FYI I used hostap (linux app) to setup my laptop as a wireless hotspot and connect the android phone to it.

Didn't pick up any traffic though for some reason - didn't spend much time on it though.

How are you looking at whatsapp traffic?

EDIT::: Just seen I only need a router to sniff traffic.

HSwaidan 2012-02-20 09:28

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Quote:

Originally Posted by johnnygdaou (Post 1166976)
It worked for me and I got my username @s.whatsapp.net with the password.
My country code is 961.

what is imei for iphone?
is it the same in settings-->general-->about-->IMEI?

ColaCheater 2012-02-20 10:30

Re: [WIP] Porting Whatsapp to Meego/Maemo (N9, N900)
 
Quote:

Originally Posted by OzJD (Post 1167098)
Yes, the 'code' as it's referred to in the API call, is the 3 digit verification code.
Whenever I have attempted to use it, it always provides me with the same code - dependant upon number only (MNC, MCC, etc. can be changed and you still get the same code). Can you re-check for me please?

I didn't try it by mself up to now but because of posts like this one I thought it would be random...
In the post before the linked teamer says something about that he would have the/an algorithm. Is this correct teamer?

But even when the code is calculated, wouldn't it may be better to request it from the server? Because the original client seems to do it also...


All times are GMT. The time now is 02:50.

vBulletin® Version 3.8.8