[Android General] Marvolo1590:
UPDATE:

as of April 2024 it still seems to be possible to decrypt the databases (crypt14 in my case) so that they can be edited using DB Browser for SQLite.

There are two possibilities that currently work without having to root the phone:

1.) Use WhatsApp-Key-Database-Extractor and follow the steps in this video.

You need to install Python, as mentioned in the video. It's VERY IMPORTANT to hit the "ADD PYTHON 3.9 TO PATH" option during the installation process, otherwise the script won't work.

Also, this whole script didn't work on my latest Samsung Galaxy S24 Ultra. Perhaps it was too new and had some features that didn't match with the script. I then used an older Huawei P20 Pro and it worked.

Then run the script using the Windows Command app, just as mentioned in the video.

For me, there was NO key file stored on my local WhatsApp folder for some reason (does anybody know how my WhatsApp version can operate if there is no key on my phone?!), so the automation process will give an error warning (in red):

HOWEVER, despite not having found a local key in my local WhatsApp folders, it still produces a key file and decrypts my message file database (the lines right below the red error) so that it can be read and imported into DB Browser SQLite.

HOWEVER: if I try to open that decrypted file (msgstore.db) with WhatsApp Viewer to check if it is decrypted, both that key file and the msgstore.db file cause an error message in WhatsApp Viewer, claiming that my key file would be invalid or that I should use an older version of WhatsApp Viewer. [UPDATE April 19th: There is a solution to this problem.]

So at first, I was discouraged and thought that something had gone wrong. But as soon as I import the decrypted message file into DB Browser, it can show all my messages just like in Post #1. The key file is not even needed because the message file (msgstore.db) is decrypted anyways. So by using method No. 1, there is no need to try and obtain the key file, which wasn't there on my phone for some reason anyway...

2.) The second possibility would be using a non-official WhatsApp version such as Fouad WhatsApp, just as @Blue-rayer suggested in Post #162.

Make a local backup with your official WhatsApp version, then delete the official WhatsApp version (but don't delete your WhatsApp folder containing your local backup), then download the Fouad WhatsApp APK and let the app find and restore your official WhatsApp backup stored in the official WhatsApp folder (just follow the steps in Post #162).

Inside Fouad WhatsApp, there should now be your chats and all the media from the last backup that you have just created moments before installing Fouad WhatsApp.

Then follow the steps in #162 to create a backup using Fouad WhatsApp (not the official WA backup feature under "settings") which will then cause a decrypted message database file.

For me, this was NOT stored in the directory Blue-rayer mentioned in his post, but in "documents" --> "Fouad WhatsApp" --> "com.whatsapp.zip". It's a zipped folder (.zip). But the app itself will tell you where it stores the backup, so just keep an eye out for it.

Copy this folder to your computer and unzip it. Inside there should be a database folder containing the message database file (msgstore.db), now decrypted and ready to be imported into DB Browser.

This file, too, cannot be viewed with WhatsApp Viewer for some reason, so I think the problem is with WhatsApp Viewer and not with the decrypted files themselves. [UPDATE April 19th: There is a solution to this problem.]

WARNING:

I have read that using inofficial versions such as Fouad WhatsApp can lead to temporary or even permanent WhatsApp bans, and the fact that they're promoting and dealing with circumventing WA bans on their official Fouad website proves that the stuff I read must be right, so I'm not sure if it's a safe and secure way to decrypt your files.

I'd take the first route using the WhatsApp automated command-line extractor, as it works with the official WhatsApp version and the phone does not have to be rooted either. The question though is: how long will this method keep working?!

---------------------------------------------------------------------------

This was the fairly easy part. The much more difficult part is how to edit these messages in the SQ-Lite Browser. The previous posts so far were not very detailed, merely claiming one should delete "overlapping" or "double" messages. But the GUI is so complex and I don't really understand much of it.

Apparently, the messages are listed according to time from old to new. BUT: they are not listed according to chat phone numbers / contacts, as we would expect from using the official WhatsApp, they are listed according to the chronological point of time they were received on the phone, NO MATTER who sent them.

So due to chronological order, you'll end up having something like this in the SQ-Lite table. Messages according to chronological reception on the phone, but widely across all the contacts:

1. Person A: Hello, what's up

2. Me: Hi, I'm fine, how about you?

3. Person B (new chat): Hey, check this out.

4. Me: oh, that's cool. What's up?

5. Person B: I'm good, how about you?

6. Person A (finally answering after taking some time): I'm fine, too.

7. Me (answering to person B): I'm fine, thanks.

With more than 10.000s of messages, this will get quite complicated to edit... If someone has a more detailed tutorial or workaround on how to edit the decrypted files in SQ-Lite, that would be very helpful. I still don't quite understand what's to delete and what not and what all those values and numbers (like -1) stand for...

--------------------------------------------------------------------------

Remaining Questions:

Will one or both of the two methods work for older backup files (crypt 5, 7, 9, etc) as well?

Can I merge backups from different numbers or must the number be the same? Like: I have backups from a previous WA number. Can I put these messages into my current WA chats used under a new number?

Can older backups even be loaded into a working WhatsApp environment so that the script can be run? I had tried before to load a backup from 2015 into a most recent WhatsApp version but it won't find the backup to restore. Not even with a 2019 backup version. And I can't use older WA versions (like 2015 , 2019 APKs) neither, as they won't even start, claiming my date & clock is wrong. ---> So how could I even get older existing backup folders to work so that they can be decrypted for reassembly into my current chats if current WA versions don't find the backup and older WA versions won't start because of wrong time/clock?!

UPDATE: as of April 2024 it seems as if WA accepts its own local, manually made backups

only if they're not older than 6 months or so

. Even a backup from early 2023 (so just a little over 1 year old now) doesn't even work any longer. WA just doesn't find any backup files to restore. Let alone older backups with valuable and precious memories from even further back like 2015 or so.

If anyone knows a solution as to how backups older than 6 months can be restored, please let me know. Following this approach I've tried restoring them with one of the above-mentioned modded apps such as GBWhatsApp and Fouad WhatsApp. These may at least recognize the backup and give me the option to restore, so I was hopeful at first, but as soon as I try to restore it, it loads to 100% and then tells me it couldn't restore anything - 0 messages restored... If I could restore old backups I could then merge long forgotten and currently deleted chats with my actual ones from today...