modified: src/client.rs
Some checks failed
gitea/Frida-android-native/pipeline/head There was a failure building this commit

modified:   src/mobile.rs
This commit is contained in:
Michael Wain 2024-10-05 03:21:42 +03:00
parent a809fb2f62
commit aad0dda63b
2 changed files with 5 additions and 7 deletions

View File

@ -17,7 +17,7 @@ use crate::udp::{UDPVpnPacket, UDPVpnHandshake, UDPSerializable};
use network_interface::NetworkInterface; use network_interface::NetworkInterface;
use network_interface::NetworkInterfaceConfig; use network_interface::NetworkInterfaceConfig;
pub async fn client_mode(client_config: ClientConfiguration, fd: i32) { pub async fn client_mode(client_config: ClientConfiguration, fd: i32) -> i16 {
info!("Starting client..."); info!("Starting client...");
let sock = UdpSocket::bind("0.0.0.0:25565").await.unwrap(); let sock = UdpSocket::bind("0.0.0.0:25565").await.unwrap();
@ -136,10 +136,9 @@ pub async fn client_mode(client_config: ClientConfiguration, fd: i32) {
} }
}*/ }*/
let mut buf = vec![0; 2048]; let mut buf = vec![0; 2048];
loop { while let Ok(n) = dev.read(&mut buf) {
while let Ok(n) = dev.read(&mut buf) { info!("Read from tun. {:?} bytes", n);
info!("Read from tun. {:?} bytes", n);
}
} }
info!("end."); info!("end.");
-2
} }

View File

@ -8,7 +8,7 @@ use jni::sys::jint;
pub fn mobile_run(cfg_raw: String, close_fd_on_drop: bool, tun_fd: jint) -> c_int { pub fn mobile_run(cfg_raw: String, close_fd_on_drop: bool, tun_fd: jint) -> c_int {
let config: ClientConfiguration = serde_yaml::from_slice(RFC4648.decode(cfg_raw.as_bytes()).unwrap().as_slice()).expect("Bad client config file structure"); let config: ClientConfiguration = serde_yaml::from_slice(RFC4648.decode(cfg_raw.as_bytes()).unwrap().as_slice()).expect("Bad client config file structure");
client::client_mode(config, tun_fd).await; client::client_mode(config, tun_fd).await
/*let block = async move { /*let block = async move {
let mut config = tun2::Configuration::default(); let mut config = tun2::Configuration::default();
@ -20,7 +20,6 @@ pub fn mobile_run(cfg_raw: String, close_fd_on_drop: bool, tun_fd: jint) -> c_in
join_handle.await.map_err(std::io::Error::from)? join_handle.await.map_err(std::io::Error::from)?
};*/ };*/
-1
} }
pub fn mobile_stop() -> c_int { pub fn mobile_stop() -> c_int {