modified: src/client.rs
All checks were successful
gitea/Frida-android-native/pipeline/head This commit looks good
All checks were successful
gitea/Frida-android-native/pipeline/head This commit looks good
This commit is contained in:
parent
92fbc69b7e
commit
946af19d5b
@ -45,21 +45,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 lltx = ltx.clone();
|
||||
tokio::spawn(async move {
|
||||
loop {
|
||||
if let Ok(bytes) = rx.recv() {
|
||||
lltx.send("Write to tun.".as_bytes().to_vec());
|
||||
if let Err(e) = dev_writer.write_all(&bytes).await {
|
||||
lltx.send(format!("Writing error: {:?}", e).as_bytes().to_vec());
|
||||
}
|
||||
if let Err(e) = dev_writer.flush().await {
|
||||
lltx.send(format!("Flushing error: {:?}", e).as_bytes().to_vec());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let llltx = ltx.clone();
|
||||
tokio::spawn(async move {
|
||||
let mut buf = vec![0; 1400]; // mtu
|
||||
@ -133,6 +118,15 @@ pub async fn client_mode(client_config: ClientConfiguration, fd: i32, env: &JNIE
|
||||
|
||||
let s_cipher = cipher_shared.clone();
|
||||
loop {
|
||||
if let Ok(bytes) = rx.try_recv() {
|
||||
ltx.send("Write to tun.".as_bytes().to_vec());
|
||||
if let Err(e) = dev_writer.write_all(&bytes).await {
|
||||
ltx.send(format!("Writing error: {:?}", e).as_bytes().to_vec());
|
||||
}
|
||||
if let Err(e) = dev_writer.flush().await {
|
||||
ltx.send(format!("Flushing error: {:?}", e).as_bytes().to_vec());
|
||||
}
|
||||
}
|
||||
if let Ok(bytes) = lrx.try_recv() {
|
||||
FridaLib::traceFromNative(&env, String::from_utf8_lossy(&bytes).to_string());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user