fix: fixes misagent cmd + adds new install subcmd (#59)

Calling init twice is a bad idea and causes the program to crash, also adds an install command for provisioning profile paths
This commit is contained in:
SAMSAM
2026-01-14 12:01:04 -08:00
committed by GitHub
parent 1db78e6a8d
commit f44a5c0779

View File

@@ -28,12 +28,20 @@ pub fn register() -> JkCommand {
.required(true),
),
)
.with_subcommand(
"install",
JkCommand::new()
.help("Install a provisioning profile on the device")
.with_argument(
JkArgument::new()
.with_help("Path to the provisioning profile to install")
.required(true),
),
)
.subcommand_required(true)
}
pub async fn main(arguments: &CollectedArguments, provider: Box<dyn IdeviceProvider>) {
tracing_subscriber::fmt::init();
let mut misagent_client = MisagentClient::connect(&*provider)
.await
.expect("Unable to connect to misagent");
@@ -67,6 +75,16 @@ pub async fn main(arguments: &CollectedArguments, provider: Box<dyn IdeviceProvi
.await
.expect("Failed to remove");
}
"install" => {
let path = sub_args
.next_argument::<PathBuf>()
.expect("No profile path passed");
let profile = tokio::fs::read(path).await.expect("Unable to read profile");
misagent_client
.install(profile)
.await
.expect("Failed to install profile");
}
_ => unreachable!(),
}
}