modified: src/main.rs
Some checks failed
gitea/Frida-android-native/pipeline/head There was a failure building this commit
Some checks failed
gitea/Frida-android-native/pipeline/head There was a failure building this commit
This commit is contained in:
parent
65c1eb6ec6
commit
bca4b7e5f7
19
src/main.rs
19
src/main.rs
@ -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) = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user