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
17
src/main.rs
17
src/main.rs
@ -26,12 +26,14 @@ mod udp;
|
|||||||
mod mobile;
|
mod mobile;
|
||||||
|
|
||||||
static TUN_QUIT: std::sync::Mutex<Option<tokio_util::sync::CancellationToken>> = std::sync::Mutex::new(None);
|
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) {
|
pub fn log2java(text: String) {
|
||||||
if let Some(mut file) = LOG_FILE {
|
if let Ok(mut l) = LOG_FILE.lock() {
|
||||||
file.write_all(text.as_bytes());
|
if l.is_some() {
|
||||||
//jni::FridaLib::traceFromNative(l.unwrap(), text);
|
l.unwrap().write_all(text.as_bytes());
|
||||||
|
//jni::FridaLib::traceFromNative(l.unwrap(), text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,10 +74,15 @@ mod jni {
|
|||||||
return Ok(-2);
|
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)
|
.read(false)
|
||||||
.write(true)
|
.write(true)
|
||||||
.open(&temp_file).unwrap());
|
.open(&temp_file).unwrap());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
let main_loop = async move {
|
let main_loop = async move {
|
||||||
/*if let Err(err) = {
|
/*if let Err(err) = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user