Git Product home page Git Product logo

Comments (10)

stvnwrgs avatar stvnwrgs commented on August 26, 2024

I have the same Problem in the PHP Version with my Login. After 30 Seconds the limit is exceeded. Also removing UTF-8 from the auth function is not working.

from whatsapi.

assegaf avatar assegaf commented on August 26, 2024

so any log whats happening in background, I use android version of whatsapp when register.
I see login is successfull, but after it cause long delay,

352308622 -> account_info

account_info

Array
(
[status] => active
[kind] => free
[creation] => 1305220622
[expiration] => 1352308622
)

after sending this command : end next ?t??a?
Ahmed Mohd?HC?:??{?M??Ua$HC?2?:??????

and long delay is wait for read sock command.

how about you ?

from whatsapi.

cdesjardins avatar cdesjardins commented on August 26, 2024

The issue is that the login code as is had areas with 2 reads in a row, they are just blindly reading from the socket, but there might not be any data on that socket (for example all of the data may have been read on the first read), and when that happens the socket blocks. I agree this area should be improved.

from whatsapi.

assegaf avatar assegaf commented on August 26, 2024

thanks cdesjardins , I see this last command cause long delay

$next = "\x00\x12\xf8\x05\x74\xa2\xa3\x61\xfc\x0a\x41\x68\x6d\x65\x64\x20\x4d\x6f\x68\x64\x00\x15\xf8\x06\x48\x43\x05\xa2\x3a\xf8\x01\xf8\x04\x7b\xbd\x4d\xf8\x01\xf8\x03\x55\x61\x24\x00\x12\xf8\x08\x48\x43\xfc\x01\x32\xa2\x3a\xa0\x8a\xf8\x01\xf8\x03\x1f\xbd\xb1";
$stream = $this->send($next);
$this->read(); // LONG DELAY is this Command

I dont know what is that command in hex used to ? any idea ?

from whatsapi.

assegaf avatar assegaf commented on August 26, 2024

dear cdesjardins, I see now your explanation, there is 2 read in a row means, when I remove one, looks like delay gone.
When I remove thoose line, so last line in Login() method is :$rBuffer =$this->read();

but when I send msg $wa->Message(time()."-1","62214421XXXX","test message");
I got

�t8��+���

]8���Server�C�15567���
1345005817�������New version of WhatsApp Messenger is now available. Please visit http://www.whatsapp.com/appstore/ and upgrade to the latest version. Your upgrade will be free and will bring bug fixes and new features such as Group Icons!

at first read, I dont know, I tought its Android, why is appstore ?

from whatsapi.

cdesjardins avatar cdesjardins commented on August 26, 2024

The reason it redirects you to the app store is because the php code logs in to WhatsApp as an iPhone-2.6.9. Furthermore be aware that just removing one of those reads might not always work either. This area of the code is not really well done... Typically this type of thing is done with a "read" thread that pulls data off the wire and queues it locally for the main thread to manipulate. In this case you would want to check the local queue for the expected responses, and if they do not arrive after some short but reasonable timeout then an error should be produced... But of course that is a big pain in the neck...

from whatsapi.

assegaf avatar assegaf commented on August 26, 2024

ok I see when "read" thread that pulls data (wait so long), I send message to that whatsapp account, they indeed receive data and print it as "message", which means receive message working. but I dont know how send work, I ve changed the
iPhone-2.6.9 to Android-2.34-5222 which has the same length string,

I see this code messed up, maybe I want to port it to java socket programming, maybe if I have time.

from whatsapi.

xTraXx avatar xTraXx commented on August 26, 2024

You can change iPhone-2.6.9-5222 to iPhone-2.8.2-5222.

from whatsapi.

assegaf avatar assegaf commented on August 26, 2024

finally, this solution from dsfgdsfg fix long delay at login. but still send message fail, I will find out why

--- >

Well I would agree with you if I would not get the account_info message with [status] => active and [kind] => free.

Here is my code which replaces lines 204-206 in whatsapp.v2.php:
$authData=base64_encode($ResData);
$authLen=strlen($authData);
$wholeLen=$authLen+9;
$wholeLen=chr($wholeLen>>8).chr($wholeLen&0xff);
$authLen=chr($authLen>>8).chr($authLen&0xff);
$Response = $wholeLen."\xf8\x04\x86\xbd\xa7\xfd\x00".$authLen.$authData;
$this->send($Response);

from whatsapi.

assegaf avatar assegaf commented on August 26, 2024

hi, looks like long login delay is fixed, see my other comment. but still cant send message, read can receive message.
I closed this issue, message me if there is person also has this issue.

from whatsapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.