Open ghost opened 11 years ago
I believe WhatsApp crew did some changes. Try doing
php whatsapp.php -l
Should be giving you a timeout error (socket_read()) as of the latest version of this script source. My guess is they changed their network configs, such as IPs, and possibly port, which is why we can't grab any data when trying to listen or send messages.
This is what I get when I do
php whatsapp.php -s MyNumberHere "Text Here"
[] Logging in as 'WhatsAPI Test' (TargetNumber)
tx stream:features
tx
tx
rx
rx stream:features
rx
¦!úÅ!Ç«GàƒËýÅ:ietf:params:xml:ns:xmpp-sasl"> ☼L└P¼
tx
rx
tx
tx
[] Request last seen MyNumberHere:
tx
[] Send message to MyNumberHere: Text Here
tx
And no messages ever get sent to my phone. My guess is the configs are wrong in the current version of this script.
No, i don't think the IP addresses and Port were changed because i'm still able to change my status successfully, the only issue seems to be with the receiving and sending of messages. They must've changed their encryption protocol or something.
Then what about listening mode ? Unable to read and/or write with the sockets.... But yeah, looks like protocol.
I started using
$wa->Message( target, "text") instead of $wa->Message( time() . "-1", target, "text") and it works sometimes. Need to refresh the php document a few times sometimes but it does work, for now.
I did not check out the listening mode. I wrote my own code looking at the example. In my code the message function is already modified. So it's fine. Something else seems to be going wrong :(
A few days ago the $wa->Message( target, "text"); was working properly (Removing the time(). "-1", part). Now, it just displays the message as a notification on your phone, but does not actually send a message to the target. It just displays the notification.
Seems like to me the protocol is just going worse and worse..
password method is changed ,so if your mobile is updated with new version of whatsapp,msgs wont go
I'm able to login using my android phone's credentials, but when i try to send a message to my friend whose using an iPhone, he is not receiving any messages.
My code :
!/usr/bin/php
<?php require "../src/php/whatsprot.class.php"; function fgets_u($pStdn) { $pArr = array($pStdn);
}
$nickname = "WhatsAPI Test"; $sender = "91974***"; // Mobile number with country code (but without + or 00) $imei = "My IMEI number here"; // MAC Address for iOS IMEI for other platform (Android/etc)
$countrycode = substr($sender, 0, 2); $phonenumber=substr($sender, 2); echo "[] Logging in as '$nickname' ($sender)\n"; $wa = new WhatsProt($sender, $imei, $nickname, true);
$url = "https://r.whatsapp.net/v1/exist.php?cc=".$countrycode."&in=".$phonenumber."&udid=".$wa->encryptPassword(); $content = file_get_contents($url); if(stristr($content,'status="ok"') === false){ echo "Wrong Password\n"; exit(0); } $wa->Connect(); $wa->Login();
$dst = "9199****"; $msg = "Whatsup bro"; echo "\n[] Send message to $dst: $msg\n"; $wa->Message(time()."-1", $dst , $msg);
The output i see is....
!/usr/bin/php [] Logging in as 'WhatsAPI Test' (91974**1) tx tx tx tx rx rx rx rx rx û° ¿m.a¦x¦m9T½è`º,tg tx a®÷3g‹È±K¨èLÓ”™Ã}»Ñõzuð ZŒ´‰·Ý©â?ÊGÊKa rx MWùõ“ìnZO’m¿2¾sÙfO$ tx tx [] Send message to 9199****_: Whatsup bro tx tx tx tx tx tx tx 9199_***\ tx