From 07cc0f3571985bdbc4f376da8da3539b8df38baa Mon Sep 17 00:00:00 2001 From: Knugi <24708955+KnugiHK@users.noreply.github.com> Date: Mon, 4 Apr 2022 07:57:12 +0000 Subject: [PATCH 01/11] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index cfd7807..39ea21e 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ A customizable Android and iPhone Whatsapp database parser that will give you th **If you plan to uninstall WhatsApp or delete your WhatsApp account, please make a backup of your WhatsApp database. You may want to use this exporter again on the same database in the future as the exporter develops** # Usage +**Usage in README may be removed in the future. Check the usage in [Wiki](https://github.com/KnugiHK/Whatsapp-Chat-Exporter/wiki)** + **If you want to use the old release (< 0.5) of the exporter, please follow the [old usage guide](https://github.com/KnugiHK/Whatsapp-Chat-Exporter/blob/main/old_README.md#usage)** First, install the exporter by: From 77b4b784d36aed6cbc6febe9282828a5e277fb79 Mon Sep 17 00:00:00 2001 From: Knugi <24708955+KnugiHK@users.noreply.github.com> Date: Mon, 24 Oct 2022 03:59:24 +0000 Subject: [PATCH 02/11] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 39ea21e..e46551b 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ A customizable Android and iPhone Whatsapp database parser that will give you th **If you plan to uninstall WhatsApp or delete your WhatsApp account, please make a backup of your WhatsApp database. You may want to use this exporter again on the same database in the future as the exporter develops** # Usage -**Usage in README may be removed in the future. Check the usage in [Wiki](https://github.com/KnugiHK/Whatsapp-Chat-Exporter/wiki)** +**Usage in README may be removed in the future. Check the usage in [Wiki](https://github.com/KnugiHK/Whatsapp-Chat-Exporter/wiki)**. -**If you want to use the old release (< 0.5) of the exporter, please follow the [old usage guide](https://github.com/KnugiHK/Whatsapp-Chat-Exporter/blob/main/old_README.md#usage)** +**If you want to use the old release (< 0.5) of the exporter, please follow the [old usage guide](https://github.com/KnugiHK/Whatsapp-Chat-Exporter/wiki/Old-Usage#usage)**. First, install the exporter by: ```shell From 580eaddb24ee359433593776f1b6643e01d91979 Mon Sep 17 00:00:00 2001 From: Knugi <24708955+KnugiHK@users.noreply.github.com> Date: Mon, 24 Oct 2022 03:59:42 +0000 Subject: [PATCH 03/11] Delete old_README.md --- old_README.md | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 old_README.md diff --git a/old_README.md b/old_README.md deleted file mode 100644 index 1c908c6..0000000 --- a/old_README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Whatsapp-Chat-Exporter -A Whatsapp database parser that will give you the history of your Whatsapp conversations in HTML and JSON -**If you plan to uninstall WhatsApp or delete your WhatsApp account, please make a backup of your WhatsApp database. You may want to use this exporter again on the same database in the future as the exporter develops** - -# Usage -First, clone this repo, and copy all py and html files to a working directory if you want to do so. -```shell -git clone https://github.com/KnugiHK/Whatsapp-Chat-Exporter.git -``` -Then, ready your WhatsApp database, place them in the root of working directory. -* For Android, it is called msgstore.db. If you want name of your contacts, get the contact database, which is called wa.db. -* For iPhone, it is called 7c7fba66680ef796b916b067077cc246adacf01d (YES, a hash). - -Next, ready your media folder, place it in the root of working directory. -* For Android, copy the WhatsApp directory from your phone directly. -* For iPhone, run the extract_iphone_media.py, and you will get a folder called Message. -``` -python extract_iphone_media.py "C:\Users\[Username]\AppData\Roaming\Apple Computer\MobileSync\Backup\[device id]" -``` -And now, you should have something like this: - - - -Last, run the script regarding the type of phone. -``` -python extract.py & :: Android -python extract_iphone.py & :: iPhone -``` -And you will get these: -#### Private Message - - -#### Group Message - \ No newline at end of file From 3a30dfc8004efdd91130ad4e7e59ccc6d4485b99 Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Mon, 9 May 2022 18:28:13 +0800 Subject: [PATCH 04/11] Bump version From f267f530074ba289f8d08fa3ef997cd4dbc708c1 Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Mon, 23 May 2022 20:12:50 +0800 Subject: [PATCH 05/11] Remove unused dependencies --- Whatsapp_Chat_Exporter/extract.py | 2 -- Whatsapp_Chat_Exporter/extract_iphone.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/Whatsapp_Chat_Exporter/extract.py b/Whatsapp_Chat_Exporter/extract.py index 6a4aab3..f2aebf1 100644 --- a/Whatsapp_Chat_Exporter/extract.py +++ b/Whatsapp_Chat_Exporter/extract.py @@ -4,10 +4,8 @@ import sqlite3 import json import jinja2 import os -import requests import shutil import re -import pkgutil import io import hmac from pathlib import Path diff --git a/Whatsapp_Chat_Exporter/extract_iphone.py b/Whatsapp_Chat_Exporter/extract_iphone.py index 546be23..7400688 100644 --- a/Whatsapp_Chat_Exporter/extract_iphone.py +++ b/Whatsapp_Chat_Exporter/extract_iphone.py @@ -4,9 +4,7 @@ import sqlite3 import json import jinja2 import os -import requests import shutil -import pkgutil from pathlib import Path from bleach import clean as sanitize from markupsafe import Markup From 2a215d024feac4c1bd0fb880b67097a2cd77a286 Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Wed, 25 May 2022 18:28:07 +0800 Subject: [PATCH 06/11] Bug fix Duplicated folder creation https://github.com/KnugiHK/Whatsapp-Chat-Exporter/issues/14 --- Whatsapp_Chat_Exporter/extract_iphone_media.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Whatsapp_Chat_Exporter/extract_iphone_media.py b/Whatsapp_Chat_Exporter/extract_iphone_media.py index 83b1576..9b6f82e 100644 --- a/Whatsapp_Chat_Exporter/extract_iphone_media.py +++ b/Whatsapp_Chat_Exporter/extract_iphone_media.py @@ -115,7 +115,10 @@ def extract_media(base_dir): folder = hashes[:2] flags = row[2] if flags == 2: - os.mkdir(destination) + try: + os.mkdir(destination) + except FileExistsError: + pass elif flags == 1: shutil.copyfile(f"{base_dir}/{folder}/{hashes}", destination) i += 1 From e7c246822b78bd69e2c116e0493f5f94b26013e0 Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+knugi0123@users.noreply.github.com> Date: Sun, 3 Jul 2022 12:30:01 +0800 Subject: [PATCH 07/11] Link to the file intead of showing the path directly Not tested Ref: https://github.com/KnugiHK/Whatsapp-Chat-Exporter/issues/15 --- Whatsapp_Chat_Exporter/whatsapp.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Whatsapp_Chat_Exporter/whatsapp.html b/Whatsapp_Chat_Exporter/whatsapp.html index d653ce5..d467a87 100644 --- a/Whatsapp_Chat_Exporter/whatsapp.html +++ b/Whatsapp_Chat_Exporter/whatsapp.html @@ -92,7 +92,7 @@ {% elif "/" in msg.mime %}
{% else %} {% filter escape %}{{ msg.data }}{% endfilter %} @@ -148,7 +148,7 @@ {% elif "/" in msg.mime %} {% else %} {% filter escape %}{{ msg.data }}{% endfilter %} From 2f04b69f38c680f3a223d9d976d7ab9d16730692 Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Mon, 5 Sep 2022 12:48:36 +0800 Subject: [PATCH 08/11] A more concrete way to determine database offset --- Whatsapp_Chat_Exporter/extract.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Whatsapp_Chat_Exporter/extract.py b/Whatsapp_Chat_Exporter/extract.py index f2aebf1..a6b6469 100644 --- a/Whatsapp_Chat_Exporter/extract.py +++ b/Whatsapp_Chat_Exporter/extract.py @@ -112,7 +112,8 @@ def decrypt_backup(database, key, output, crypt=Crypt.CRYPT14): raise ValueError("The crypt15 file must be at least 131 bytes") t1 = t2 = None iv = database[8:24] - db_ciphertext = database[131:] + db_offset = database[0] + 2 # Skip protobuf + protobuf size and backup type + db_ciphertext = database[proto_len:] if t1 != t2: raise ValueError("The signature of key file and backup file mismatch") From 23114572bd452dbf76c2b270bd12ec23c24f4a10 Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Mon, 5 Sep 2022 12:49:12 +0800 Subject: [PATCH 09/11] Forgot to change the variable lol --- Whatsapp_Chat_Exporter/extract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Whatsapp_Chat_Exporter/extract.py b/Whatsapp_Chat_Exporter/extract.py index a6b6469..54d22f6 100644 --- a/Whatsapp_Chat_Exporter/extract.py +++ b/Whatsapp_Chat_Exporter/extract.py @@ -113,7 +113,7 @@ def decrypt_backup(database, key, output, crypt=Crypt.CRYPT14): t1 = t2 = None iv = database[8:24] db_offset = database[0] + 2 # Skip protobuf + protobuf size and backup type - db_ciphertext = database[proto_len:] + db_ciphertext = database[db_offset:] if t1 != t2: raise ValueError("The signature of key file and backup file mismatch") From e09f18e2f265c985a4fb6a97b1189b3b233f56a4 Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Mon, 30 Jan 2023 18:53:01 +0800 Subject: [PATCH 10/11] Minor fix --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index b5cb7d6..8ea2068 100644 --- a/setup.py +++ b/setup.py @@ -37,13 +37,13 @@ setuptools.setup( ], python_requires='>=3.7', install_requires=[ - 'jinja2', - 'bleach' + 'jinja2', + 'bleach' ], extras_require={ 'android_backup': ["pycryptodome", "javaobj-py3"], 'crypt12': ["pycryptodome"], - 'crypt12': ["pycryptodome"], + 'crypt14': ["pycryptodome"], 'crypt15': ["pycryptodome", "javaobj-py3"] }, entry_points={ From 77ceaa25dd380ae36bf287d8b15c5afdb5450089 Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Tue, 31 Jan 2023 17:52:34 +0800 Subject: [PATCH 11/11] Bump version --- Whatsapp_Chat_Exporter/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Whatsapp_Chat_Exporter/__init__.py b/Whatsapp_Chat_Exporter/__init__.py index deded32..af46754 100644 --- a/Whatsapp_Chat_Exporter/__init__.py +++ b/Whatsapp_Chat_Exporter/__init__.py @@ -1 +1 @@ -__version__ = "0.8.2" +__version__ = "0.8.5"