venomous0x / WhatsAPI

Interface to WhatsApp Messenger
2.59k stars 2.14k forks source link

small java app (question) #806

Open cheetah1337 opened 10 years ago

cheetah1337 commented 10 years ago

I am creating a small java application where I just want to send messages to my phone. I have a few questions: What's the difference between the device identity token and a whatsapp password such as Ao6I**_JGZ+TeSc_**FmfAs=

What is the most minimal steps to log in and send a message? I want to make this lightweight and want to cut down on steps that I won't be using.

I'm a semi-beginner programmer and not very familiar with PHP yet. Thanks!

mgp25 commented 10 years ago

@cheetah1337 identity is only relevant during registration, once you are registered, you no longer need the identity. The password is what you use to authenticate and connect to WhatsApp with your username.

You can see de basic steps in /test/whatsapp.php

cheetah1337 commented 10 years ago

So from what I gathered, I would just need to open a socket to connect with whatsapp, start a stream with whatsapp, send the features and authentication through the protocolnode which hashes it. Read the response from whatsapp to see if I logged in correctly, then send a message.

I was looking at this repo https://github.com/jhbruhn/WhatsUp and it seems to have a lot of ground work in place which I would like to use, but I think the authentication has changed since then since I haven't been able to get it to work.

Another question: In the whatsprot.class.php -> loginwithpassword($password), what is challenge data? There is no comment for it in the property declarations.

mgp25 commented 10 years ago

@cheetah1337 is just a problem the server sends to client and when its resolved send it to the server.