cargo fmt run

This commit is contained in:
Andrej
2025-08-05 14:21:19 -04:00
parent 5184c6138d
commit f4522dbe3d

View File

@@ -183,7 +183,10 @@ fn install_file(adb_device: &mut ADBUSBDevice, dest: &str, payload: &[u8]) -> Re
// Verify with md5sum
let mut buf = Vec::<u8>::new();
if adb_device.shell_command(&["busybox", "md5sum", &push_tmp_path], &mut buf).is_ok() {
if adb_device
.shell_command(&["busybox", "md5sum", &push_tmp_path], &mut buf)
.is_ok()
{
let output = String::from_utf8_lossy(&buf);
if output.contains(&format!("{file_hash:x}")) {
// Verification successful, move to final destination
@@ -196,9 +199,14 @@ fn install_file(adb_device: &mut ADBUSBDevice, dest: &str, payload: &[u8]) -> Re
// Verification failed, clean up and retry
if attempt < MAX_RETRIES {
println!("MD5 verification failed on attempt {}, retrying...", attempt);
println!(
"MD5 verification failed on attempt {}, retrying...",
attempt
);
let mut buf = Vec::<u8>::new();
adb_device.shell_command(&["rm", "-f", &push_tmp_path], &mut buf).ok();
adb_device
.shell_command(&["rm", "-f", &push_tmp_path], &mut buf)
.ok();
}
}