Merge branch 'master' into xpc-rewrite

This commit is contained in:
Jackson Coxson
2025-05-26 20:39:24 -06:00
committed by GitHub
6 changed files with 267 additions and 14 deletions

View File

@@ -43,7 +43,8 @@ async fn main() {
Command::new("pull")
.about("Pulls a log")
.arg(Arg::new("path").required(true).index(1))
.arg(Arg::new("save").required(true).index(2)),
.arg(Arg::new("save").required(true).index(2))
.arg(Arg::new("dir").required(false).index(3)),
)
.get_matches();
@@ -68,8 +69,12 @@ async fn main() {
.await
.expect("Unable to connect to misagent");
if let Some(_matches) = matches.subcommand_matches("list") {
let res = crash_client.ls().await.expect("Failed to read dir");
if let Some(matches) = matches.subcommand_matches("list") {
let dir_path: Option<&String> = matches.get_one("dir");
let res = crash_client
.ls(dir_path.map(|x| x.as_str()))
.await
.expect("Failed to read dir");
println!("{res:#?}");
} else if matches.subcommand_matches("flush").is_some() {
flush_reports(&*provider).await.expect("Failed to flush");

View File

@@ -39,6 +39,11 @@ async fn main() {
.subcommand(Command::new("lookup").about("Gets the apps on the device"))
.subcommand(Command::new("browse").about("Browses the apps on the device"))
.subcommand(Command::new("check_capabilities").about("Check the capabilities"))
.subcommand(
Command::new("install")
.about("Install an app in the AFC jail")
.arg(Arg::new("path")),
)
.get_matches();
if matches.get_flag("about") {
@@ -78,6 +83,26 @@ async fn main() {
.check_capabilities_match(Vec::new(), None)
.await
.expect("check failed");
} else if let Some(matches) = matches.subcommand_matches("install") {
let path: &String = match matches.get_one("path") {
Some(p) => p,
None => {
eprintln!("No path passed, pass -h for help");
return;
}
};
instproxy_client
.install_with_callback(
path,
None,
async |(percentage, _)| {
println!("Installing: {percentage}");
},
(),
)
.await
.expect("Failed to install")
} else {
eprintln!("Invalid usage, pass -h for help");
}