tgalal / yowsup

The WhatsApp lib
GNU General Public License v3.0
7.09k stars 2.23k forks source link

registration returns old_version for Whatsapp Version 2.12.440, bad_token for later version (2.16.2) #1534

Closed parag closed 8 years ago

parag commented 8 years ago

yowsup-cli registration --requestcode sms --phone 91xxxxxxxxxx --cc 91 --mcc 404 --mnc 60 -d DEBUG:yowsup.common.http.warequest:{'Accept': 'text/json', 'User-Agent': 'WhatsApp/2.12.440 Android/4.3 Device/Xiaomi-armani'} DEBUG:yowsup.common.http.warequest:cc=91&in=9986930005&lc=GB&lg=en&sim_mcc=404&sim_mnc=060&mcc=404&mnc=060&method=sms&mistyped=6&network_radio_type=1&simnum=1&s=&copiedrc=1&hasinrc=1&rcmatch=1&pid=5428&rchash=2c3d5ddf3b0b4ec9ef2875c26e9493f111a8f4e4ac755e9676c28e73b2604b34&anhash=de2ce769bcc6a4be1da9b06a483c28c3&extexist=1&extstate=1&token=MJKXh7iO735IIOtaUBg6jqozvQs%3D&id=%84%5C%7D%95%D6ef%7B%FD%ED%90%3D%02%D9%E5%B1%5C%1BW%17 DEBUG:yowsup.common.http.warequest:Opening connection to v.whatsapp.net DEBUG:yowsup.common.http.warequest:Sending GET request to /v2/code?cc=91&in=9986930005&lc=GB&lg=en&sim_mcc=404&sim_mnc=060&mcc=404&mnc=060&method=sms&mistyped=6&network_radio_type=1&simnum=1&s=&copiedrc=1&hasinrc=1&rcmatch=1&pid=5428&rchash=2c3d5ddf3b0b4ec9ef2875c26e9493f111a8f4e4ac755e9676c28e73b2604b34&anhash=de2ce769bcc6a4be1da9b06a483c28c3&extexist=1&extstate=1&token=MJKXh7iO735IIOtaUBg6jqozvQs%3D&id=%84%5C%7D%95%D6ef%7B%FD%ED%90%3D%02%D9%E5%B1%5C%1BW%17

INFO:yowsup.common.http.warequest:b'{"status":"fail","reason":"old_version"}\n' status: b'fail' reason: b'old_version'

On updating Android version, I get bad token

yowsup-cli registration --requestcode sms --phone 91xxxxxxxxxx --cc 91 --mcc 404 --mnc 60 -d DEBUG:yowsup.common.http.warequest:{'User-Agent': 'WhatsApp/2.16.2 Android/4.3 Device/Xiaomi-armani', 'Accept': 'text/json'} DEBUG:yowsup.common.http.warequest:cc=91&in=9986930005&lc=GB&lg=en&sim_mcc=404&sim_mnc=060&mcc=404&mnc=060&method=sms&mistyped=6&network_radio_type=1&simnum=1&s=&copiedrc=1&hasinrc=1&rcmatch=1&pid=5604&rchash=d6d53dce57a534a23657fb518d9c1af927884b094330af38c88e37b08a0b6382&anhash=1ff425b1d1827b8c21fef7b69865b6fe&extexist=1&extstate=1&token=MJKXh7iO735IIOtaUBg6jqozvQs%3D&id=t%99%7B-IL%C1%7F%8A%BE%81%14%CC%F9%F5B%3F%A0M%EA DEBUG:yowsup.common.http.warequest:Opening connection to v.whatsapp.net DEBUG:yowsup.common.http.warequest:Sending GET request to /v2/code?cc=91&in=9986930005&lc=GB&lg=en&sim_mcc=404&sim_mnc=060&mcc=404&mnc=060&method=sms&mistyped=6&network_radio_type=1&simnum=1&s=&copiedrc=1&hasinrc=1&rcmatch=1&pid=5604&rchash=d6d53dce57a534a23657fb518d9c1af927884b094330af38c88e37b08a0b6382&anhash=1ff425b1d1827b8c21fef7b69865b6fe&extexist=1&extstate=1&token=MJKXh7iO735IIOtaUBg6jqozvQs%3D&id=t%99%7B-IL%C1%7F%8A%BE%81%14%CC%F9%F5B%3F%A0M%EA INFO:yowsup.common.http.warequest:b'{"status":"fail","reason":"bad_token"}\n' status: b'fail' reason: b'bad_token'

