WhatsApp-Key-Database-Extractor: wa_kdbe.py exits with no error message

Hi as mentioned in #20 wa_kdbe.py simply exits without any messages:

$ python3 wa_kdbe.py

================================================================================
========                                                                ========
========  db   d8b   db  .d8b.         db   dD d8888b. d8888b. d88888b  ========
========  88   I8I   88 d8' `8b        88 ,8P' 88  `8D 88  `8D 88'      ========
========  88   I8I   88 88ooo88        88,8P   88   88 88oooY' 88ooooo  ========
========  Y8   I8I   88 88~~~88 C8888D 88`8b   88   88 88~~~b. 88~~~~~  ========
========  `8b d8'8b d8' 88   88        88 `88. 88  .8D 88   8D 88.      ========
========   `8b8' `8d8'  YP   YP        YP   YD Y8888D' Y8888P' Y88888P  ========
========                                                                ========
================================================================================

============ WhatsApp Key / Database Extrator for non-rooted Android ===========

================================================================================
===                                                                          ===
===  xxxxx  PLEASE TAKE WHATSAPP CHAT BACKUP BEFORE GETTING STARTED.  xxxxx  ===
===                                                                          ===
===    For that go to 'WhatsApp settings => Chat Settings => Chat Backup'    ===
===              here take a local backup. Prepare for Worst.                ===
===                                                                          ===
===     This script can extract your WhatsApp msgstore.db (non crypt12,      ===
===   unencrypted file) and your 'key' file from '/data/data/com.whatsapp'   ===
===  directory in Android 4.0+ device without root access. However you need  ===
===   to have JAVA installed on your system in order to 'view the extract'.  ===
===  If you don't have JAVA installed then you can 'view extract' later by   ===
===   running 'view_extract.py'. The idea is to install a 'Legacy WhatsApp'  ===
===       temporarily on your device in order to get the android backup      ===
===    permission. You should not lose any data and your current WhatsApp    ===
===   version will be installed after this process so don't panic and don't  ===
=== stop this script while it's working. However if something fails you can  ===
===    run 'restore_whatsapp.py' and reinstall current WhatsApp or simply    ===
===                    update that from Google Play Store.                   ===
===                                                                          ===
===                      Script by : Yuvraj Raghuvanshi                      ===
===                      Github.com/YuvrajRaghuvanshiS                       ===
================================================================================

[11:32:47.378101] Found Java installed on system.


[10:53:55.834942] Current release date : 17/03/2021


[10:53:55.834942] Please read above instructions carefully ↑ . Continue? (default y) :


[10:53:57.565146] If you haven't already, it is adviced to take a WhatsApp chat backup by going to WhatsApp settings → Chat Settings → Chat Backup. Press any key to continue.
[10:53:59.019031] Connected to FRD-L09

then it exits and I am back in the shell.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 29 (22 by maintainers)

Commits related to this issue

Most upvoted comments

Great… Glad it all worked out for you! Thank you too for keeping me posted and following along.

Note to self : Close this with commit which will do things mentioned in https://github.com/YuvrajRaghuvanshiS/WhatsApp-Key-Database-Extractor/pull/48#issuecomment-809160951 and https://github.com/YuvrajRaghuvanshiS/WhatsApp-Key-Database-Extractor/pull/48#issuecomment-809162396

Tried again and forgot to rename the APK, so I ran into some well-deserved hiccups…

But I fixed that and it works great! Thanks a bunch for your time and effort.

Some issue with wget, can’t reproduce locally, need some time.

[20:34:18.972857] Downloading legacy WhatsApp V2.11.431 to helpers folder
> /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(58)AfterConnect()
-> wget.download(downloadAppFrom, 'helpers/LegacyWhatsApp.apk')
(Pdb) n
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)>
> /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(58)AfterConnect()
-> wget.download(downloadAppFrom, 'helpers/LegacyWhatsApp.apk')
(Pdb) n
--Return--
> /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(58)AfterConnect()->None
                               Error
 
> /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(41)AfterConnect()
-> contentLength = int(re.search("(?<=Content-Length:)(.*[0-9])(?=)", str(check_output(
(Pdb) n
> /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(42)AfterConnect()
-> 'curl -sI http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk'.split()))).group(1))
(Pdb) n
> /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(41)AfterConnect()
-> contentLength = int(re.search("(?<=Content-Length:)(.*[0-9])(?=)", str(check_output(
(Pdb) n
n> /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(42)AfterConnect()
-> 'curl -sI http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk'.split()))).group(1))
(Pdb) n
> /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(41)AfterConnect()
-> contentLength = int(re.search("(?<=Content-Length:)(.*[0-9])(?=)", str(check_output(
(Pdb) n
ValueError: invalid literal for int() with base 10: ' 0\\r\\nVia: HTTP/1.1 forward.http.proxy:3333'
> /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(41)AfterConnect()
-> contentLength = int(re.search("(?<=Content-Length:)(.*[0-9])(?=)", str(check_output(
(Pdb) n
--Return--
> /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(41)AfterConnect()->None

This made an exception and AfterConnect() function returned with a value none and all the stack call failed like dominos. Great help @Endothermia , also @Nuc1eoN were you also facing problems on Linux?

Now this needs to be taken care of. I’ll look into it. Reopening this.

Yupp I reinstalled whatsapp and ran wa_kdbe.py again, this time from linux and it worked!

So not sure what to do now… Maybe you could add a check if whatsapp is installed to prevent future occurrences of this issue. For me the bug is closed 😃

Also BTW thank you very much for your work on this tool!! It’s a life safer!! ❤️

I have never heard that compliment haha, thank you 😂 I like it too^^

I dont have any experience with python unfortunately, but if you can direct me how to debug it I might try :p

EDIT: On linux I would run strace , but we dont have that on windows.

EDIT2: Oh shit, I just noticed that wa_kdbe.py has actually uninstalled whatsapp from my phone

EDIT3: Testing on linux now, similar behaviour… but its now stuck on Connected to FRD-L09 instead of exiting. I think it is because Whatsapp is not installed anymore…