Repository navigation
·
2 commits
to master
since this release
Immutable
release. Only release title and notes can be modified.
Changelog:
- Completely replace all the old iphone-dataprotection code. Add a new class
utils.BackupKeyBagto represent keybags, with improved documentation and more consistent method and attribute names. Addutils.aes_unwrap(...)usingpycryptodome's AES Key Wrapping functionality rather than a custom implementation, and addutils.aes_decrypt_cbc(...)for decryption, to replace the old versions ingoogle_iphone_dataprotection. The modulegoogle_iphone_dataprotectionstill exists for backwards compatibility, but it is now deprecated will be removed in a future release. - Raise custom exceptions for common error cases, for example backup directories that do not contain the right files, or incorrect passphrases. These are in the
exceptionsmodule e.g.iphone_backup_decrypt.exceptions.BackupNotEncryptedError, but the most likely are exposed at the top-level e.g.iphone_backup_decrypt.IncorrectPassphraseError. - Allow per-file renaming of output files from
backup.extract_files(...)using thefilter_callbackfunction. If the callback returns a string, that value will be used as-is as the output filename instead of the generated value. The generated output filepath is also now provided to the callback function. ReturningTrueandFalseretains the existing behaviour. If existing callback functions use**kwargsas recommended, this is not a breaking change. - Add full file PList data to the
filter_callbacksignature inbackup.extract_files(...). The callback now receives all of the data contained in theManifest.dbrow for the file and can make sophisticated inclusion/exclusion decisions based on this. If existing callback functions use**kwargsas recommended, this is not a breaking change. - Allow the use of the raw passphrase key instead of the passphrase when creating an
EncryptedBackup. If this value is known, it saves computing it from the passphrase and so speeds up load time. The value required can be obtained frombackup.keybag.passphrase_keyafter a successful decryption using the passphrase. Callbackup.test_decryption()before accessing the keybag. - Allow listing of folders and symlinks included in the backup
Manifest.dbfile. Theextract_files(...)method withpreserve_folders=Truedoes not actually use the folder structure recorded inManifest.dbdirectly; it creates the folders from the paths in extracted file names. There are some use-cases for accessing the folder metadata, such as obtaining folder creation and modification times not set byextract_files(...); the newbackup.get_folders(...)generator can be used to loop through these. Similarlybackup.get_symlinks(...)will provide data about the only other type of object recorded in theFilestable ofManifest.db, though this is mostly for completeness and is not expected to be of much use. - Check the contents of
Manifest.plistbefore attempting any keybag or decryption operations, to verify the backup is marked as encrypted and error earlier if it is not. - Avoid a filesystem call per extracted file if
incremental=Falseinextract_files(...). - Avoid creating the temporary folder required for the decrypted
Manifest.dbfile until that decryption is required. - Fix a bug where
backup.decryptedwas never correctly set, even after successful decryption! - Upgrade
pycryptodomedependency to latest, for AES Key Wrapping support.
Breaking changes
- Make
keybaga public (rather than private) attribute ofEncryptedBackup, using the newutils.BackupKeyBagclass. - Remove
datafrom the public interface ofFilePlist; if that object is truly still required, use_data. Addtarget(for symlink PLists),mode(for the read-write state as a string using hex notation) andcreatedtimestamp attributes. backup._unlockedhas now been removed. Use eitherbackup.decryptedorbackup.keybag.unlockedif necessary.- Some raised exceptions have changed type, though most extend the generic type they previously were.