From bada3846dc8b7931cb401f45d6fdf089922b2804 Mon Sep 17 00:00:00 2001 From: Ember Date: Mon, 23 Mar 2026 17:16:23 -0700 Subject: [PATCH] Get rid of the 'verify' which is flakey --- installer/src/tmobile.rs | 4 ++-- installer/src/util.rs | 48 ++++----------------------------------- installer/src/wingtech.rs | 4 ++-- 3 files changed, 8 insertions(+), 48 deletions(-) diff --git a/installer/src/tmobile.rs b/installer/src/tmobile.rs index 941f720..f378780 100644 --- a/installer/src/tmobile.rs +++ b/installer/src/tmobile.rs @@ -13,7 +13,7 @@ use tokio::time::sleep; use crate::TmobileArgs as Args; use crate::output::{print, println}; -use crate::util::{reboot_and_verify, telnet_send_command, telnet_send_file}; +use crate::util::{reboot_device, telnet_send_command, telnet_send_file}; use crate::wingtech::start_telnet; pub async fn install( @@ -92,7 +92,7 @@ async fn run_install(admin_ip: String, admin_password: String) -> Result<()> { ) .await?; - reboot_and_verify(addr, "reboot", &admin_ip).await; + reboot_device(addr, "reboot", &admin_ip).await; Ok(()) } diff --git a/installer/src/util.rs b/installer/src/util.rs index 131dc55..c8e8a11 100644 --- a/installer/src/util.rs +++ b/installer/src/util.rs @@ -1,11 +1,9 @@ -use std::io::IsTerminal; use std::net::SocketAddr; use std::str::FromStr; use std::time::Duration; use anyhow::{Context, Result, bail}; use nusb::Device; -use reqwest::Client; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::TcpStream; use tokio::time::{sleep, timeout}; @@ -207,49 +205,11 @@ pub async fn send_file(admin_ip: &str, local_path: &str, remote_path: &str) -> R Ok(()) } -pub async fn reboot_and_verify(addr: SocketAddr, reboot_command: &str, admin_ip: &str) { - println!("Installation complete. Rebooting device..."); +pub async fn reboot_device(addr: SocketAddr, reboot_command: &str, admin_ip: &str) { + println!( + "Done. Rebooting device. After it's started up again, check out the web interface at http://{admin_ip}:8080" + ); let _ = telnet_send_command(addr, reboot_command, "", true).await; - - if std::io::stdin().is_terminal() { - println!( - "The device is rebooting. You will need to reconnect to the device's WiFi network." - ); - print!("Once you've reconnected, press Enter to verify the installation: "); - let mut input = String::new(); - let _ = std::io::stdin().read_line(&mut input); - - print!("Verifying rayhunter ... "); - sleep(Duration::from_secs(5)).await; - - let client = Client::new(); - let url = format!("http://{admin_ip}:8080/index.html"); - let mut success = false; - for _ in 0..5 { - if let Ok(resp) = client.get(&url).send().await - && resp.status().is_success() - { - success = true; - break; - } - sleep(Duration::from_secs(3)).await; - } - - if success { - println!("ok"); - println!("rayhunter is running at http://{admin_ip}:8080"); - } else { - println!("could not reach rayhunter."); - println!( - "The device may still be booting. Check http://{admin_ip}:8080 in a minute or two." - ); - } - } else { - println!( - "Device is rebooting. Check http://{}:8080 after it finishes booting.", - admin_ip - ); - } } /// General function to open a USB device diff --git a/installer/src/wingtech.rs b/installer/src/wingtech.rs index f175fc7..db7003f 100644 --- a/installer/src/wingtech.rs +++ b/installer/src/wingtech.rs @@ -1,6 +1,6 @@ use crate::WingtechArgs as Args; use crate::output::{print, println}; -use crate::util::{reboot_and_verify, telnet_send_command, telnet_send_file}; +use crate::util::{reboot_device, telnet_send_command, telnet_send_file}; use aes::Aes128; use aes::cipher::{BlockEncrypt, KeyInit, generic_array::GenericArray}; use anyhow::{Context, Result, bail}; @@ -141,7 +141,7 @@ async fn wingtech_run_install(admin_ip: String, admin_password: String) -> Resul ) .await?; - reboot_and_verify(addr, "shutdown -r -t 1 now", &admin_ip).await; + reboot_device(addr, "shutdown -r -t 1 now", &admin_ip).await; Ok(()) }