YuvrajRaghuvanshiS / WhatsApp-Key-Database-Extractor

The most advanced and complete solution for extracting WhatsApp key/DB from package directory (/data/data/com.whatsapp) without root access.
MIT License
447 stars 57 forks source link

wa_kdbe.py exits with no error message #46

Closed Nuc1eoN closed 3 years ago

Nuc1eoN commented 3 years ago

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.

YuvrajRaghuvanshiS commented 3 years ago

My day is occupied so I'll start working on it this evening in the meantime if you any experience with python or vs code you can try to debug it urself. Love that profile picture BTW😂

Nuc1eoN commented 3 years ago

I have never heard that compliment haha, thank you :joy: 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...

Nuc1eoN commented 3 years ago

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!! :heart:

YuvrajRaghuvanshiS commented 3 years ago

It has that check actually. https://github.com/YuvrajRaghuvanshiS/WhatsApp-Key-Database-Extractor/blob/24fb112a81fe54d0b0f42a6d3253b3420b92976e/helpers/WIndowsUSB.py#L36-L40 I can not say for sure if that is the issue. Whatever the case was glad to hear it all worked out.

Nuc1eoN commented 3 years ago

I can reproduce the error reliably when I manually uninstall whatsapp and then run wa_kdbe.py, after it shows the message "Connected to FRD-L09".

The error happens in LinuxUSB.py line 31/32 (or the equivalent on Windows):

WhatsAppapkPath = re.search(
        '(?<=package:)(.*)(?=apk)', str(check_output(_waPathText.split()))).group(1) + 'apk'

Debugger exception error:

