WhatsApp-Key-Database-Extractor: "key" not found in archive.

Describe the bug A clear and concise description of what the bug is. After successfully unpacked tmp/whatsapp.ab, I get the error: bin\tar.exe: apps/com.whatsapp/f/key: Not found in archive To Reproduce Steps to reproduce the behavior:

  1. run ‘py wa_kdbe.py --allow-reboot’
  2. See error

Terminal output


[15:25:32.135413] Current release date : 29/06/2021


[15:25:32.137406] Please read above instructions carefully ↑ . Continue? (default y) : y


[15:25:45.590360] 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.
[15:25:47.385492] Connected to SM-J710MN
[15:25:51.622885] WhatsApp V2.21.15.20 installed on device
[15:25:51.624659] Found legacy WhatsApp V2.11.431 apk in helpers/ folder
[15:25:52.916548] Backing up WhatsApp 2.21.15.20 apk, the one installed on device to tmp/WhatsAppbackup.apk
/sdcard/WhatsAppbackup.apk: 1 file pulled, 0 skipped. 22.4 MB/s (35278159 bytes in 1.502s)
[15:25:55.255573] Apk backup complete.
[15:25:55.256522] Uninstalling WhatsApp, skipping data.
Success
[15:25:57.116690] Uninstalled.


[15:25:57.122670] Rebooting device, please wait.
[15:25:59.764903] Waiting for device...
[15:26:05.198433] Waiting for device...
[15:26:10.296512] Waiting for device...
[15:26:15.429150] Waiting for device...
[15:26:20.535821] Waiting for device...
[15:26:25.903811] Waiting for device...
[15:26:30.985005] Waiting for device...
[15:26:36.066944] Waiting for device...
[15:26:41.270304] Waiting for device...
[15:26:46.344071] Hit Enter key after unlocking device.
[15:26:48.439956] Installing legacy WhatsApp V2.11.431, hold tight now.
Performing Streamed Install
Success
[15:27:16.583067] Installation Complete.
Starting: Intent { cmp=com.whatsapp/.Main launchParam=MultiScreenLaunchParams { mDisplayId=0 mBaseDisplayId=0 mFlags=0 } }
[15:27:19.841462] Hit Enter key after running Legacy WhatsApp for a while. Ignore invalid date warning.
[15:27:41.079705] Backing up WhatsApp data as tmp/whatsapp.ab. May take time, don't panic.
WARNING: adb backup is deprecated and may be removed in a future release
Now unlock your device and confirm the backup operation...
[15:27:54.850835] Done backing up data. Size : 5325360 bytes.
[15:27:54.851833] Reinstallting original WhatsApp.
Performing Streamed Install
Success


[15:28:24.622327] Our work with device has finished, it is safe to remove it now.


[15:28:24.625315] Found whatsapp.ab in tmp folder. Continuing... Size : 5325360 bytes.
[15:28:24.627310] Enter a name for this user (default "user"). :
[15:28:40.790405] Enter same password which you entered on device when prompted earlier. :
[15:28:44.494607] Successfully unpacked tmp/whatsapp.ab to tmp/whatsapp.tar. Size : 16258560 bytes.
[15:28:44.495607] Folder extracted/ already exists.
[15:28:44.496602] Folder extracted/user already exists.
[15:28:44.496602] Taking out main files in tmp/ folder temporaily.
bin\tar.exe: apps/com.whatsapp/f/key: Not found in archive
bin\tar.exe: Error exit delayed from previous errors
[15:28:44.582810] [WinError 3] El sistema no puede encontrar la ruta especificada: 'tmp/apps/com.whatsapp/f/key' -> 'extracted/user/key'
[15:28:44.582810] Cleaning up tmp folder...


[15:28:44.592172] Exiting...
[15:28:44.701973] Hit 'Enter' key to continue....y


Desktop (please complete the following information):

  • OS: Windows 10 Smartphone (please complete the following information):
  • Device: Samsung Galaxy J7
  • Android 7
  • Samsung Experience 8.1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 33 (11 by maintainers)

Commits related to this issue

Most upvoted comments

I opened ! Who can not find the key - so you do not need it). Yes exactly ! If there is no key, then chats can simply be opened)

I did with “–tar-only” and got 4 folders ( db/f/r/sp )

Than open WhatsApp Viewer

Do not decrypt the file, just open the file > com.whatsapp\db\msgstore.db and below in “wa.db (optional)”> com.whatsapp\db\wa.db

if you have an error “It seems like you tried to open an older WhatsApp database. Please try to use an older version of WhatsApp Viewer.” - follow these instructions: https://github.com/andreas-mausch/whatsapp-viewer/issues/151#issuecomment-1306391834

Good luck to all chat miners)

image

addition:

I don’t know how I opened this database but I opened it without a key. On another computer, the WhatsApp viewer says that the database is encrypted… I don’t know how I was able to open it…

I don’t see any “path changes” of files. All are present where they need to. Talking of ‘key’ I can’t say why it is not in output in your case. If key was to be in .ab file that has to show here in output. I am keeping this open of a month or so to see if others have same issue.

Copy this code

import tarfile

tar = tarfile.open('whatsapp.tar')
names = tar.getnames()
filesToSearch = ['key', 'msgstore.db',
                 'wa.db', 'axolotl.db', 'chatsettings.db']

for file in filesToSearch:
    for name in names:
        if(file in name):
            print(name)
tar.close()

input('\n\nPaused... Copy terminal now!')

and put in same directory where whatsapp.tar is saved. Create a flie named search.py paste this code in that file and run it. Send me output.

image

I got this in terminal

apps/com.whatsapp/sp/keystore.xml apps/com.whatsapp/db/msgstore.db-shm apps/com.whatsapp/db/msgstore.db-wal apps/com.whatsapp/db/msgstore.db apps/com.whatsapp/db/wa.db-shm apps/com.whatsapp/db/wa.db-wal apps/com.whatsapp/db/wa.db apps/com.whatsapp/db/axolotl.db-shm apps/com.whatsapp/db/axolotl.db-wal apps/com.whatsapp/db/axolotl.db apps/com.whatsapp/db/chatsettings.db