From bb07f66f5bee550e5cb542084c82c3adc5bc149a Mon Sep 17 00:00:00 2001 From: alterdekim Date: Sat, 5 Oct 2024 02:54:09 +0300 Subject: [PATCH] modified: src/main.rs modified: src/mobile.rs --- src/main.rs | 2 +- src/mobile.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 32a1dde..255cf14 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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}; diff --git a/src/mobile.rs b/src/mobile.rs index 836802b..5afac3a 100644 --- a/src/mobile.rs +++ b/src/mobile.rs @@ -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 } \ No newline at end of file