Skip to content

Commit

Permalink
fix crash, document WA business
Browse files Browse the repository at this point in the history
closes #129
  • Loading branch information
ElDavoo committed Aug 23, 2024
1 parent 8b02689 commit 6cd577c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Coverage Status](https://coveralls.io/repos/github/ElDavoo/wa-crypt-tools/badge.svg?branch=main)](https://coveralls.io/github/ElDavoo/wa-crypt-tools?branch=main)

# WhatsApp Crypt Tools
Decrypt and encrypt WhatsApp's .crypt12, .crypt14 and .crypt15 files with ease!
Decrypt and encrypt WhatsApp and WA Business' .crypt12, .crypt14 and .crypt15 files with ease!
For decryption, you NEED **the key file** or the 64-characters long key.
The key file is named "key" if the backup is crypt14 or
"encrypted_backup.key" if the backup is crypt15 (encrypted E2E backups).
Expand Down Expand Up @@ -112,6 +112,16 @@ NO! What would be the point of encrypting a file otherwise?

See above.

## The program doesn't decrypt my backups and says the backups are corrupted

Your backups are corrupted. You can try disabling all checks with the
`-f` flag, but expect crashes and/or unreadable output.

## The program doesn't decrypt and says the key is wrong

The key is wrong. You can try disabling all checks with the
`-f` flag, but expect crashes and/or unreadable output.

## What is the best setup for decrypting my own databases?

1) Enable end-to-end backups and do NOT use a password, use the 64-letters key option.
Expand All @@ -132,13 +142,17 @@ to encrypt the backups.
Yes, but the code is not documented, so please at this time read the code.


## Not working / crash / etc
## I really think the program is broken, that my backups are intact and that the key is right

Please open an issue and attach:
Send me the needed files on Telegram and I will take a look.

If you (understandably) have privacy concerns, open an issue and attach:
1) Output of the program (both with and without --force)
2) Hexdump of keyfile
3) Hexdump of first 512 bytes of encrypted DB

But it will be more difficult to help you.

## Where do I get the key(file)?
On a rooted Android device, you can just copy
`/data/data/com.whatsapp/files/key`
Expand All @@ -153,10 +167,14 @@ Issues asking for this will be closed as invalid.**

### Last tested version (don't expect this to be updated)
Stable:
2.23.16.76
2.24.16.76
Beta:
2.24.18.10

#### Business
Stable:
2.24.16.77

#### Protobuf automatic fix

You can install the proto optional dependencies to use `protoletariat` and fix the proto imports automatically.
Expand Down
3 changes: 2 additions & 1 deletion src/wa_crypt_tools/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ def test_decompression(test_data: bytes) -> bool:
if len(zlib_obj) < 16:
l.error("Test decompression: chunk too small")
return False
# Decoding can fail if first two bytes are a bad UTF-8 char
if zlib_obj[:15].decode('ascii') != 'SQLite format 3':
l.error("Test decompression: Decryption and decompression ok but not a valid SQLite database")
return False
else:
return True
except zlib.error:
except (zlib.error, UnicodeDecodeError):
return False


Expand Down

0 comments on commit 6cd577c

Please sign in to comment.