refact: show proxy settings on ios (#13423)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2025-11-04 17:55:04 +08:00
committed by GitHub
parent a903f710ea
commit 9b69c7e972
2 changed files with 7 additions and 6 deletions

View File

@@ -685,7 +685,7 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
setState(callback);
});
}),
if (!isIOS && !_hideNetwork && !_hideProxy)
if (!_hideNetwork && !_hideProxy)
SettingsTile(
title: Text(translate('Socks5/Http(s) Proxy')),
leading: Icon(Icons.network_ping),

View File

@@ -452,10 +452,8 @@ pub fn install_options() -> String {
pub fn get_socks() -> Vec<String> {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
let s = ipc::get_socks();
#[cfg(target_os = "android")]
#[cfg(any(target_os = "android", target_os = "ios"))]
let s = Config::get_socks();
#[cfg(target_os = "ios")]
let s: Option<config::Socks5Server> = None;
match s {
None => Vec::new(),
Some(s) => {
@@ -477,7 +475,7 @@ pub fn set_socks(proxy: String, username: String, password: String) {
};
#[cfg(not(any(target_os = "android", target_os = "ios")))]
ipc::set_socks(socks).ok();
#[cfg(target_os = "android")]
#[cfg(any(target_os = "android", target_os = "ios"))]
{
let _nat = crate::CheckTestNatType::new();
if socks.proxy.is_empty() {
@@ -485,9 +483,12 @@ pub fn set_socks(proxy: String, username: String, password: String) {
} else {
Config::set_socks(Some(socks));
}
crate::RendezvousMediator::restart();
log::info!("socks updated");
}
#[cfg(target_os = "android")]
{
crate::RendezvousMediator::restart();
}
}
#[inline]