mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 14:36:16 +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]]
|
[[package]]
|
||||||
name = "idevice"
|
name = "idevice"
|
||||||
version = "0.1.18"
|
version = "0.1.19"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-recursion",
|
"async-recursion",
|
||||||
"base64",
|
"base64",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
name = "idevice"
|
name = "idevice"
|
||||||
description = "A Rust library to interact with services on iOS devices."
|
description = "A Rust library to interact with services on iOS devices."
|
||||||
authors = ["Jackson Coxson"]
|
authors = ["Jackson Coxson"]
|
||||||
version = "0.1.18"
|
version = "0.1.19"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
documentation = "https://docs.rs/idevice"
|
documentation = "https://docs.rs/idevice"
|
||||||
|
|||||||
@@ -311,8 +311,6 @@ impl ImageMounter {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Calling this has the potential of closing the socket,
|
|
||||||
/// so a provider is required for this abstraction.
|
|
||||||
pub async fn mount_personalized(
|
pub async fn mount_personalized(
|
||||||
&mut self,
|
&mut self,
|
||||||
provider: &dyn crate::provider::IdeviceProvider,
|
provider: &dyn crate::provider::IdeviceProvider,
|
||||||
@@ -322,6 +320,34 @@ impl ImageMounter {
|
|||||||
info_plist: Option<plist::Value>,
|
info_plist: Option<plist::Value>,
|
||||||
unique_chip_id: u64,
|
unique_chip_id: u64,
|
||||||
) -> Result<(), IdeviceError> {
|
) -> 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
|
// Try to fetch personalization manifest
|
||||||
let mut hasher = Sha384::new();
|
let mut hasher = Sha384::new();
|
||||||
hasher.update(&image);
|
hasher.update(&image);
|
||||||
@@ -345,7 +371,7 @@ impl ImageMounter {
|
|||||||
};
|
};
|
||||||
|
|
||||||
debug!("Uploading imaage");
|
debug!("Uploading imaage");
|
||||||
self.upload_image("Personalized", &image, manifest.clone())
|
self.upload_image_with_progress("Personalized", &image, manifest.clone(), callback)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
debug!("Mounting image");
|
debug!("Mounting image");
|
||||||
|
|||||||
Reference in New Issue
Block a user