Exception has occurred: CalledProcessError
Command '['adb', '-s', '73QDU17A14003943', 'shell', 'pm', 'path', 'com.whatsapp']' returned non-zero exit status 1.
  File "/home/nuc/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py", line 32, in AfterConnect
    '(?<=package:)(.*)(?=apk)', str(check_output(_waPathText.split()))).group(1) + 'apk'
  File "/home/nuc/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py", line 71, in LinuxUSB
    return AfterConnect(ADBSerialId)
  File "/home/nuc/WhatsApp-Key-Database-Extractor/wa_kdbe.py", line 223, in USBMode
    ACReturnCode, SDKVersion, WhatsAppapkPath, versionName, sdPath = LinuxUSB(
  File "/home/nuc/WhatsApp-Key-Database-Extractor/wa_kdbe.py", line 59, in main
    USBMode()

EDIT:

I can not say for sure if that is the issue.

It seems like the issue is exactly there. Something about the check fails. (And also it's an unhandled error?)

YuvrajRaghuvanshiS commented 3 years ago

Yes it is unhandled. Also This innocent looking line 31 uses check_output from subprocess module (to execute shell commands and get the output) which itself is very complicated. Then applies regular expression on that to get the actual path, and concatenates 'apk' to it. If you ask me this has to do something with check_output, that just stops because there is no error it is just waiting. Since you're the first person having this issue I believe that has something to do with your phone also.

If it had something to do with regex I could have used grep for LinuxUSB like https://github.com/EliteAndroidApps/WhatsApp-Key-DB-Extractor/blob/a68f062df88e6189e207688fc68d873f1f87355e/WhatsAppKeyDBExtract.sh#L54 but again I don't think it is that much concerning at this stage atleast.

Nuc1eoN commented 3 years ago

So I don't know, I don't need the issue solved anymore, be free to close it :D

You are saying it might be specific to my phone.. maybe. My reproduction steps are simply:

  1. Uninstall whatsapp manually on your phone (but dont delete whatsapp folder obviously)
  2. Run wa_kdbe.py
  3. Notice how it will either be stuck on Connected to [PHONE] or exit with no message. Windows or linux doesnt matter.
  4. If you reinstall WA manually the script will work again

For me it happens on a Honor/Huawei phone, which are known to be a little different than most Android phones.

YuvrajRaghuvanshiS commented 3 years ago

Cool. Closing it.

Endothermia commented 3 years ago

Hi there. I'm running into this exact issue on an OPPO device. wa_kdbe.py exits immediately after "Connected to [device]". WDBerror

Unlike Nuc1eoN's case, though, WhatsApp isn't getting uninstalled from my phone at all. As mentioned above, I guess the script isn't getting past the 'check for WhatsApp installation' stage. Any workaround for this?

YuvrajRaghuvanshiS commented 3 years ago

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

YuvrajRaghuvanshiS commented 3 years ago

Now to solve this either you can debug it using vs code if you have experience with python or using pdb which does not require any experience you just need to press 'n' and hit enter many times and send me output.

You need to do the following to help me debug this issue. Paste these commands in your terminal inside 'Whatsapp-Key-Database-Folder'

Now after that you will see you terminal saying (Pdb) here all you need to do is type n and hit enter key around 39 times or until you see your terminal saying

(Pdb) n
--Return--
> d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(62)AfterConnect()->(1, 29, '/data/app/co...Wg==/base.apk', '2.21.6.12', '/sdcard')
-> return 1, SDKVersion, WhatsAppapkPath, versionName, sdPath

However in your case this might not be the case where this function returns something because it stops after saying "connected to " but this way atleast we can check what the issue is where is it taking so much time.

This is my terminal output, this is the expected output. ``` ================================================================================ ======== ======== ======== 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 === ================================================================================ [13:58:16.465690] Found Java installed on system. [13:58:16.465690] Current release date : 17/03/2021 [13:58:16.465690] Please read above instructions carefully ↑ . Continue? (default y) : [13:58:17.164264] If you haven't already, it is adviced to take a WhatsApp chat backup by going to WhatsApp settings → Chat Settings → Chat Backup.Hit Enter key to continue. > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(73)WindowsUSB() -> CustomPrint('Connected to ' + getoutput(adb + (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(74)WindowsUSB() -> ' shell getprop ro.product.model')) (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(73)WindowsUSB() -> CustomPrint('Connected to ' + getoutput(adb + (Pdb) n [13:58:54.395347] Connected to Redmi 5 Plus > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(75)WindowsUSB() -> return AfterConnect(adb) (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(30)AfterConnect() -> SDKVersion = int(getoutput( (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(31)AfterConnect() -> adb + ' shell getprop ro.build.version.sdk')) (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(30)AfterConnect() -> SDKVersion = int(getoutput( (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(32)AfterConnect() -> if (SDKVersion <= 13): (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(38)AfterConnect() -> WhatsAppapkPath = re.search('(?<=package:)(.*)(?=apk)', str(check_output( (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(39)AfterConnect() -> adb + ' shell pm path com.whatsapp'))).group(1) + 'apk' (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(38)AfterConnect() -> WhatsAppapkPath = re.search('(?<=package:)(.*)(?=apk)', str(check_output( (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(39)AfterConnect() -> adb + ' shell pm path com.whatsapp'))).group(1) + 'apk' (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(38)AfterConnect() -> WhatsAppapkPath = re.search('(?<=package:)(.*)(?=apk)', str(check_output( (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(39)AfterConnect() -> adb + ' shell pm path com.whatsapp'))).group(1) + 'apk' (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(38)AfterConnect() -> WhatsAppapkPath = re.search('(?<=package:)(.*)(?=apk)', str(check_output( (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(40)AfterConnect() -> if not (WhatsAppapkPath): (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(43)AfterConnect() -> sdPath = getoutput(adb + ' shell "echo $EXTERNAL_STORAGE"') (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(45)AfterConnect() -> contentLength = int(re.search("(?<=Content-Length:)(.*[0-9])(?=)", str(check_output( (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(46)AfterConnect() -> curl + ' -sI http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk'))).group(1)) (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(45)AfterConnect() -> contentLength = int(re.search("(?<=Content-Length:)(.*[0-9])(?=)", str(check_output( (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(46)AfterConnect() -> curl + ' -sI http://www.cdn.whatsapp.net/android/2.11.431/WhatsApp.apk'))).group(1)) (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(45)AfterConnect() -> contentLength = int(re.search("(?<=Content-Length:)(.*[0-9])(?=)", str(check_output( (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(47)AfterConnect() -> versionName = re.search("(?<=versionName=)(.*?)(?=\\\\r)", str(check_output( (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(48)AfterConnect() -> adb + ' shell dumpsys package com.whatsapp'))).group(1) (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(47)AfterConnect() -> versionName = re.search("(?<=versionName=)(.*?)(?=\\\\r)", str(check_output( (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(48)AfterConnect() -> adb + ' shell dumpsys package com.whatsapp'))).group(1) (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(47)AfterConnect() -> versionName = re.search("(?<=versionName=)(.*?)(?=\\\\r)", str(check_output( (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(49)AfterConnect() -> CustomPrint('WhatsApp V' + versionName + ' installed on device') (Pdb) n [13:59:27.662900] WhatsApp V2.21.6.12 installed on device > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(51)AfterConnect() -> contentLength == 18329558) else appURLWhatsCryptCDN (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(51)AfterConnect() -> contentLength == 18329558) else appURLWhatsCryptCDN (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(50)AfterConnect() -> downloadAppFrom = appURLWhatsAppCDN if( (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(52)AfterConnect() -> if (version.parse(versionName) > version.parse('2.11.431')): (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(53)AfterConnect() -> if not (os.path.isfile(helpers + 'LegacyWhatsApp.apk')): (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(59)AfterConnect() -> CustomPrint('Found legacy WhatsApp V2.11.431 apk in ' + (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(60)AfterConnect() -> helpers + ' folder') (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(59)AfterConnect() -> CustomPrint('Found legacy WhatsApp V2.11.431 apk in ' + (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(60)AfterConnect() -> helpers + ' folder') (Pdb) n > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(59)AfterConnect() -> CustomPrint('Found legacy WhatsApp V2.11.431 apk in ' + (Pdb) n [13:59:37.253113] Found legacy WhatsApp V2.11.431 apk in helpers/ folder > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(62)AfterConnect() -> return 1, SDKVersion, WhatsAppapkPath, versionName, sdPath (Pdb) n --Return-- > d:\yuvraj\work\github\wa-kdbe\helpers\windowsusb.py(62)AfterConnect()->(1, 29, '/data/app/co...Wg==/base.apk', '2.21.6.12', '/sdcard') -> return 1, SDKVersion, WhatsAppapkPath, versionName, sdPath (Pdb) ```
Endothermia commented 3 years ago

My output hasn't changed at all. I believe I've followed the instructions correctly (the only thing I changed was 'python' to 'python3' in the third line). WDBerror WDBerror2

I'm not particularly experienced with Python, sorry.

YuvrajRaghuvanshiS commented 3 years ago

Python or python3 doesn't really matter if you only have python3 installed on system and that is defaulted as 'python'. The thing I can not understand is why python debugger is not working for your system. Before showing device name it should get into debug mode.

image

image

Endothermia commented 3 years ago

Could it be a Linux issue? I notice your output accesses 'windowsusb.py'. I'm running KUbuntu.

YuvrajRaghuvanshiS commented 3 years ago

🤦🏻 My bad one moment.

YuvrajRaghuvanshiS commented 3 years ago

check now. Do all these steps first.

Endothermia commented 3 years ago
ValueError: invalid literal for int() with base 10: ' 0\\r\\nVia: HTTP/1.1 forward.http.proxy:3333' Pasting it all here: After the last line, it just exits the script and I'm back in the terminal. ``` [18:54:39.195610] If you haven't already, it is adviced to take a WhatsApp chat backup by going to WhatsApp settings → Chat Settings → Chat Backup. Hit Enter key to continue. > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(72)LinuxUSB() -> CustomPrint('Connected to ' + getoutput('adb -s ' + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(73)LinuxUSB() -> ADBSerialId + ' shell getprop ro.product.model')) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(72)LinuxUSB() -> CustomPrint('Connected to ' + getoutput('adb -s ' + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(73)LinuxUSB() -> ADBSerialId + ' shell getprop ro.product.model')) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(72)LinuxUSB() -> CustomPrint('Connected to ' + getoutput('adb -s ' + (Pdb) n [18:54:50.013294] Connected to CPH1819 > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(74)LinuxUSB() -> return AfterConnect(ADBSerialId) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(24)AfterConnect() -> SDKVersion = int(getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(25)AfterConnect() -> ' shell getprop ro.build.version.sdk')) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(24)AfterConnect() -> SDKVersion = int(getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(26)AfterConnect() -> if (SDKVersion <= 13): (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(32)AfterConnect() -> _waPathText = 'adb -s ' + ADBSerialId + ' shell pm path com.whatsapp' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(33)AfterConnect() -> WhatsAppapkPath = re.search( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(34)AfterConnect() -> '(?<=package:)(.*)(?=apk)', str(check_output(_waPathText.split()))).group(1) + 'apk' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(33)AfterConnect() -> WhatsAppapkPath = re.search( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(34)AfterConnect() -> '(?<=package:)(.*)(?=apk)', str(check_output(_waPathText.split()))).group(1) + 'apk' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(33)AfterConnect() -> WhatsAppapkPath = re.search( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(34)AfterConnect() -> '(?<=package:)(.*)(?=apk)', str(check_output(_waPathText.split()))).group(1) + 'apk' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(33)AfterConnect() -> WhatsAppapkPath = re.search( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(35)AfterConnect() -> if not (WhatsAppapkPath): (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(38)AfterConnect() -> sdPath = getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(39)AfterConnect() -> ' shell "echo $EXTERNAL_STORAGE"') or '/sdcard' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(38)AfterConnect() -> sdPath = getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(39)AfterConnect() -> ' shell "echo $EXTERNAL_STORAGE"') or '/sdcard' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(38)AfterConnect() -> sdPath = getoutput('adb -s ' + ADBSerialId + (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 > /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 -> 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(74)LinuxUSB() -> return AfterConnect(ADBSerialId) (Pdb) n --Return-- > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(74)LinuxUSB()->None -> return AfterConnect(ADBSerialId) (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/wa_kdbe.py(223)USBMode() -> ACReturnCode, SDKVersion, WhatsAppapkPath, versionName, sdPath = LinuxUSB( (Pdb) n --Return-- > /home/??/WhatsApp-Key-Database-Extractor/wa_kdbe.py(223)USBMode()->None -> ACReturnCode, SDKVersion, WhatsAppapkPath, versionName, sdPath = LinuxUSB( (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/wa_kdbe.py(59)main() -> USBMode() (Pdb) n --Return-- > /home/??/WhatsApp-Key-Database-Extractor/wa_kdbe.py(59)main()->None -> USBMode() (Pdb) n ValueError: invalid literal for int() with base 10: ' 0\\r\\nVia: HTTP/1.1 forward.http.proxy:3333' > /usr/lib/python3.8/concurrent/futures/thread.py(57)run() -> result = self.fn(*self.args, **self.kwargs) (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(58)run() -> except BaseException as exc: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(59)run() -> self.future.set_exception(exc) (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(61)run() -> self = None (Pdb) n --Return-- > /usr/lib/python3.8/concurrent/futures/thread.py(61)run()->None -> self = None (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(82)_worker() -> del work_item (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(85)_worker() -> executor = executor_reference() (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(86)_worker() -> if executor is not None: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(87)_worker() -> executor._idle_semaphore.release() (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(88)_worker() -> del executor (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(89)_worker() -> continue (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(78)_worker() -> work_item = work_queue.get(block=True) (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(79)_worker() -> if work_item is not None: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(91)_worker() -> executor = executor_reference() (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(96)_worker() -> if _shutdown or executor is None or executor._shutdown: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(99)_worker() -> if executor is not None: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(100)_worker() -> executor._shutdown = True (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(102)_worker() -> work_queue.put(None) (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(103)_worker() -> return (Pdb) n --Return-- > /usr/lib/python3.8/concurrent/futures/thread.py(103)_worker()->None -> return (Pdb) n > /usr/lib/python3.8/threading.py(874)run() -> del self._target, self._args, self._kwargs (Pdb) n --Return-- > /usr/lib/python3.8/threading.py(874)run()->None -> del self._target, self._args, self._kwargs (Pdb) n > /usr/lib/python3.8/threading.py(936)_bootstrap_inner() -> with _active_limbo_lock: (Pdb) n > /usr/lib/python3.8/threading.py(937)_bootstrap_inner() -> try: (Pdb) n > /usr/lib/python3.8/threading.py(940)_bootstrap_inner() -> del _active[get_ident()] (Pdb) n --Return-- > /usr/lib/python3.8/threading.py(940)_bootstrap_inner()->None -> del _active[get_ident()] (Pdb) n --Return-- > /usr/lib/python3.8/threading.py(890)_bootstrap()->None -> self._bootstrap_inner() (Pdb) n ```
YuvrajRaghuvanshiS commented 3 years ago
                               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?

YuvrajRaghuvanshiS commented 3 years ago

Note to self : ValueError: invalid literal for int() with base 10: ' 0\\r\\nVia: HTTP/1.1 forward.http.proxy:3333' For some reason it is returning an int with value of 0 along with \\r\\nVia: HTTP/1.1 forward.http.proxy:3333 regex needs to be updated. Could not reproduce on Ubuntu VM

YuvrajRaghuvanshiS commented 3 years ago

@Endothermia do a quick

Endothermia commented 3 years ago
urllib.error.URLError: urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123) This is the output now (sorry for the delay). ``` [20:33:29.500194] If you haven't already, it is adviced to take a WhatsApp chat backup by going to WhatsApp settings → Chat Settings → Chat Backup. Hit Enter key to continue. > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(76)LinuxUSB() -> CustomPrint('Connected to ' + getoutput('adb -s ' + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(77)LinuxUSB() -> ADBSerialId + ' shell getprop ro.product.model')) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(76)LinuxUSB() -> CustomPrint('Connected to ' + getoutput('adb -s ' + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(77)LinuxUSB() -> ADBSerialId + ' shell getprop ro.product.model')) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(76)LinuxUSB() -> CustomPrint('Connected to ' + getoutput('adb -s ' + (Pdb) n [20:33:40.707856] Connected to CPH1819 > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(78)LinuxUSB() -> return AfterConnect(ADBSerialId) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(24)AfterConnect() -> SDKVersion = int(getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(25)AfterConnect() -> ' shell getprop ro.build.version.sdk')) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(24)AfterConnect() -> SDKVersion = int(getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(26)AfterConnect() -> if (SDKVersion <= 13): (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(32)AfterConnect() -> _waPathText = 'adb -s ' + ADBSerialId + ' shell pm path com.whatsapp' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(33)AfterConnect() -> WhatsAppapkPath = re.search( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(34)AfterConnect() -> '(?<=package:)(.*)(?=apk)', str(check_output(_waPathText.split()))).group(1) + 'apk' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(33)AfterConnect() -> WhatsAppapkPath = re.search( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(34)AfterConnect() -> '(?<=package:)(.*)(?=apk)', str(check_output(_waPathText.split()))).group(1) + 'apk' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(33)AfterConnect() -> WhatsAppapkPath = re.search( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(34)AfterConnect() -> '(?<=package:)(.*)(?=apk)', str(check_output(_waPathText.split()))).group(1) + 'apk' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(33)AfterConnect() -> WhatsAppapkPath = re.search( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(35)AfterConnect() -> if not (WhatsAppapkPath): (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(38)AfterConnect() -> sdPath = getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(39)AfterConnect() -> ' shell "echo $EXTERNAL_STORAGE"') or '/sdcard' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(38)AfterConnect() -> sdPath = getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(39)AfterConnect() -> ' shell "echo $EXTERNAL_STORAGE"') or '/sdcard' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(38)AfterConnect() -> sdPath = getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(42)AfterConnect() -> try: (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(43)AfterConnect() -> contentLength = int(re.search("(?<=Content-Length:)(.*[0-9])(?=)", str(check_output( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(44)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(43)AfterConnect() -> contentLength = int(re.search("(?<=Content-Length:)(.*[0-9])(?=)", str(check_output( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(44)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(43)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(43)AfterConnect() -> contentLength = int(re.search("(?<=Content-Length:)(.*[0-9])(?=)", str(check_output( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(45)AfterConnect() -> except ValueError: (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(46)AfterConnect() -> contentLength = 0 (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(47)AfterConnect() -> _versionNameText = 'adb -s ' + ADBSerialId + \ (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(48)AfterConnect() -> ' shell dumpsys package com.whatsapp' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(47)AfterConnect() -> _versionNameText = 'adb -s ' + ADBSerialId + \ (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(49)AfterConnect() -> versionName = re.search("(?<=versionName=)(.*?)(?=\\\\n)", (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(50)AfterConnect() -> str(check_output(_versionNameText.split()))).group(1) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(49)AfterConnect() -> versionName = re.search("(?<=versionName=)(.*?)(?=\\\\n)", (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(50)AfterConnect() -> str(check_output(_versionNameText.split()))).group(1) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(49)AfterConnect() -> versionName = re.search("(?<=versionName=)(.*?)(?=\\\\n)", (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(51)AfterConnect() -> CustomPrint('WhatsApp V' + versionName + ' installed on device') (Pdb) n [20:34:11.590704] WhatsApp V2.21.5.17 installed on device > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(53)AfterConnect() -> contentLength == 18329558) else appURLWhatsCryptCDN (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(52)AfterConnect() -> downloadAppFrom = appURLWhatsAppCDN if( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(53)AfterConnect() -> contentLength == 18329558) else appURLWhatsCryptCDN (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(52)AfterConnect() -> downloadAppFrom = appURLWhatsAppCDN if( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(54)AfterConnect() -> if (version.parse(versionName) > version.parse('2.11.431')): (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(55)AfterConnect() -> if not (os.path.isfile('helpers/LegacyWhatsApp.apk')): (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(56)AfterConnect() -> CustomPrint( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(57)AfterConnect() -> 'Downloading legacy WhatsApp V2.11.431 to helpers folder') (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(56)AfterConnect() -> CustomPrint( (Pdb) n [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: > /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 -> wget.download(downloadAppFrom, 'helpers/LegacyWhatsApp.apk') (Pdb) n urllib.error.URLError: > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(78)LinuxUSB() -> return AfterConnect(ADBSerialId) (Pdb) n --Return-- > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(78)LinuxUSB()->None -> return AfterConnect(ADBSerialId) (Pdb) n urllib.error.URLError: > /home/??/WhatsApp-Key-Database-Extractor/wa_kdbe.py(223)USBMode() -> ACReturnCode, SDKVersion, WhatsAppapkPath, versionName, sdPath = LinuxUSB( (Pdb) n --Return-- > /home/??/WhatsApp-Key-Database-Extractor/wa_kdbe.py(223)USBMode()->None -> ACReturnCode, SDKVersion, WhatsAppapkPath, versionName, sdPath = LinuxUSB( (Pdb) n urllib.error.URLError: > /home/??/WhatsApp-Key-Database-Extractor/wa_kdbe.py(59)main() -> USBMode() (Pdb) n --Return-- > /home/??/WhatsApp-Key-Database-Extractor/wa_kdbe.py(59)main()->None -> USBMode() (Pdb) n urllib.error.URLError: > /usr/lib/python3.8/concurrent/futures/thread.py(57)run() -> result = self.fn(*self.args, **self.kwargs) (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(58)run() -> except BaseException as exc: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(59)run() -> self.future.set_exception(exc) (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(61)run() -> self = None (Pdb) n --Return-- > /usr/lib/python3.8/concurrent/futures/thread.py(61)run()->None -> self = None (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(82)_worker() -> del work_item (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(85)_worker() -> executor = executor_reference() (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(86)_worker() -> if executor is not None: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(87)_worker() -> executor._idle_semaphore.release() (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(88)_worker() -> del executor (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(89)_worker() -> continue (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(78)_worker() -> work_item = work_queue.get(block=True) (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(79)_worker() -> if work_item is not None: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(91)_worker() -> executor = executor_reference() (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(96)_worker() -> if _shutdown or executor is None or executor._shutdown: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(99)_worker() -> if executor is not None: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(100)_worker() -> executor._shutdown = True (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(102)_worker() -> work_queue.put(None) (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(103)_worker() -> return (Pdb) n --Return-- > /usr/lib/python3.8/concurrent/futures/thread.py(103)_worker()->None -> return (Pdb) n > /usr/lib/python3.8/threading.py(874)run() -> del self._target, self._args, self._kwargs (Pdb) n --Return-- > /usr/lib/python3.8/threading.py(874)run()->None -> del self._target, self._args, self._kwargs (Pdb) n > /usr/lib/python3.8/threading.py(936)_bootstrap_inner() -> with _active_limbo_lock: (Pdb) n > /usr/lib/python3.8/threading.py(937)_bootstrap_inner() -> try: (Pdb) n > /usr/lib/python3.8/threading.py(940)_bootstrap_inner() -> del _active[get_ident()] (Pdb) n --Return-- > /usr/lib/python3.8/threading.py(940)_bootstrap_inner()->None -> del _active[get_ident()] (Pdb) n --Return-- > /usr/lib/python3.8/threading.py(890)_bootstrap()->None -> self._bootstrap_inner() (Pdb) n ```
YuvrajRaghuvanshiS commented 3 years ago

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
YuvrajRaghuvanshiS commented 3 years ago

@Endothermia try now, be sure to to do git pull origin to get latest changes.

YuvrajRaghuvanshiS commented 3 years ago

Side note : Try code by pressing 'c' for the first time instead of 'n' that will save you a lot of steps as 'c' stands for continue and 'n' stands for next. If then code does not work then re run it with 'n'

YuvrajRaghuvanshiS commented 3 years ago

Note to self : WhatsAppapkPath = re.search('(?<=package:)(.*)(?=apk)', str(check_output(adb + ' shell pm path com.whatsapp'))).group(1) + 'apk' instead of assigning a null/none/'' value to WhatsAppapkPath returns with an "exit status 1". And this just happens to cascade entire call with null. Need to do a subprocess here I guess.

image

image

Endothermia commented 3 years ago
requests.exceptions.SSLError: HTTPSConnectionPool(host='whatcrypt.com', port=443): Max retries exceeded with url: /WhatsApp-2.11.431.apk (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)'))) ``` [23:43:52.747801] If you haven't already, it is adviced to take a WhatsApp chat backup by going to WhatsApp settings → Chat Settings → Chat Backup. Hit Enter key to continue. > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(99)LinuxUSB() -> CustomPrint('Connected to ' + getoutput('adb -s ' + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(100)LinuxUSB() -> ADBSerialId + ' shell getprop ro.product.model')) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(99)LinuxUSB() -> CustomPrint('Connected to ' + getoutput('adb -s ' + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(100)LinuxUSB() -> ADBSerialId + ' shell getprop ro.product.model')) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(99)LinuxUSB() -> CustomPrint('Connected to ' + getoutput('adb -s ' + (Pdb) n [23:43:58.220816] Connected to CPH1819 > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(101)LinuxUSB() -> return AfterConnect(ADBSerialId) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(26)AfterConnect() -> SDKVersion = int(getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(27)AfterConnect() -> ' shell getprop ro.build.version.sdk')) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(26)AfterConnect() -> SDKVersion = int(getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(28)AfterConnect() -> if (SDKVersion <= 13): (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(34)AfterConnect() -> _waPathText = 'adb -s ' + ADBSerialId + ' shell pm path com.whatsapp' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(35)AfterConnect() -> proc = subprocess.Popen(_waPathText.split(), stdin=subprocess.PIPE, (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(36)AfterConnect() -> stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(35)AfterConnect() -> proc = subprocess.Popen(_waPathText.split(), stdin=subprocess.PIPE, (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(37)AfterConnect() -> out, err = proc.communicate() (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(38)AfterConnect() -> out = out.decode('utf-8') (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(39)AfterConnect() -> if(not out): (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(42)AfterConnect() -> WhatsAppapkPath = re.search( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(43)AfterConnect() -> '(?<=package:)(.*)(?=apk)', str(check_output(_waPathText.split()))).group(1) + 'apk' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(42)AfterConnect() -> WhatsAppapkPath = re.search( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(43)AfterConnect() -> '(?<=package:)(.*)(?=apk)', str(check_output(_waPathText.split()))).group(1) + 'apk' (Pdb) > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(42)AfterConnect() -> WhatsAppapkPath = re.search( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(43)AfterConnect() -> '(?<=package:)(.*)(?=apk)', str(check_output(_waPathText.split()))).group(1) + 'apk' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(42)AfterConnect() -> WhatsAppapkPath = re.search( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(44)AfterConnect() -> sdPath = getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(45)AfterConnect() -> ' shell "echo $EXTERNAL_STORAGE"') or '/sdcard' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(44)AfterConnect() -> sdPath = getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(45)AfterConnect() -> ' shell "echo $EXTERNAL_STORAGE"') or '/sdcard' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(44)AfterConnect() -> sdPath = getoutput('adb -s ' + ADBSerialId + (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(48)AfterConnect() -> try: (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(49)AfterConnect() -> contentLength = int(re.search("(?<=Content-Length:)(.*[0-9])(?=)", str(check_output( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(50)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(49)AfterConnect() -> contentLength = int(re.search("(?<=Content-Length:)(.*[0-9])(?=)", str(check_output( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(50)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(49)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(49)AfterConnect() -> contentLength = int(re.search("(?<=Content-Length:)(.*[0-9])(?=)", str(check_output( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(51)AfterConnect() -> except ValueError: (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(52)AfterConnect() -> contentLength = 0 (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(53)AfterConnect() -> _versionNameText = 'adb -s ' + ADBSerialId + \ (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(54)AfterConnect() -> ' shell dumpsys package com.whatsapp' (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(53)AfterConnect() -> _versionNameText = 'adb -s ' + ADBSerialId + \ (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(55)AfterConnect() -> versionName = re.search("(?<=versionName=)(.*?)(?=\\\\n)", (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(56)AfterConnect() -> str(check_output(_versionNameText.split()))).group(1) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(55)AfterConnect() -> versionName = re.search("(?<=versionName=)(.*?)(?=\\\\n)", (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(56)AfterConnect() -> str(check_output(_versionNameText.split()))).group(1) (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(55)AfterConnect() -> versionName = re.search("(?<=versionName=)(.*?)(?=\\\\n)", (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(57)AfterConnect() -> CustomPrint('WhatsApp V' + versionName + ' installed on device') (Pdb) n [23:44:39.054637] WhatsApp V2.21.5.17 installed on device > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(59)AfterConnect() -> contentLength == 18329558) else appURLWhatsCryptCDN (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(58)AfterConnect() -> downloadAppFrom = appURLWhatsAppCDN if( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(59)AfterConnect() -> contentLength == 18329558) else appURLWhatsCryptCDN (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(58)AfterConnect() -> downloadAppFrom = appURLWhatsAppCDN if( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(60)AfterConnect() -> if (version.parse(versionName) > version.parse('2.11.431')): (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(61)AfterConnect() -> if not (os.path.isfile('helpers/LegacyWhatsApp.apk')): (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(62)AfterConnect() -> CustomPrint( (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(63)AfterConnect() -> 'Downloading legacy WhatsApp V2.11.431 to helpers folder') (Pdb) n > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(62)AfterConnect() -> CustomPrint( (Pdb) n [23:44:47.991619] Downloading legacy WhatsApp V2.11.431 to helpers folder > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(64)AfterConnect() -> DownloadApk(downloadAppFrom, 'helpers/LegacyWhatsApp.apk') (Pdb) n requests.exceptions.SSLError: HTTPSConnectionPool(host='whatcrypt.com', port=443): Max retries exceeded with url: /WhatsApp-2.11.431.apk (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)'))) > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(64)AfterConnect() -> DownloadApk(downloadAppFrom, 'helpers/LegacyWhatsApp.apk') (Pdb) n --Return-- > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(64)AfterConnect()->None -> DownloadApk(downloadAppFrom, 'helpers/LegacyWhatsApp.apk') (Pdb) n requests.exceptions.SSLError: HTTPSConnectionPool(host='whatcrypt.com', port=443): Max retries exceeded with url: /WhatsApp-2.11.431.apk (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)'))) > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(101)LinuxUSB() -> return AfterConnect(ADBSerialId) (Pdb) n --Return-- > /home/??/WhatsApp-Key-Database-Extractor/helpers/LinuxUSB.py(101)LinuxUSB()->None -> return AfterConnect(ADBSerialId) (Pdb) n requests.exceptions.SSLError: HTTPSConnectionPool(host='whatcrypt.com', port=443): Max retries exceeded with url: /WhatsApp-2.11.431.apk (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)'))) > /home/??/WhatsApp-Key-Database-Extractor/wa_kdbe.py(225)USBMode() -> ACReturnCode, SDKVersion, WhatsAppapkPath, versionName, sdPath = LinuxUSB( (Pdb) n --Return-- > /home/??/WhatsApp-Key-Database-Extractor/wa_kdbe.py(225)USBMode()->None -> ACReturnCode, SDKVersion, WhatsAppapkPath, versionName, sdPath = LinuxUSB( (Pdb) n requests.exceptions.SSLError: HTTPSConnectionPool(host='whatcrypt.com', port=443): Max retries exceeded with url: /WhatsApp-2.11.431.apk (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)'))) > /home/??/WhatsApp-Key-Database-Extractor/wa_kdbe.py(61)main() -> USBMode() (Pdb) n --Return-- > /home/??/WhatsApp-Key-Database-Extractor/wa_kdbe.py(61)main()->None -> USBMode() (Pdb) n requests.exceptions.SSLError: HTTPSConnectionPool(host='whatcrypt.com', port=443): Max retries exceeded with url: /WhatsApp-2.11.431.apk (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)'))) > /usr/lib/python3.8/concurrent/futures/thread.py(57)run() -> result = self.fn(*self.args, **self.kwargs) (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(58)run() -> except BaseException as exc: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(59)run() -> self.future.set_exception(exc) (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(61)run() -> self = None (Pdb) n --Return-- > /usr/lib/python3.8/concurrent/futures/thread.py(61)run()->None -> self = None (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(82)_worker() -> del work_item (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(85)_worker() -> executor = executor_reference() (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(86)_worker() -> if executor is not None: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(87)_worker() -> executor._idle_semaphore.release() (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(88)_worker() -> del executor (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(89)_worker() -> continue (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(78)_worker() -> work_item = work_queue.get(block=True) (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(79)_worker() -> if work_item is not None: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(91)_worker() -> executor = executor_reference() (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(96)_worker() -> if _shutdown or executor is None or executor._shutdown: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(99)_worker() -> if executor is not None: (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(100)_worker() -> executor._shutdown = True (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(102)_worker() -> work_queue.put(None) (Pdb) n > /usr/lib/python3.8/concurrent/futures/thread.py(103)_worker() -> return (Pdb) n --Return-- > /usr/lib/python3.8/concurrent/futures/thread.py(103)_worker()->None -> return (Pdb) n > /usr/lib/python3.8/threading.py(874)run() -> del self._target, self._args, self._kwargs (Pdb) n --Return-- > /usr/lib/python3.8/threading.py(874)run()->None -> del self._target, self._args, self._kwargs (Pdb) n > /usr/lib/python3.8/threading.py(936)_bootstrap_inner() -> with _active_limbo_lock: (Pdb) n > /usr/lib/python3.8/threading.py(937)_bootstrap_inner() -> try: (Pdb) n > /usr/lib/python3.8/threading.py(940)_bootstrap_inner() -> del _active[get_ident()] (Pdb) n --Return-- > /usr/lib/python3.8/threading.py(940)_bootstrap_inner()->None -> del _active[get_ident()] (Pdb) n --Return-- > /usr/lib/python3.8/threading.py(890)_bootstrap()->None -> self._bootstrap_inner() (Pdb) n ```
YuvrajRaghuvanshiS commented 3 years ago

I have strong reasons to believe that this error is related to your machine only as this never happened with anyone before and no matter what I do I will never be able to reproduce it on my machine. A quick workaround for this is to download apk manually and saving it to helpers folder with name as 'LegacyWhatsApp.apk', here's the link https://whatcrypt.com/WhatsApp-2.11.431.apk

image

Endothermia commented 3 years ago

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.

YuvrajRaghuvanshiS commented 3 years ago

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