assegaf commented 8 years ago

yes, just as predicted on https://blog.whatsapp.com/10000618/end-to-end-encryption they start to block old WA16 protocol, no more registration on 2.12.XX Version ..

ghost commented 8 years ago

@parag No problems here. And you can't just change the version by yourself, that's why you get bad_token @assegaf Stop causing panic, WA16 will continue to work for a long time

parag commented 8 years ago

Got it @0xTryCatch . Was confused how to generate signature / md5 class and key. Is that all necessary to upgrade (and test) for version change?

ghost commented 8 years ago

Yes

wkurosawa commented 8 years ago

@parag Were you able to register? I'm also having old_version problem, whether using master or wa16/develop branches..

parag commented 8 years ago

@wkurosawa Not yet. Not able to figure out how to generate signatures.

coxsy1 commented 8 years ago

well.. it's happened to me... :V

biji commented 8 years ago

Work for me by updating env like this: https://github.com/mgp25/Chat-API/commit/e3f994059ab466fee6732e99b826de4733c3e9b5

coxsy1 commented 8 years ago

yeaa.. work for me too... thanks Mr. @biji

On Thu, Apr 21, 2016 at 3:02 PM, biji notifications@github.com wrote:

Work for me by updating env like this: mgp25/Chat-API@e3f9940 https://github.com/mgp25/Chat-API/commit/e3f994059ab466fee6732e99b826de4733c3e9b5

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/tgalal/yowsup/issues/1534#issuecomment-212794763

assegaf commented 8 years ago

thanks biji and trycatch, work like a charm ...

r00t4bl3 commented 8 years ago

Finally, this fix "old_version" problem. Thank you guys...

jlguardi commented 8 years ago

Old-version issue fixed in latest master.

guileh commented 8 years ago

I'm getting -> fail -> bad_token

guileh commented 8 years ago

I changed the token in src/token.php now it's getting ->fail -> missing_param -> token! :(

tgalal commented 8 years ago

@guileh token.php ? are you lost ?

guileh commented 8 years ago

I was! :+1:

ibgithub commented 8 years ago

I got bad token right now, please help me

ibgithub commented 8 years ago

I already solved, update in file env_s40.py

_TOKEN_STRING = "PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk1471306425030{phone}"

makovez commented 7 years ago

how can i get the token? i read this

PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk its a constant, never changes. $timestamp it's the release time of the app, it's inside the app. Changes in every version. $phone, your number + country code.

with the constant+timestamp+phone i can generate the token? how can i get the timestamp?

narasimha6666 commented 7 years ago

How to generate signature / md5 class and key with latest version

JavierPech commented 7 years ago

Im getting the bad token error. I updated the WHATSAPP_USER_AGENT & WHATSAPP_VER variables to 2.17.223 in constatns php and now i get the bad token error. Please help. PS I've download the latest version of the Chat-Api

gittempo commented 7 years ago

@JavierPech did you manage to fix the bad_token issue?

What should be token for version 2.17.351

in token.php

  $classesMd5 = 'ry9Xz6kVioQctwA3G9z62Q=='; // 2.12.556
vinayakvasu commented 7 years ago

$classesMd5 = 'o17G0Imoh/pOmI5FpLpKHQ=='; // 2.17.420

auyanik commented 6 years ago

$classesMd5 ='????? '; // 2.18.8

help plss

azamalvi commented 6 years ago

For latest version you need to change in composer.json file like this "require": { "whatsapp/chat-api": "dev-master" } After updating composer, you need to change the Constants like below

Constants.php const WHATSAPP_VER = '2.18.8'; const WHATSAPP_USER_AGENT = 'WhatsApp/2.18.8 Android/4.3 Device/Xiaomi-HM_1SW';

token.php $classesMd5 = 'CjxZj9h0ptjV2RRSfH9aYA==';

Hope this will fix problem 🥇