Skip to content

Android Usage

Knugi edited this page Jul 25, 2023 · 4 revisions

Working with Android

Unencrypted WhatsApp database

Extract the WhatsApp database with whatever means, one possible means is to use the WhatsApp-Key-DB-Extractor

After you obtain your WhatsApp database, copy the WhatsApp database and media folder to the working directory. The database is called msgstore.db. If you also want the name of your contacts, get the contact database, which is called wa.db. And copy the WhatsApp (Media) directory from your phone directly.

And now, you should have something like this in the working directory.

Android folder structure

Extracting

Simply invoke the following command from shell.

wtsexporter -a

Encrypted Android WhatsApp Backup

In order to support the decryption, install pycryptodome if it is not installed

pip install pycryptodome # Or 
pip install whatsapp-chat-exporter["android_backup"] # install along with this software

Crypt15 is now the easiest way to decrypt a backup. If you have the 32 bytes hex key generated when you enable End-to-End encrypted backup, you can use it to decrypt the backup. If you do not have the 32 bytes hex key, you can still use the key file extracted just like extacting key file for Crypt12 and Crypt14 to decrypt the backup.

Crypt12 or Crypt14

You will need the decryption key file from your phone. If you have root access, you can find it as /data/data/com.whatsapp/files/key. Otherwise, if you used WhatsApp-Key-DB-Extractor before, it will appear in the WhatsApp backup directory as WhatsApp/Databases/.nomedia.

Place the decryption key file (key) and the encrypted WhatsApp Backup (msgstore.db.crypt14) in the working directory. If you also want the name of your contacts, get the contact database, which is called wa.db. And copy the WhatsApp (Media) directory from your phone directly.

And now, you should have something like this in the working directory.

Android folder structure with WhatsApp Backup

Extracting

Simply invoke the following command from shell.

wtsexporter -a -k key -b msgstore.db.crypt14

Crypt15 (End-to-End Encrypted Backup)

To support Crypt15 backup, install javaobj-py3 if it is not installed

pip install javaobj-py3 # Or 
pip install whatsapp-chat-exporter["crypt15"] # install along with this software

Place the encrypted WhatsApp Backup (msgstore.db.crypt15) in the working directory. If you also want the name of your contacts, get the contact database, which is called wa.db. And copy the WhatsApp (Media) directory from your phone directly.
If you do not have the 32 bytes hex key (64 hexdigits), place the decryption key file (encrypted_backup.key) extracted from Android. If you gave the 32 bytes hex key, simply put the key in the shell.

Now, you should have something like this in the working directory (if you do not have 32 bytes hex key).

Android folder structure with WhatsApp Crypt15 Backup

Extracting

If you do not have 32 bytes hex key but have the key file available, simply invoke the following command from shell.

wtsexporter -a -k encrypted_backup.key -b msgstore.db.crypt15

If you have the 32 bytes hex key, simply put the hex key in the -k option and invoke the command from shell like this:

wtsexporter -a -k 432435053b5204b08e5c3823423399aa30ff061435ab89bc4e6713969cdaa5a8 -b msgstore.db.crypt15