fix: fixed build on android (#1936)

This commit is contained in:
Aaron Chen
2025-04-12 11:06:25 +08:00
committed by GitHub
parent 5bf511eb83
commit 6d0862cb68

View File

@@ -56,7 +56,7 @@ impl TcpStream {
// This is a workaround for VPNService
#[cfg(target_os = "android")]
if !addr.ip().is_loopback() {
use std::{io::ErrorKind, time::Duration};
use std::time::Duration;
use tokio::time;
if let Some(ref path) = opts.vpn_protect_path {
@@ -332,7 +332,7 @@ pub async fn bind_outbound_udp_socket(bind_addr: &SocketAddr, config: &ConnectOp
// This is a workaround for VPNService
#[cfg(target_os = "android")]
{
use std::{io::ErrorKind, time::Duration};
use std::time::Duration;
use tokio::time;
if let Some(ref path) = config.vpn_protect_path {
@@ -397,10 +397,7 @@ fn set_bindtodevice<S: AsRawFd>(socket: &S, iface: &str) -> io::Result<()> {
cfg_if! {
if #[cfg(target_os = "android")] {
use std::{
io::ErrorKind,
path::Path,
};
use std::path::Path;
use tokio::io::AsyncReadExt;
use super::uds::UnixStream;