mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-26 15:39:59 -07:00
cargo fmt run
This commit is contained in:
@@ -183,7 +183,10 @@ fn install_file(adb_device: &mut ADBUSBDevice, dest: &str, payload: &[u8]) -> Re
|
|||||||
|
|
||||||
// Verify with md5sum
|
// Verify with md5sum
|
||||||
let mut buf = Vec::<u8>::new();
|
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);
|
let output = String::from_utf8_lossy(&buf);
|
||||||
if output.contains(&format!("{file_hash:x}")) {
|
if output.contains(&format!("{file_hash:x}")) {
|
||||||
// Verification successful, move to final destination
|
// 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
|
// Verification failed, clean up and retry
|
||||||
if attempt < MAX_RETRIES {
|
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();
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user