diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d678f19..6fa83864 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) * Remove unnecessary logging synchronisation #381 - @cyqsimon * Apply suggestions from new clippy lint clippy::assigning_clones #382 - @cyqsimon * Fix IPv6 socket detect logic #383 - @cyqsimon +* Support build for `target_os`` `android` #384 - @flxo ## Added * CI: include generated assets in release archive #359 - @cyqsimon diff --git a/Cargo.toml b/Cargo.toml index 102708e6..3f84c5b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ trust-dns-resolver = "0.23.2" unicode-width = "0.1.11" strum = { version = "0.26.2", features = ["derive"] } -[target.'cfg(target_os = "linux")'.dependencies] +[target.'cfg(any(target_os = "android", target_os = "linux"))'.dependencies] procfs = "0.16.0" [target.'cfg(any(target_os = "macos", target_os = "freebsd"))'.dependencies] diff --git a/src/os/mod.rs b/src/os/mod.rs index 7770de9e..434c9d7c 100644 --- a/src/os/mod.rs +++ b/src/os/mod.rs @@ -1,4 +1,4 @@ -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "android", target_os = "linux"))] mod linux; #[cfg(any(target_os = "macos", target_os = "freebsd"))] diff --git a/src/os/shared.rs b/src/os/shared.rs index fbe35599..bb0e532a 100644 --- a/src/os/shared.rs +++ b/src/os/shared.rs @@ -13,7 +13,7 @@ use tokio::runtime::Runtime; use crate::{network::dns, os::errors::GetInterfaceError, OsInputOutput}; -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "android", target_os = "linux"))] use crate::os::linux::get_open_sockets; #[cfg(any(target_os = "macos", target_os = "freebsd"))] use crate::os::lsof::get_open_sockets; @@ -220,7 +220,7 @@ fn eperm_message() -> &'static str { } #[inline] -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "android", target_os = "linux"))] fn eperm_message() -> &'static str { r#" Insufficient permissions to listen on network interface(s). You can work around