[Java] Project for S40 port of WhatsApp

The Developement Section is for programmers and developers to discuss/trubleshoot their latest projects.

[Java] Project for S40 port of WhatsApp

Postby Whappie01 » Thu Jan 05, 2012 9:09 am

Hey there,

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.


User avatar
Whappie01
Bada Noob
Bada Noob
 
Topic Starter
Posts: 1
Joined: Thu Jan 05, 2012 8:43 am
Thanks given: 0
Thanks received: 0

Re: [Java] Project for S40 port of WhatsApp

Postby Jannie » Wed Feb 08, 2012 11:30 am

Will this work on Nokia s40 devices that aren't officially supported
User avatar
Jannie
Bada Noob
Bada Noob
 
Posts: 3
Joined: Wed Feb 08, 2012 11:19 am
Thanks given: 0
Thanks received: 0

Re: [Java] Project for S40 port of WhatsApp

Postby adi4u4882 » Wed Feb 08, 2012 11:35 am

Jannie wrote:Will this work on Nokia s40 devices that aren't officially supported

For that you can unofficialy download that app for your Nokia and then install it.
Image
:D Hit The Thanks Button If I Had Helped You! :D
Follow me on Twitter @Adi4u4882
User avatar
adi4u4882
Moderator
Top Poster
Top Poster
 
Posts: 1337
Joined: Thu Oct 07, 2010 2:55 pm
Location: Chennai,India
Thanks given: 86 times
Thanks received: 231 times

Re: [Java] Project for S40 port of WhatsApp

Postby Jannie » Thu Feb 09, 2012 12:02 am

adi4u4882 wrote:
Jannie wrote:Will this work on Nokia s40 devices that aren't officially supported

For that you can unofficialy download that app for your Nokia and then install it.


That doesn't work it just says invalid application or if I modify the .MF I get permission errors.
User avatar
Jannie
Bada Noob
Bada Noob
 
Posts: 3
Joined: Wed Feb 08, 2012 11:19 am
Thanks given: 0
Thanks received: 0

Re: [Java] Project for S40 port of WhatsApp

Postby Jannie » Thu Feb 09, 2012 12:06 am

If I try running this app on the S40 device I get either this errors: "WhatsAppProject\WhatsApp\dist\ but they give this error: java/lang/IllegalAccessError: Cannot access class com/nokia/mid/s40/bg/BGUtils from class hello/HelloMIDlet" and the BG one a very simmilar one. If I try the FG one it complains about invalid app or something.
User avatar
Jannie
Bada Noob
Bada Noob
 
Posts: 3
Joined: Wed Feb 08, 2012 11:19 am
Thanks given: 0
Thanks received: 0


Return to Bada Development

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests