modified: src/main.rs
Some checks failed
gitea/Frida-android-native/pipeline/head There was a failure building this commit

This commit is contained in:
Michael Wain 2024-10-12 18:23:44 +03:00
parent 65c1eb6ec6
commit bca4b7e5f7

View File

@ -26,12 +26,14 @@ mod udp;
mod mobile;
static TUN_QUIT: std::sync::Mutex<Option<tokio_util::sync::CancellationToken>> = std::sync::Mutex::new(None);
static LOG_FILE: Option<File> = None;
static LOG_FILE: std::sync::Mutex<Option<File>> = std::sync::Mutex::new(None);
pub fn log2java(text: String) {
if let Some(mut file) = LOG_FILE {
file.write_all(text.as_bytes());
//jni::FridaLib::traceFromNative(l.unwrap(), text);
if let Ok(mut l) = LOG_FILE.lock() {
if l.is_some() {
l.unwrap().write_all(text.as_bytes());
//jni::FridaLib::traceFromNative(l.unwrap(), text);
}
}
}
@ -71,11 +73,16 @@ mod jni {
} else {
return Ok(-2);
}
LOG_FILE = Some(File::options()
if let Ok(mut l) = LOG_FILE.lock() {
if !l.is_some() {
*l = Some(File::options()
.read(false)
.write(true)
.open(&temp_file).unwrap());
}
}
let main_loop = async move {
/*if let Err(err) = {