The last few months I've been trying to modify the Nokia S40 version of WhatsApp 2.2.3 to make it work on the Samsung Wave S8500, but since it took too much time and I got stuck again I'm now discontinuing the project. But because it took me quite some time and perhaps someone else interested may find the findings useful I decided to share my findings here.
Please note that the project currently does not do much, you may get it as far as sending a registration sms, but you won't be able to use it to come as far as doing something usefull.
Also note that newer versions of WhatsApp are not
Some of you may have already tried downloading the S40 jar file (www[dot]whatsapp[dot]com/s40/WhatsApp_2_2_3.jar) and installing it on the wave, which runs (the foreground app) but gets stuck after entering your phone number.
Main reasons that this happens are that the java project imports nokia specific libraries and that the whatsapp server uses a bigdaddy certificate and appearantly a lot of javame devices (including the wave) only accept verisign certificates for https connections. Also it attempts to make connections to the nokia specific localmsg:// protocol, used to request contact data (localmsg: //contacts) or send messages between the foreground and background app for example (localmsg: //whatsapp).
My attempt to solve these issues is decompiling the whatsapp jar to see what the nokia specific libraries do, and try to make my own version of them mimicing their behaviour.
On top of that I tried redirecting the https connections to a localhost-http connection, which then connects to the whatsapp server and sends the response back to the app unencrypted. Which is not a good solution due to the lack of encryption, but I couldn't find a better one, so for testing this was the only solution currently.
Also some changes were made to make the foreground app and the background app one piece as the wave won't allow you to run 2 java apps from the same .jar file twice. And there are changes made to allow the app to read IMEI values and stuff on non-nokia devices.
If someone is interested in checking out the project here are the instructions to get things running:
First install netbeans and import the project.
The resources folder will not link to the good folder, so you need to relink that to the resources folder from the zip-package.
To try and get the https connections working over a http 'proxy' you need to configure a web server too, and let it run the supplied .php file.
To link the whatsapp project to the webserver you need to run ipconfig to see your local ip (probably 192.168.0.x) and change the source files (search for HttpsConnection and change "https://..." to "h t t p : / / 192.168.0.x/proxy.php?https://...". On the Wave device make sure your device accesses your router via wifi and that it can access your webserver.
To test in the emulator you need to first get the registration sms on the wave and then change the IMEI function in the source so it returns the IMEI from your mobile (check *#06#) and the CSC function (depends on provider and stuff)
If you need to decompile other files from the original WhatsApp jar, you can try using jd gui or DJ Java Decompiler or probably a combination of them, as both don't fully decompile correctly. Don't forget to remove the same file(s) from the resources package, as the class file from the resources will be used over the your file, which can be very confusing at times.
In my current progress I'm currently stuck because I can't get to retrieve the PIM contacts (using dummy contacts instead) and when using POST on the bbq.php site a connection seems to get disconnected after sending the first data part which should have stayed alive. May be a fault of the proxy.php, but not sure.
For anyone interested, good luck.
If you have further questions, feel free to ask them in this topic, I will occasionally see if I can answer some.
You do not have the required permissions to view the files attached to this post.