tgalal / yowsup

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

Facing Old_Version Error While Registering #2960

Open Johnprogg opened 4 years ago

Johnprogg commented 4 years ago

Please Any Genius Could Slove this Error Please, I am facing this error while Registering

W 2020-04-01 12:51:58,419 yowsup.common.http.warequest - Passing Config to WARequest is deprecated, pass a YowProfile instead
I 2020-04-01 12:51:58,633 yowsup.common.http.warequest - {"login":"1XXXXXXXX","status":"fail","reason":"old_version"}

status: fail
reason: old_version
login: 1XXXXXXXX
artemrootman commented 4 years ago

same error

I 2020-04-01 18:49:43,223 yowsup.common.http.warequest - b'{"login":"....","status":"fail","reason":"old_version"}\n'
status: b'fail'
reason: b'old_version'
login: b'...'
adrijanb commented 4 years ago

Same issue here. Trying to register a new number on a complete new setup ubuntu distro.

W 2020-04-01 22:50:09,255 yowsup.common.http.warequest - Passing Config to WARequest is deprecated, pass a YowProfile instead I 2020-04-01 22:50:09,395 yowsup.common.http.warequest - b'{"login":"number","status":"fail","reason":"old_version"}\n' status: b'fail' reason: b'old_version'

Johnprogg commented 4 years ago

@adrijanb Hey Have You Tried Registering WhatsApp from the Different mobile phone and then using Yowsup on it ? @konstantah It's solved for you ?

modcastro commented 4 years ago
  1. Download com.whatsapp.apk (for example with https://github.com/matlink/gplaycli)
  2. gplaycli -d com.whatsapp
  3. Calculate version and MD5 with https://gist.github.com/masbog/d29c779539581defbf542e70ce724ed8
  4. Install https://github.com/mikusjelly/axmlparser
  5. python3 dexMD5.py com.whatsapp.apk
  6. Replace the appropriate values (_MD5_CLASSES and _VERSION)

New Version:

--> WhatsApp Version : 2.20.108 --> WhatsApp ClassesDEX MD5 : aIiTbnlq1G2jxLKYgZI5Xw==

Working here... Maybe it would be nice to have these steps on the Wiki @tgalal

Johnprogg commented 4 years ago

Thank You So Much @modcastro For Answering You have Helped Us All, Does have you Registered Any New Number Today or Yesterday, Does you are able to register does its working ?

artemrootman commented 4 years ago

@modcastro thx, bro!

Johnprogg commented 4 years ago

Its working for you @konstantah now ?

Johnprogg commented 4 years ago

Hey @modcastro It worked after updating version and md5, But getting this error while verifying the OTP, Please Help Sir!

"sim_mcc": "000", "sim_mnc": "000" } status: fail retry_after: 3600 login: 1743032405

artemrootman commented 4 years ago

@Johnprogg yes, it works!

Johnprogg commented 4 years ago

@konstantah For Me it is Through Error "Temporarily_Unavailable" Status: Fail after entering OTP 😞

artemrootman commented 4 years ago

requestcode:

I 2020-04-02 11:54:37,138 yowsup.common.http.warequest - b'{"login":".....","notify_after":86400,"status":"sent","length":6,"method":"sms","retry_after":65,"sms_wait":65,"voice_wait":65,"flash_type":0}\n'                           
status: b'sent'                                                                                                                                                                                                                               
length: 6                                                                                                                                                                                                                                     
method: b'sms'                                                                                                                                                                                                                                
retry_after: 65                                                                                                                                                                                                                               
login: b'.....'                                                                                                                                                                                                                        
sms_wait: 65                                                                                                                                                                                                                                  
voice_wait: 65  

register:

I 2020-04-02 11:55:18,413 yowsup.common.http.warequest - b'{"status":"ok","login":"......","type":"new","edge_routing_info":"CAgIBQ==","security_code_set":false}\n'

Johnprogg commented 4 years ago

@konstantah Have you done any DEVICE_ Changes As well ?

or Just Run the Yowsup Base code?

modcastro commented 4 years ago

@Johnprogg Yes, 3 new already executed normally.

Temporarily_Unavailable it's not a version problem. Is IP ban...

Johnprogg commented 4 years ago

@konstantah and @modcastro which command mcc and mnc are you using to register and to verify code, can you please tell the commands that you are using for register and verification are you running Yowsup in Amazon AWS, Digital Ocean Virtual Server or where you are running it ? I am using

yowsup-cli registration --requestcode sms --phone 1854166 --cc 1 --mcc 405 --mnc 53
yowsup-cli registration --register 966-023 --phone 1854166 --cc 1
MaideyHamadama commented 4 years ago

Don't really get the solution, is your method going consist in adding the whatsapp application into the pc? @modcastro

yuryja commented 3 years ago

@modcastro, hi. I followed your instructions commented on 12 Apr: --> WhatsApp Version : 2.20.205.13 --> WhatsApp ClassesDEX MD5 : b'IzjOlfsfaVtVx8YYioQl3g==' but same results:

status: fail reason: old_version

DannyWongSz commented 3 years ago

[root@nagios tmp]# python3 dexMD5.py com.whatsapp.apk --> WhatsApp Version : 2.21.2.18 --> WhatsApp ClassesDEX MD5 : b'cUogV1tgLZAC+/6c5Vd0jQ=='

Still the same this is the info for the latest Whatsapp release and also said:

W 2021-02-04 15:46:11,610 yowsup.common.http.warequest - Passing Config to WARequest is deprecated, pass a YowProfile instead W 2021-02-04 15:46:11,623 yowsup.common.http.warequest - Passing Config to WARequest is deprecated, pass a YowProfile instead I 2021-02-04 15:39:28,985 yowsup.common.http.warequest - {"login":"506****","status":"fail","reason":"old_version"}

status: fail reason: old_version login: 506****

ben221199 commented 3 years ago

https://github.com/ben221199/WAPI/blob/java/src/main/java/nl/ben221199/wapi/RegisterMain.java

Minimal required parameters in exist:

Minimal required parameters in code:

The parameters that could be responsible for giving an old_version exception are id and token:

fabiom91 commented 3 years ago
  1. Download com.whatsapp.apk (for example with https://github.com/matlink/gplaycli)
  2. gplaycli -d com.whatsapp
  3. Calculate version and MD5 with https://gist.github.com/masbog/d29c779539581defbf542e70ce724ed8
  4. Install https://github.com/mikusjelly/axmlparser
  5. python3 dexMD5.py com.whatsapp.apk
  6. Replace the appropriate values (_MD5_CLASSES and _VERSION)

New Version:

--> WhatsApp Version : 2.20.108 --> WhatsApp ClassesDEX MD5 : aIiTbnlq1G2jxLKYgZI5Xw==

Working here... Maybe it would be nice to have these steps on the Wiki @tgalal

Can you explain it better?

Ultrakommandant commented 3 years ago

W 2021-07-31 04:48:37,381 yowsup.common.http.warequest - Passing Config to WARequest is deprecated, pass a YowProfile instead I 2021-07-31 04:48:37,804 yowsup.common.http.warequest - b'{"login":"**","status":"fail","reason":"old_version"}\n' status: b'fail' reason: b'old_version' login: b'**'

Does not work, new phone number, never used Whatsapp there.

mhmh55516 commented 2 years ago

Run to get WhatsApp Version and WhatsApp ClassesDEX MD5


# tweak up from https://github.com/mgp25/classesMD5-64/blob/master/dexMD5.py
# to use this $ python3 dexMD5.py apk/WhatsApp.apk
# Output : 
# WhatsApp Version : 2.17.296
# WhatsApp ClassesDEX MD5 : b'YrJNPljM3TuNFPIOZ+jziw=='

import sys
import zipfile
import hashlib
import base64
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
import os
from xml.dom import minidom
try:
  from axmlparser import AXML
except:
  os.system("pip install git+https://github.com/kin9-0rz/axmlparser")
try:
  from bs4 import BeautifulSoup
except:
  os.system("pip install bs4")

try:
    os.remove("whatsapp.apk")
except OSError:
    pass
url = "https://www.cdn.whatsapp.net/android/"
response = requests.request("GET", url, verify=False)
soup = BeautifulSoup(response.text, "html.parser")
apk_url = soup.find_all('a', href=True)

for get_url in apk_url:
  if get_url['href'].find("WhatsApp.apk")!=-1:
    download_url = get_url['href']
    break

print("URL download for APK : "+ download_url)
os.system(f"wget '{download_url}' -O whatsapp.apk")
apkName = "whatsapp.apk"
zipFile = zipfile.ZipFile(apkName,'r')
hash = hashlib.md5()
hash.update(zipFile.read('classes.dex'))
axml = AXML(zipFile.read('AndroidManifest.xml'))
xml = minidom.parseString(axml.get_buff())
package = xml.documentElement.getAttribute("package")
print("--> WhatsApp Version : "+xml.documentElement.getAttributeNS('http://schemas.android.com/apk/res/android', "versionName"))
print("--> WhatsApp ClassesDEX MD5 : "+ str(base64.b64encode(hash.digest())));
try:
    os.remove("whatsapp.apk")
except OSError:
    pass```
jpmendezf commented 2 years ago

[root@nagios tmp]# python3 dexMD5.py com.whatsapp.apk --> WhatsApp Version : 2.21.2.18 --> WhatsApp ClassesDEX MD5 : b'cUogV1tgLZAC+/6c5Vd0jQ=='

Still the same this is the info for the latest Whatsapp release and also said:

W 2021-02-04 15:46:11,610 yowsup.common.http.warequest - Passing Config to WARequest is deprecated, pass a YowProfile instead W 2021-02-04 15:46:11,623 yowsup.common.http.warequest - Passing Config to WARequest is deprecated, pass a YowProfile instead I 2021-02-04 15:39:28,985 yowsup.common.http.warequest - {"login":"506****","status":"fail","reason":"old_version"}

status: fail reason: old_version login: 506****

eres de CR ? podrias enviarme un mensaje al whatsapp? +50685923053. estoy con este mismo problema

boas19910115 commented 1 year ago
  1. Download com.whatsapp.apk (for example with https://github.com/matlink/gplaycli)
  2. gplaycli -d com.whatsapp
  3. Calculate version and MD5 with https://gist.github.com/masbog/d29c779539581defbf542e70ce724ed8
  4. Install https://github.com/mikusjelly/axmlparser
  5. python3 dexMD5.py com.whatsapp.apk
  6. Replace the appropriate values (_MD5_CLASSES and _VERSION)

New Version:

--> WhatsApp Version : 2.20.108 --> WhatsApp ClassesDEX MD5 : aIiTbnlq1G2jxLKYgZI5Xw==

Working here... Maybe it would be nice to have these steps on the Wiki @tgalal

Same. It doesn't help me.

Crowdparti commented 1 year ago

Run to get WhatsApp Version and WhatsApp ClassesDEX MD5

# tweak up from https://github.com/mgp25/classesMD5-64/blob/master/dexMD5.py
# to use this $ python3 dexMD5.py apk/WhatsApp.apk
# Output : 
# WhatsApp Version : 2.17.296
# WhatsApp ClassesDEX MD5 : b'YrJNPljM3TuNFPIOZ+jziw=='

import sys
import zipfile
import hashlib
import base64
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
import os
from xml.dom import minidom
try:
  from axmlparser import AXML
except:
  os.system("pip install git+https://github.com/kin9-0rz/axmlparser")
try:
  from bs4 import BeautifulSoup
except:
  os.system("pip install bs4")

try:
  os.remove("whatsapp.apk")
except OSError:
  pass
url = "https://www.cdn.whatsapp.net/android/"
response = requests.request("GET", url, verify=False)
soup = BeautifulSoup(response.text, "html.parser")
apk_url = soup.find_all('a', href=True)

for get_url in apk_url:
  if get_url['href'].find("WhatsApp.apk")!=-1:
    download_url = get_url['href']
    break

print("URL download for APK : "+ download_url)
os.system(f"wget '{download_url}' -O whatsapp.apk")
apkName = "whatsapp.apk"
zipFile = zipfile.ZipFile(apkName,'r')
hash = hashlib.md5()
hash.update(zipFile.read('classes.dex'))
axml = AXML(zipFile.read('AndroidManifest.xml'))
xml = minidom.parseString(axml.get_buff())
package = xml.documentElement.getAttribute("package")
print("--> WhatsApp Version : "+xml.documentElement.getAttributeNS('http://schemas.android.com/apk/res/android', "versionName"))
print("--> WhatsApp ClassesDEX MD5 : "+ str(base64.b64encode(hash.digest())));
try:
  os.remove("whatsapp.apk")
except OSError:
  pass```

This is really helpful, Thank you! But just some change needed. Suggest, do not use this part, below, in the code. Manually download Whatapp.apk instead.

try:
    os.remove("whatsapp.apk")
 except OSError:
    pass
 url = "https://www.cdn.whatsapp.net/android/"
 response = requests.request("GET", url, verify=False)
 soup = BeautifulSoup(response.text, "html.parser")
 apk_url = soup.find_all('a', href=True)

 for get_url in apk_url:
   if get_url['href'].find("WhatsApp.apk")!=-1:
     download_url = get_url['href']
     break

 print("URL download for APK : "+ download_url)
 os.system(f"wget '{download_url}' -O whatsapp.apk")

After that, run this code below. Then you will get that information. $ python dexMD5.py whatsapp.apk --> WhatsApp Version : 2.23.10.74 --> WhatsApp ClassesDEX MD5 : b'3E+fceVFBLTpOI3Knv+kpg=='

Replace the values in the 'env_android.py'. This file is in 'yowsup > env' And run, $ python yowsup-cli registration --requestcode sms --phone 49XXXXXXXX --cc 49 --mcc 123 --mnc 456

Replace 49XXXXXXXX with your phone number, including the country code but without the plus or 00.

If successful, you should receive a code via SMS. Now confirm the code:

$ python yowsup-cli registration --register 123-456 --phone 49XXXXXXXX --cc 49 now you will get a proper result.

I got the SMS code. Going forward now ;-)

iamvinny commented 3 days ago

Here's a fixed version of the script previously shared.

# tweak up from https://github.com/mgp25/classesMD5-64/blob/master/dexMD5.py
# to use this $ python3 dexMD5.py apk/WhatsApp.apk
# Output : 
# WhatsApp Version : 2.17.296
# WhatsApp ClassesDEX MD5 : b'YrJNPljM3TuNFPIOZ+jziw=='

import sys
import zipfile
import hashlib
import base64
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
import os
from xml.dom import minidom

# Install missing dependencies if necessary
try:
    from axmlparser import AXML
except ImportError:
    os.system("pip install git+https://github.com/kin9-0rz/axmlparser")

try:
    from bs4 import BeautifulSoup
except ImportError:
    os.system("pip install bs4")

# Remove any existing 'whatsapp.apk'
try:
    os.remove("whatsapp.apk")
except OSError:
    pass

# Get the WhatsApp APK download URL
url = "https://www.cdn.whatsapp.net/android/"
response = requests.request("GET", url, verify=False)
soup = BeautifulSoup(response.text, "html.parser")
apk_url = soup.find_all('a', href=True)

download_url = None
for get_url in apk_url:
    if "WhatsApp.apk" in get_url['href']:
        download_url = get_url['href']
        break

if download_url:
    print("URL download for APK: " + download_url)
    os.system(f"wget '{download_url}' -O whatsapp.apk")
else:
    print("WhatsApp APK URL not found.")
    sys.exit(1)

# Process the downloaded APK file
apkName = "whatsapp.apk"
try:
    zipFile = zipfile.ZipFile(apkName, 'r')
    hash_md5 = hashlib.md5()
    hash_md5.update(zipFile.read('classes.dex'))

    axml = AXML(zipFile.read('AndroidManifest.xml'))
    xml = minidom.parseString(axml.get_buff())
    version = xml.documentElement.getAttributeNS('http://schemas.android.com/apk/res/android', "versionName")

    print("--> WhatsApp Version: " + version)
    print("--> WhatsApp ClassesDEX MD5: " + str(base64.b64encode(hash_md5.digest())))

    # Remove the downloaded APK after processing
    os.remove(apkName)
except Exception as e:
    print(f"Error processing APK file: {e}")
    sys.exit(1)