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
14
src/main.rs
14
src/main.rs
@ -25,11 +25,13 @@ 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_ENV: Option<&JNIEnv> = None;
|
static LOG_ENV: std::sync::Mutex<Option<&JNIEnv>> = std::sync::Mutex::new(None);
|
||||||
|
|
||||||
pub fn log2java(text: String) {
|
pub fn log2java(text: String) {
|
||||||
if let Some(env) = LOG_ENV {
|
if let Ok(mut l) = LOG_ENV.lock() {
|
||||||
jni::FridaLib::traceFromNative(env, text);
|
if l.is_some() {
|
||||||
|
jni::FridaLib::traceFromNative(l.unwrap(), text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +70,11 @@ mod jni {
|
|||||||
return Ok(-2);
|
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 {
|
let main_loop = async move {
|
||||||
/*if let Err(err) = {
|
/*if let Err(err) = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user