modified: src/main.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 02:54:09 +03:00
parent 476b55dc3e
commit bb07f66f5b
2 changed files with 6 additions and 4 deletions

View File

@ -5,7 +5,7 @@ use jni::{
sys::{jboolean, jchar, jint},
JNIEnv,
};
use std::{fs, net::{Ipv4Addr}, str};
use std::{error::Error, fs, net::Ipv4Addr, str};
use clap::{App, Arg, ArgMatches};
use env_logger::Builder;
use log::{error, LevelFilter};

View File

@ -2,7 +2,8 @@ use std::os::raw::c_int;
use log::{error, info, warn};
use crate::config::{ ServerConfiguration, ClientConfiguration, ObfsProtocol, ServerPeer };
use fast32::base32::RFC4648;
use crate::client;
use jni::sys::jint;
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");
@ -19,14 +20,15 @@ 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)?
};*/
-1
}
pub fn mobile_stop() -> c_int {
if let Ok(mut lock) = TUN_QUIT.lock() {
/*if let Ok(mut lock) = TUN_QUIT.lock() {
if let Some(shutdown_token) = lock.take() {
shutdown_token.cancel();
return 0;
}
}
}*/
-1
}