mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-06-03 11:43:34 -07:00
cargo fmt run
This commit is contained in:
@@ -124,7 +124,7 @@ struct TmobileArgs {
|
|||||||
struct Uz801Args {
|
struct Uz801Args {
|
||||||
/// IP address for Uz801 admin interface, if custom.
|
/// IP address for Uz801 admin interface, if custom.
|
||||||
#[arg(long, default_value = "192.168.100.1")]
|
#[arg(long, default_value = "192.168.100.1")]
|
||||||
admin_ip: String
|
admin_ip: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
|
|||||||
@@ -15,11 +15,7 @@ use tokio::time::sleep;
|
|||||||
use crate::Uz801Args as Args;
|
use crate::Uz801Args as Args;
|
||||||
use crate::util::echo;
|
use crate::util::echo;
|
||||||
|
|
||||||
pub async fn install(
|
pub async fn install(Args { admin_ip }: Args) -> Result<()> {
|
||||||
Args {
|
|
||||||
admin_ip,
|
|
||||||
}: Args,
|
|
||||||
) -> Result<()> {
|
|
||||||
run_install(admin_ip).await
|
run_install(admin_ip).await
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,19 +52,22 @@ pub async fn activate_usb_debug(admin_ip: &str) -> Result<()> {
|
|||||||
let url = format!("http://{}/ajax", admin_ip);
|
let url = format!("http://{}/ajax", admin_ip);
|
||||||
let referer = format!("http://{}/usbdebug.html", admin_ip);
|
let referer = format!("http://{}/usbdebug.html", admin_ip);
|
||||||
let origin = format!("http://{}", admin_ip);
|
let origin = format!("http://{}", admin_ip);
|
||||||
|
|
||||||
let _handle = tokio::spawn(async move {
|
let _handle = tokio::spawn(async move {
|
||||||
let client = reqwest::Client::builder()
|
let client = reqwest::Client::builder()
|
||||||
.timeout(Duration::from_secs(5))
|
.timeout(Duration::from_secs(5))
|
||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let _response = client
|
let _response = client
|
||||||
.post(&url)
|
.post(&url)
|
||||||
.header("Accept", "application/json, text/javascript, */*; q=0.01")
|
.header("Accept", "application/json, text/javascript, */*; q=0.01")
|
||||||
.header("Accept-Encoding", "gzip, deflate")
|
.header("Accept-Encoding", "gzip, deflate")
|
||||||
.header("Referer", &referer)
|
.header("Referer", &referer)
|
||||||
.header("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8")
|
.header(
|
||||||
|
"Content-Type",
|
||||||
|
"application/x-www-form-urlencoded; charset=UTF-8",
|
||||||
|
)
|
||||||
.header("X-Requested-With", "XMLHttpRequest")
|
.header("X-Requested-With", "XMLHttpRequest")
|
||||||
.header("Origin", &origin)
|
.header("Origin", &origin)
|
||||||
.header("Connection", "keep-alive")
|
.header("Connection", "keep-alive")
|
||||||
|
|||||||
Reference in New Issue
Block a user