Skip to content
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

Inspired by [`imessage-exporter`](https://github.com/ReagentX/imessage-exporter), `crabapple` provides a flexible foundation for any project that needs to access iOS backup data.

## ⚠️ Warning ⚠️

This library is currently in beta state and should not be used in production code.

## Features

- Load and parse the backup's `Manifest.plist` to obtain metadata, device info, and encryption parameters
Expand Down Expand Up @@ -35,10 +31,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize a backup session for a device UDID with a password
let udid_folder = "/Users/you/Library/Application Support/MobileSync/Backup/DEVICE_UDID";
let auth = Authentication::Password("your_password".into());
let backup = Backup::new(udid_folder, &auth)?;
let backup = Backup::open(udid_folder, &auth)?;

// List all files in the backup
let entries = backup.get_backup_files_list()?;
let entries = backup.entries()?;
for entry in &entries {
println!("{} - {}/{}", entry.file_id, entry.domain, entry.relative_path);
}
Expand All @@ -58,7 +54,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}

// Get the derived key for use elsewhere:
let derived_key = backup.get_decryption_key_hex();
let derived_key = backup.decryption_key_hex();

Ok(())
}
Expand All @@ -75,7 +71,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let udid_folder = "/path/to/backup";
let hex_key = "abcdef0123456789...";
let auth = Authentication::DerivedKey(hex_key.to_string());
let backup = Backup::new(udid_folder, &auth)?;
let backup = Backup::open(udid_folder, &auth)?;
// ... proceed as normal
Ok(())
}
Expand Down Expand Up @@ -108,7 +104,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let udid_folder = "/path/to/backup";
let hex_key = "abcdef0123456789...";
let auth = Authentication::DerivedKey(hex_key.to_string());
let backup = Backup::new(udid_folder, &auth)?;
let backup = Backup::open(udid_folder, &auth)?;

println!("Device: {} (iOS {})",
backup.lockdown().device_name,
Expand All @@ -127,13 +123,17 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
use crabapple::{Backup, Authentication};
use crabapple::error::BackupError;

match Backup::new("/bad/path", &Authentication::Password("pass".into())) {
match Backup::open("/bad/path", &Authentication::Password("pass".into())) {
Ok(b) => println!("Loaded backup successfully"),
Err(BackupError::ManifestPlistNotFound(path)) => eprintln!("Missing Manifest.plist: {}", path),
Err(err) => eprintln!("Error initializing backup: {}", err),
}
```

## Targeted Versions

This library targets the current latest public release for iOS. It should work with backups from iOS 10.2 or later, but all features may not be available.

## Crabapple Tree

![My Crabapple Tree](/resources/crabapple.png)
Loading