KnugiHK / WhatsApp-Chat-Exporter

A customizable Android and iOS/iPadOS WhatsApp database parser that will give you the history of your WhatsApp conversations in HTML and JSON. Android Backup Crypt12, Crypt14, Crypt15, and new schema supported.
https://wts.knugi.dev/
MIT License
565 stars 84 forks source link

Latest versions of WhatsApp on iOS do not contain ContactsV2.sqlite[BUG] #109

Closed ReclusiveEagle closed 6 days ago

ReclusiveEagle commented 1 month ago

The latest version of WhatsApp on iOS does not contain a ContactsV2.sqlite resulting in: Contact database not found.

My last backup of my WhatsApp chats was around 2023 and there were no issues. Luckily I've archived multiple different iTunes backups over the last few months. Testing these backups I am able to extract chats before my 1 May 2024 backup.

In my 2023 backup, ContactsV2.sqlite exists in the AppDomainGroup-group.net.whatsapp.WhatsApp.shared folder. 2023

All backups post 1 May 2024 do not contain ContactsV2.sqlite. I've also attempted a manual search of all files in the entire unencrypted backup and ContactsV2.sqlite does not exist period. Does anyone know if WhatsApp has moved to a different database or where it is located? 2024

ReclusiveEagle commented 1 month ago

Seems to be the same issue reported here.

Edit: I've also attempted to implement the fixes from various other posts such as this one. blockedcontacts.dat does not exist anymore either, hash has changed from 4c6a43645ed0557e7ea2ebb662ef8a2c81b505b8 .

ReclusiveEagle commented 1 month ago

Update

Using any of the unique hashes assigned to anyone of your contact's chat seem to fix the issue.

For example:

0618655a1de1254eca90c229002cdea325de408d for:

0618655a1de1254eca90c229002cdea325de408dAppDomainGroup-group.net.whatsapp.WhatsApp.sharedMessage/Media/[Contacts Number]@s.whatsapp.net/0/6/06693485-42bb-4f27-844d-1c37d93c1291.opusbplist00

Or

5f77dff55f6995a285361c0b7ff4f4c4468c3aff for:

5f77dff55f6995a285361c0b7ff4f4c4468c3affAppDomainGroup-group.net.whatsapp.WhatsApp.sharedMessage/Media/27838439494@s.whatsapp.net/b/5/b57be73c-80c8-4692-ab63-30c94ff9c482.opusbplist00

For some reason this will allow the entire database to be extracted regardless of whether it's initially the correct hash for that contact or not.

Temporary Fix

To fix this, at least temporarily:

This will give you their unique hash in front of AppDomainGroup-group.net.whatsapp.WhatsApp.sharedMessage, and the location of their chat.

In utility.py, for class WhatsAppIdentifier(StrEnum): replace the hash in CONTACT = "to the unique hash from one of your contacts." and run the script again.

class WhatsAppIdentifier(StrEnum):
    MESSAGE = "7c7fba66680ef796b916b067077cc246adacf01d"
    CONTACT = "0618655a1de1254eca90c229002cdea325de408d"
    DOMAIN = "AppDomainGroup-group.net.whatsapp.WhatsApp.shared"

I guess if you wanted to implement a proper fix you could create a variable that searches for the unique hashes assigned to each contact, extracts that contacts chat and then loops, updating itself with the new hash until all chats have been extracted.

userTeki commented 2 weeks ago

Will there be an update fixing this?

KnugiHK commented 6 days ago

Closing as a duplication of #107.