mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 14:36:16 +01:00
Misagent plist macro creation
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
//! which manages provisioning profiles and certificates.
|
//! which manages provisioning profiles and certificates.
|
||||||
|
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use plist::Dictionary;
|
|
||||||
|
|
||||||
use crate::{Idevice, IdeviceError, IdeviceService, RsdService, obf};
|
use crate::{Idevice, IdeviceError, IdeviceService, RsdService, obf};
|
||||||
|
|
||||||
@@ -71,14 +70,13 @@ impl MisagentClient {
|
|||||||
/// client.install(profile_data).await?;
|
/// client.install(profile_data).await?;
|
||||||
/// ```
|
/// ```
|
||||||
pub async fn install(&mut self, profile: Vec<u8>) -> Result<(), IdeviceError> {
|
pub async fn install(&mut self, profile: Vec<u8>) -> Result<(), IdeviceError> {
|
||||||
let mut req = Dictionary::new();
|
let req = crate::plist!({
|
||||||
req.insert("MessageType".into(), "Install".into());
|
"MessageType": "Install",
|
||||||
req.insert("Profile".into(), plist::Value::Data(profile));
|
"Profile": profile,
|
||||||
req.insert("ProfileType".into(), "Provisioning".into());
|
"ProfileType": "Provisioning"
|
||||||
|
});
|
||||||
|
|
||||||
self.idevice
|
self.idevice.send_plist(req).await?;
|
||||||
.send_plist(plist::Value::Dictionary(req))
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
let mut res = self.idevice.read_plist().await?;
|
let mut res = self.idevice.read_plist().await?;
|
||||||
|
|
||||||
@@ -121,14 +119,13 @@ impl MisagentClient {
|
|||||||
/// client.remove("asdf").await?;
|
/// client.remove("asdf").await?;
|
||||||
/// ```
|
/// ```
|
||||||
pub async fn remove(&mut self, id: &str) -> Result<(), IdeviceError> {
|
pub async fn remove(&mut self, id: &str) -> Result<(), IdeviceError> {
|
||||||
let mut req = Dictionary::new();
|
let req = crate::plist!({
|
||||||
req.insert("MessageType".into(), "Remove".into());
|
"MessageType": "Remove",
|
||||||
req.insert("ProfileID".into(), id.into());
|
"ProfileID": id,
|
||||||
req.insert("ProfileType".into(), "Provisioning".into());
|
"ProfileType": "Provisioning"
|
||||||
|
});
|
||||||
|
|
||||||
self.idevice
|
self.idevice.send_plist(req).await?;
|
||||||
.send_plist(plist::Value::Dictionary(req))
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
let mut res = self.idevice.read_plist().await?;
|
let mut res = self.idevice.read_plist().await?;
|
||||||
|
|
||||||
@@ -170,13 +167,12 @@ impl MisagentClient {
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub async fn copy_all(&mut self) -> Result<Vec<Vec<u8>>, IdeviceError> {
|
pub async fn copy_all(&mut self) -> Result<Vec<Vec<u8>>, IdeviceError> {
|
||||||
let mut req = Dictionary::new();
|
let req = crate::plist!({
|
||||||
req.insert("MessageType".into(), "CopyAll".into());
|
"MessageType": "CopyAll",
|
||||||
req.insert("ProfileType".into(), "Provisioning".into());
|
"ProfileType": "Provisioning"
|
||||||
|
});
|
||||||
|
|
||||||
self.idevice
|
self.idevice.send_plist(req).await?;
|
||||||
.send_plist(plist::Value::Dictionary(req))
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
let mut res = self.idevice.read_plist().await?;
|
let mut res = self.idevice.read_plist().await?;
|
||||||
match res.remove("Payload") {
|
match res.remove("Payload") {
|
||||||
|
|||||||
Reference in New Issue
Block a user