add adb shell command

This commit is contained in:
Cooper Quintin
2025-05-29 16:13:36 -07:00
committed by Cooper Quintin
parent 3c4cb56ce6
commit 1b244122df
2 changed files with 13 additions and 0 deletions
+6
View File
@@ -50,6 +50,8 @@ struct Util {
enum UtilSubCommand {
/// Send a serial command to the Orbic.
Serial(Serial),
/// Start an ADB shell
Shell(Shell),
/// Root the tplink and launch telnetd.
TplinkStartTelnet(TplinkStartTelnet),
}
@@ -68,6 +70,9 @@ struct Serial {
command: Vec<String>,
}
#[derive(Parser, Debug)]
struct Shell {}
async fn run() -> Result<(), Error> {
env_logger::Builder::from_env(Env::default().default_filter_or("off")).init();
let Args { command } = Args::parse();
@@ -94,6 +99,7 @@ async fn run() -> Result<(), Error> {
}
}
}
UtilSubCommand::Shell(_) => orbic::shell().await.context("\nFailed to open shell on Orbic RC400L")?,
UtilSubCommand::TplinkStartTelnet(options) => {
tplink::start_telnet(&options.admin_ip).await?;
}
+7
View File
@@ -54,6 +54,13 @@ pub async fn install() -> Result<()> {
Ok(())
}
pub async fn shell() -> Result<()> {
println!("opening shell");
let mut adb_device = get_adb().await?;
adb_device.shell(&mut std::io::stdin(), Box::new(std::io::stdout()))?;
Ok(())
}
async fn force_debug_mode() -> Result<ADBUSBDevice> {
println!("Forcing a switch into the debug mode to enable ADB");
enable_command_mode()?;