mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 06:26:15 +01:00
Add progress option for mounting personalized
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -874,7 +874,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "idevice"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"async-recursion",
|
||||
"base64",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name = "idevice"
|
||||
description = "A Rust library to interact with services on iOS devices."
|
||||
authors = ["Jackson Coxson"]
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
documentation = "https://docs.rs/idevice"
|
||||
|
||||
@@ -311,8 +311,6 @@ impl ImageMounter {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Calling this has the potential of closing the socket,
|
||||
/// so a provider is required for this abstraction.
|
||||
pub async fn mount_personalized(
|
||||
&mut self,
|
||||
provider: &dyn crate::provider::IdeviceProvider,
|
||||
@@ -322,6 +320,34 @@ impl ImageMounter {
|
||||
info_plist: Option<plist::Value>,
|
||||
unique_chip_id: u64,
|
||||
) -> Result<(), IdeviceError> {
|
||||
self.mount_personalized_with_callback(
|
||||
provider,
|
||||
image,
|
||||
trust_cache,
|
||||
build_manifest,
|
||||
info_plist,
|
||||
unique_chip_id,
|
||||
|_| async {},
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
/// Calling this has the potential of closing the socket,
|
||||
/// so a provider is required for this abstraction.
|
||||
#[allow(clippy::too_many_arguments)] // literally nobody asked
|
||||
pub async fn mount_personalized_with_callback<Fut>(
|
||||
&mut self,
|
||||
provider: &dyn crate::provider::IdeviceProvider,
|
||||
image: Vec<u8>,
|
||||
trust_cache: Vec<u8>,
|
||||
build_manifest: &[u8],
|
||||
info_plist: Option<plist::Value>,
|
||||
unique_chip_id: u64,
|
||||
callback: impl Fn((usize, usize)) -> Fut,
|
||||
) -> Result<(), IdeviceError>
|
||||
where
|
||||
Fut: std::future::Future<Output = ()>,
|
||||
{
|
||||
// Try to fetch personalization manifest
|
||||
let mut hasher = Sha384::new();
|
||||
hasher.update(&image);
|
||||
@@ -345,7 +371,7 @@ impl ImageMounter {
|
||||
};
|
||||
|
||||
debug!("Uploading imaage");
|
||||
self.upload_image("Personalized", &image, manifest.clone())
|
||||
self.upload_image_with_progress("Personalized", &image, manifest.clone(), callback)
|
||||
.await?;
|
||||
|
||||
debug!("Mounting image");
|
||||
|
||||
Reference in New Issue
Block a user