modified: src/client.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
96c02d824b
commit
e481f4c2cf
@ -46,15 +46,6 @@ pub async fn client_mode(client_config: ClientConfiguration, fd: i32, env: &JNIE
|
|||||||
|
|
||||||
let cipher_shared: Arc<Mutex<Option<x25519_dalek::SharedSecret>>> = Arc::new(Mutex::new(None));
|
let cipher_shared: Arc<Mutex<Option<x25519_dalek::SharedSecret>>> = Arc::new(Mutex::new(None));
|
||||||
|
|
||||||
let m_env = Arc::new(Mutex::new(env));
|
|
||||||
tokio::spawn(async move {
|
|
||||||
while let Ok(bytes) = lrx.recv() {
|
|
||||||
let d_env = m_env.lock().await;
|
|
||||||
FridaLib::traceFromNative(&d_env, String::from_utf8_lossy(&bytes).to_string());
|
|
||||||
drop(d_env);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
while let Ok(bytes) = rx.recv() {
|
while let Ok(bytes) = rx.recv() {
|
||||||
ltx.send("Write to tun.".as_bytes().to_vec());
|
ltx.send("Write to tun.".as_bytes().to_vec());
|
||||||
@ -131,7 +122,12 @@ pub async fn client_mode(client_config: ClientConfiguration, fd: i32, env: &JNIE
|
|||||||
|
|
||||||
let s_cipher = cipher_shared.clone();
|
let s_cipher = cipher_shared.clone();
|
||||||
loop {
|
loop {
|
||||||
if let Ok(bytes) = mx.recv() {
|
tokio::select! {
|
||||||
|
b = lrx.recv() => {
|
||||||
|
FridaLib::traceFromNative(&env, String::from_utf8_lossy(&b.unwrap()).to_string());
|
||||||
|
}
|
||||||
|
b = mx.recv() => {
|
||||||
|
let bytes = b.unwrap();
|
||||||
let s_c = s_cipher.lock().await;
|
let s_c = s_cipher.lock().await;
|
||||||
|
|
||||||
if s_c.is_some() {
|
if s_c.is_some() {
|
||||||
@ -152,4 +148,5 @@ pub async fn client_mode(client_config: ClientConfiguration, fd: i32, env: &JNIE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user