mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-06-12 07:43:30 -07:00
add adb shell command
This commit is contained in:
committed by
Cooper Quintin
parent
3c4cb56ce6
commit
1b244122df
@@ -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?;
|
||||
}
|
||||
|
||||
@@ -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()?;
|
||||
|
||||
Reference in New Issue
Block a user