diff --git a/installer/src/main.rs b/installer/src/main.rs index ef332dc..03d1624 100644 --- a/installer/src/main.rs +++ b/installer/src/main.rs @@ -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, } +#[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?; } diff --git a/installer/src/orbic.rs b/installer/src/orbic.rs index 7f8dff5..5c2e2d5 100644 --- a/installer/src/orbic.rs +++ b/installer/src/orbic.rs @@ -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 { println!("Forcing a switch into the debug mode to enable ADB"); enable_command_mode()?;