iphone_backup_decrypt icon indicating copy to clipboard operation
iphone_backup_decrypt copied to clipboard

Make relative_paths_like Optional and Allow Custom Decryption Chunk Size

Open KnugiHK opened this issue 2 months ago • 1 comments

This PR makes two changes:

Make relative_paths_like Optional

Based on the validation logic in the extract_files function:

# Check the provided arguments and replace missing ones with wildcards:
if relative_paths_like is None and domain_like is None:
    # If someone _really_ wants to try and extract everything, then setting both to '%' should be enough.
    raise ValueError("At least one of 'relative_paths_like' or 'domain_like' must be specified!")
elif relative_paths_like is None and domain_like is not None:
    relative_paths_like = "%"
elif relative_paths_like is not None and domain_like is None:
    domain_like = "%"

The relative_paths_like parameter appears to be optional (at least it seems to me that). Thus, it should be set to None by default.

Allow Custom Decryption Chunk Size

I found the default chunk size (100MB) drives the decryption process very slow, especially when dealing with a lot of WhatsApp media files. Therefore, a parameter has been added to the EncryptedBackup class for adjusting the chunk size.

KnugiHK avatar Jun 22 '24 12:06 KnugiHK