Skip to content

kpcyrd/forensic-adb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

forensic-adb

Tokio based client library for the Android Debug Bridge (adb) based on mozdevice for Rust.

Documentation

This code has been extracted from mozilla-central/testing/mozbase/rust/mozdevice and ported to async Rust. It also removes root detection so no commands are executed on the remote device by default.

use forensic_adb::{AndroidStorageInput, DeviceError, Host};

#[tokio::main]
async fn main() -> Result<(), DeviceError> {
    let host = Host::default();

    let devices = host.devices::<Vec<_>>().await?;
    println!("Found devices: {:?}", devices);

    let device = host
        .device_or_default(Option::<&String>::None, AndroidStorageInput::default())
        .await?;
    println!("Selected device: {:?}", device);

    let output = device.execute_host_shell_command("id").await?;
    println!("Received response: {:?}", output);

    Ok(())
}

License

Mozilla Public License (MPL-2.0)

About

Tokio based client library for the Android Debug Bridge (adb) based on mozdevice

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages