mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-04-25 23:41:33 +00:00
Support preservation of file timestamp for encrypted backup
This commit is contained in:
@@ -16,7 +16,7 @@ else:
|
|||||||
support_encrypted = True
|
support_encrypted = True
|
||||||
|
|
||||||
|
|
||||||
def extract_encrypted(base_dir, password, identifiers, preserve_timestamp):
|
def extract_encrypted(base_dir, password, identifiers, bplist_reader=None):
|
||||||
backup = EncryptedBackup(backup_directory=base_dir, passphrase=password, cleanup=False, check_same_thread=False)
|
backup = EncryptedBackup(backup_directory=base_dir, passphrase=password, cleanup=False, check_same_thread=False)
|
||||||
print("Decrypting WhatsApp database...", end="")
|
print("Decrypting WhatsApp database...", end="")
|
||||||
try:
|
try:
|
||||||
@@ -37,7 +37,7 @@ def extract_encrypted(base_dir, password, identifiers, preserve_timestamp):
|
|||||||
print("Done")
|
print("Done")
|
||||||
extract_thread = threading.Thread(
|
extract_thread = threading.Thread(
|
||||||
target=backup.extract_files_by_domain,
|
target=backup.extract_files_by_domain,
|
||||||
args=(identifiers.DOMAIN, identifiers.DOMAIN)
|
args=(identifiers.DOMAIN, identifiers.DOMAIN, bplist_reader)
|
||||||
)
|
)
|
||||||
extract_thread.daemon = True
|
extract_thread.daemon = True
|
||||||
extract_thread.start()
|
extract_thread.start()
|
||||||
@@ -70,9 +70,10 @@ def is_encrypted(base_dir):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def extract_media(base_dir, identifiers, preserve_timestamp):
|
def extract_media(base_dir, identifiers, preserve_timestamp=False):
|
||||||
if preserve_timestamp:
|
if preserve_timestamp:
|
||||||
from Whatsapp_Chat_Exporter.bplist import BPListReader
|
from Whatsapp_Chat_Exporter.bplist import BPListReader
|
||||||
|
preserve_timestamp = BPListReader
|
||||||
if is_encrypted(base_dir):
|
if is_encrypted(base_dir):
|
||||||
if not support_encrypted:
|
if not support_encrypted:
|
||||||
print("You don't have the dependencies to handle encrypted backup.")
|
print("You don't have the dependencies to handle encrypted backup.")
|
||||||
|
|||||||
Reference in New Issue
Block a user