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
f249b29561
commit
e4ba404259
16
src/main.rs
16
src/main.rs
@ -25,11 +25,13 @@ mod udp;
|
||||
mod mobile;
|
||||
|
||||
static TUN_QUIT: std::sync::Mutex<Option<tokio_util::sync::CancellationToken>> = std::sync::Mutex::new(None);
|
||||
static LOG_ENV: Option<&JNIEnv> = None;
|
||||
static LOG_ENV: std::sync::Mutex<Option<&JNIEnv>> = std::sync::Mutex::new(None);
|
||||
|
||||
pub fn log2java(text: String) {
|
||||
if let Some(env) = LOG_ENV {
|
||||
jni::FridaLib::traceFromNative(env, text);
|
||||
if let Ok(mut l) = LOG_ENV.lock() {
|
||||
if l.is_some() {
|
||||
jni::FridaLib::traceFromNative(l.unwrap(), text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,8 +69,12 @@ mod jni {
|
||||
} else {
|
||||
return Ok(-2);
|
||||
}
|
||||
|
||||
LOG_ENV = Some(env);
|
||||
|
||||
if let Ok(mut l) = LOG_ENV.lock() {
|
||||
if !l.is_some() {
|
||||
*l = Some(env);
|
||||
}
|
||||
}
|
||||
|
||||
let main_loop = async move {
|
||||
/*if let Err(err) = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user