venomous0x / WhatsAPI

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

Sorry the password was invalid. Please try again. #764

Open marwanin opened 10 years ago

marwanin commented 10 years ago

Hello gurus, I am newbie, i spent all day dealing with whatsapi and everything is okay, i received the dash password, but when login it, it gives me always: Sorry the password was invalid. Please try again.

I changed password many times using the WART exe; and it never logins.. same error

help please..

mgp25 commented 10 years ago

@marwanin could you post the script you are using? Without your data (phone number, identity and password). Also post the debug.

marwanin commented 10 years ago

@mgp25 thank you very much for helping.. this is the script:

!/usr/bin/php

<?php require '../src/php/whatsprot.class.php';

function fgets_u($pStdn) { $pArr = array($pStdn);

if (false === ($num_changed_streams = stream_select($pArr, $write = NULL, $except = NULL, 0))) {
    print("\$ 001 Socket Error : UNABLE TO WATCH STDIN.\n");

    return FALSE;
} elseif ($num_changed_streams > 0) {
    return trim(fgets($pStdn, 1024));
}
return null;

}

$nickname = "WhatsAPI Guuruu"; $sender = "00000000"; // Mobile number with country code (but without + or 00) $imei = "00000000"; // MAC Address for iOS IMEI for other platform (Android/etc) $password = "a9jOSjbbdbgxxUYx4TJSo3COw3e8="; // Password you received from WhatsApp

if ($argc < 2) { echo "USAGE: ".$_SERVER['argv'][0]." [-l] [-s ] [-i ] [-set ]\n"; echo "\tphone: full number including country code, without '+' or '00'\n"; echo "\t-s: send message\n"; echo "\t-l: listen for new messages\n"; echo "\t-i: interactive conversation with \n"; echo "\t-set: Set Status to \n"; exit(1); }

$dst=$_SERVER['argv'][2]; $msg = ""; for ($i=3; $i<$argc; $i++) { $msg .= $_SERVER['argv'][$i]." "; }

echo "[] Logging in as '$nickname' ($sender)\n"; $wa = new WhatsProt($sender, $imei, $nickname, TRUE);

$wa->connect(); $wa->loginWithPassword($password);

if ($_SERVER['argv'][1] == "-i") { echo "\n[] Interactive conversation with $dst:\n"; stream_set_timeout(STDIN,1); while (TRUE) { $wa->pollMessages(); $buff = $wa->getMessages(); if (!empty($buff)) { print_r($buff); } $line = fgets_u(STDIN); if ($line != "") { if (strrchr($line, " ")) { // needs PHP >= 5.3.0 $command = trim(strstr($line, ' ', TRUE)); } else { $command = $line; } switch ($command) { case "/query": $dst = trim(strstr($line, ' ', FALSE)); echo "[] Interactive conversation with $dst:\n"; break; case "/lastseen": echo "[] Request last seen $dst: "; $wa->sendGetRequestLastSeen($dst); break; default: echo "[] Send message to $dst: $line\n"; $wa->sendMessage($dst , $line); break; } } } exit(0); }

if ($_SERVER['argv'][1] == "-l") { echo "\n[] Listen mode:\n"; while (TRUE) { $wa->pollMessages(); $data = $wa->getMessages(); if(!empty($data)) print_r($data); sleep(1); } exit(0); }

if ($_SERVER['argv'][1] == "-set") { echo "\n[] Setting status:\n"; $wa->sendStatusUpdate($_SERVER['argv'][2]); exit(0); }

echo "\n[] Request last seen $dst: "; $wa->sendGetRequestLastSeen($dst);

echo "\n[] Send message to $dst: $msg\n"; $wa->sendMessage($dst , $msg); echo "\n";

?>

mgp25 commented 10 years ago

@marwanin Oks, you are using whatsapp.php. Please edit your comment and delete your password.

Try this:

php whatsapp.php -s targetNumber Message

Target number with country code. If it doesnt work, post the output from the terminal/shell (debug) so we can see where is the problem.

marwanin commented 10 years ago

@mgp25 I did php whatsapp.php -s XXXXXXXXXXXXX Message and hit enter, and Putty just closed.. nothing appeared

mgp25 commented 10 years ago

@marwanin when i get home i will explain you everything and a basic guide.

If you want to do something until i get home, install php in your computer if you want to use with the command line, of course you can run scripts in webserver too. Later i will tell you

marwanin commented 10 years ago

@mgp25 thank you so much, please add me on skype when you get home: skype id: marwanin

mgp25 commented 10 years ago

Problem solved. @marwanin was talking about whatsapp.php file of the /src folder. When you try to access, it asks you for a password (not WhatsApp Password).

login

In the line 36 of whatsapp.php, you will find the password to access, you can change it.

$config['webpassword'] = 'MakeUpPassword';