Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated MD files, got rid of unused file.

  • Loading branch information...
commit 087cd743737a36f1c94df6497b5a1e0acf12c3a4 1 parent dc121e4
@hubail hubail authored
Showing with 19 additions and 54 deletions.
  1. +5 −0 CHANGELOG.md
  2. +14 −12 README.md
  3. +0 −42 src/php/server.php
View
5 CHANGELOG.md
@@ -0,0 +1,5 @@
+**Recent Changes**
+
+- Added image sending support
+- Added iOS password support
+- Fixed special characters support
View
26 README.md
@@ -1,3 +1,5 @@
+For recent changes, refer to the [Change Log](https://github.com/venomous0x/WhatsAPI/blob/master/CHANGELOG.md)
+
# WhatsAPI
Interface to WhatsApp Messenger
@@ -8,7 +10,7 @@ Interface to WhatsApp Messenger
### What is WhatsApp?
According to [the company](http://www.whatsapp.com/):
-> “WhatsApp Messenger is a cross-platform mobile messenger that replaces SMS and works through the existing internet data plan of your device. WhatsApp is available for iPhone, BlackBerry, Android, Windows Phone, Nokia Symbian60 & S40 phones. Because WhatsApp Messenger uses the same internet data plan that you use for email and web browsing, there is no cost to message and stay in touch with your friends.”
+> “WhatsApp Messenger is a cross-platform mobile messenger that replaces SMS and works through the existing internet data plan of your device. WhatsApp is available for iPhone, BlackBerry, Android, Windows Phone, Nokia Symbian60 & S40 phones. Because WhatsApp Messenger uses the same internet data plan that you use for email and web browsing, there is no cost to message and stay in touch with your friends.”
Late 2011 numbers: 1 billion messages per day, ~20 million users.
@@ -16,15 +18,15 @@ Late 2011 numbers: 1 billion messages per day, ~20 million users.
WhatsApp uses some sort of customized XMPP server, named internally as FunXMPP, which is basically some extended proprietary version.
### Login procedure
-Much like XMPP, WhatsApp uses JID (jabber id) and password to successfully login to the service. The password is hashed and happened to be an MD5’d, reversed-version of the mobile’s IMEI (International Mobile Equipment Identity) or equivalent unique ID, stored in servers upon account creation and used transparently everytime the client connects the server.
+Much like XMPP, WhatsApp uses JID (jabber id) and password to successfully login to the service. The password is hashed and happened to be an MD5’d, reversed-version of the mobile’s IMEI (International Mobile Equipment Identity) or equivalent unique ID, stored in servers upon account creation and used transparently everytime the client connects the server.
-The JID is a concatenation between your country’s code and mobile number.
+The JID is a concatenation between your country’s code and mobile number.
Initial login uses Digest Access Authentication.
### Message sending
-Messages are basically sent as TCP packets, following WhatsApp’s own format (unlike what’s defined in XMPP RFCs).
+Messages are basically sent as TCP packets, following WhatsApp’s own format (unlike what’s defined in XMPP RFCs).
Despite the usage of SSL-like communication, messages are being sent in plain-text format.
@@ -35,25 +37,25 @@ Photos, Videos and Audio files shared with WhatsApp contacts are HTTP-uploaded t
# FAQ
-- **What’s with the hex chars floating all over the code?**
+- **What’s with the hex chars floating all over the code?**
- Mostly WhatsApp’s proprietary control chars/commands, or formatted data according to their server’s specifications, stored in predefined dictionaries within the clients.
+ Mostly WhatsApp’s proprietary control chars/commands, or formatted data according to their server’s specifications, stored in predefined dictionaries within the clients.
-- **What’s your future development plans?**
+- **What’s your future development plans?**
- We don’t have any.
+ We don’t have any.
- **Would it run over the web?**
- We’ve tested a slightly-modified version on top of Tornado Web Server and worked like a charm, however, building a chat client is a bit tricky, do your research.
+ We’ve tested a slightly-modified version on top of Tornado Web Server and worked like a charm, however, building a chat client is a bit tricky, do your research.
- **Can I receive chats?**
- Indeed, using the same socket-receiving mechanism. But you have to parse the incoming data. Parsing functions aren’t included in this release, maybe in the next one?
+ Indeed, using the same socket-receiving mechanism. But you have to parse the incoming data. Parsing functions aren’t included in this release, maybe in the next one?
- **I think the code is messy.**
- It’s working.
+ It’s working.
- **How can I obtain my password?**
@@ -72,7 +74,7 @@ With the sufficent permissions of course
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
```
-on iOS however the password is the MD5 hash the mac address repeated twice
+On iOS however the password is the MD5 hash of the MAC address repeated twice
thanks to http://www.ezioamodio.it/?p=29
# NOTES
View
42 src/php/server.php
@@ -1,42 +0,0 @@
-<?php
-
-header("Access-Control-Allow-Origin: *");
-header("Access-Control-Allow-Methods: *");
-include("whatsapp.class.php");
-
-
-$api = new API($_POST['id'], $_POST['action'], $_POST['nickname']);
-
-class API{
-
- private $_id;
- private $_wa;
- private $_nickname;
-
- function API($id, $action, $nickname){
- $this->_id = $id;
- $this->_id['udid'] = md5(strrev($this->_id['imei']));
- $this->_nickname = (strlen($nickname)>0) ? $nickname : "Unknown";
- $this->_wa = new WhatsApp($this->_id['cc'].$this->_id['pn'], $this->_id['udid'], $this->_nickname);
- $this->_wa->Connect();
- $this->_wa->Login();
- $this->_run($action);
- }
-
- private function _run($action){
- if(method_exists($this->_wa, $action['method'])){
- $pstr = "";
- if(count($action['params'])){
- foreach($action['params'] as $param)$pstr.="\"".$param."\", ";
- $pstr = substr($pstr, 0, -2);
- }
- eval("\$this->_wa->".$action['method']."(".$pstr.");");
- }else $this->_err("INEXISTENT METHOD");
- }
-
- private function _err($msg){
- echo "ERROR: ".$msg;
- }
-
-}
-
Please sign in to comment.
Something went wrong with that request. Please try again.