Skip to content

angee.integrate_iphone.backup

Read-only access to one unencrypted Finder/iTunes iPhone backup.

SQLITE_HEADER_LENGTH

Bytes needed to recognize a SQLite database without reading its body.

BackupError

python
class BackupError(Exception)

The backup directory is missing, encrypted, corrupt, or unreadable.

ManifestFile

python
@dataclass(frozen=True)
class ManifestFile()

One regular file resolved from Manifest.db to its physical blob.

IosBackup

python
class IosBackup()

Read-only view over one unencrypted iPhone backup directory.

blob_path

python
def blob_path(domain: str, relative_path: str) -> Path | None

Return the on-disk blob for one backed-up file, or None.

blob_relative_path

python
def blob_relative_path(domain: str, relative_path: str) -> PurePosixPath

Return the backup-relative <fileID[:2]>/<fileID> blob location.

blob_id

python
def blob_id(domain: str, relative_path: str) -> str

Return one file's manifest id or its deterministic fallback id.

iter_files

python
def iter_files() -> Iterator[ManifestFile]

Yield valid physical files in deterministic logical-path order.

Older manifests without the flags column cannot distinguish files from directories, so every row is treated as a file and missing blobs are still skipped. Malformed rows are contained to that row.

iter_dirs

python
def iter_dirs() -> Iterator[tuple[str, str]]

Yield manifest directories as (domain, relative_path) pairs.

read

python
def read(domain: str, relative_path: str) -> bytes | None

Return one backed-up file's bytes, or None when absent.

close

python
def close() -> None

Close the read-only manifest connection.

logical_key

python
def logical_key(domain: str, relative_path: str) -> str

Return the canonical domain/relativePath key for one backup entry.

split_logical_key

python
def split_logical_key(key: str) -> tuple[str, str]

Validate and split one canonical domain/relativePath key.

is_sqlite_header

python
def is_sqlite_header(value: bytes) -> bool

Return whether value begins with SQLite's fixed file header.

Released under the AGPL-3.0 License.