From f44a5c07799e16a36cf3b4ea36d0d8aa7c02e29a Mon Sep 17 00:00:00 2001 From: SAMSAM Date: Wed, 14 Jan 2026 12:01:04 -0800 Subject: [PATCH] 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 --- tools/src/misagent.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tools/src/misagent.rs b/tools/src/misagent.rs index 39c1971..f535908 100644 --- a/tools/src/misagent.rs +++ b/tools/src/misagent.rs @@ -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) { - 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 { + let path = sub_args + .next_argument::() + .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!(), } }