mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-23 04:42:08 +08:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3bdea4386 | ||
|
|
ce963d175a | ||
|
|
d289a608d9 | ||
|
|
8a5548af10 | ||
|
|
1d9bca13c8 | ||
|
|
6f19c3dfaa |
@@ -31,6 +31,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Install gh-aw extension
|
- name: Install gh-aw extension
|
||||||
uses: github/gh-aw-actions/setup-cli@96dc6d905bdbe195f719ddc990a3f5b59b751016 # v0.89.10
|
uses: github/gh-aw-actions/setup-cli@045beb2d14bda8d0c1f2e83b41527f63770d2855 # v0.89.15
|
||||||
with:
|
with:
|
||||||
version: v0.89.1
|
version: v0.89.1
|
||||||
|
|||||||
Generated
+4
-6
@@ -1140,7 +1140,6 @@ dependencies = [
|
|||||||
"clash-verge-media-unlock",
|
"clash-verge-media-unlock",
|
||||||
"clash-verge-signal",
|
"clash-verge-signal",
|
||||||
"clash_verge_service_ipc",
|
"clash_verge_service_ipc",
|
||||||
"core-foundation 0.9.4",
|
|
||||||
"criterion",
|
"criterion",
|
||||||
"dark-light",
|
"dark-light",
|
||||||
"deelevate",
|
"deelevate",
|
||||||
@@ -1175,7 +1174,6 @@ dependencies = [
|
|||||||
"smartstring",
|
"smartstring",
|
||||||
"socket2 0.6.5",
|
"socket2 0.6.5",
|
||||||
"sysproxy",
|
"sysproxy",
|
||||||
"system-configuration",
|
|
||||||
"tauri",
|
"tauri",
|
||||||
"tauri-build",
|
"tauri-build",
|
||||||
"tauri-plugin-autostart",
|
"tauri-plugin-autostart",
|
||||||
@@ -1267,8 +1265,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clash_verge_service_ipc"
|
name = "clash_verge_service_ipc"
|
||||||
version = "2.6.9"
|
version = "2.7.0"
|
||||||
source = "git+https://github.com/clash-verge-rev/clash-verge-service-ipc.git?tag=v2.6.9#94f7747bfa42dcbc0d945f5b4a0f72c4b2edc647"
|
source = "git+https://github.com/clash-verge-rev/clash-verge-service-ipc.git?tag=v2.7.0#19461f50181ce53bb9b6c4445b07b5eb4cded7ec"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"kode-bridge",
|
"kode-bridge",
|
||||||
@@ -7015,8 +7013,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sysproxy"
|
name = "sysproxy"
|
||||||
version = "0.7.0"
|
version = "0.7.1"
|
||||||
source = "git+https://github.com/clash-verge-rev/sysproxy-rs.git?branch=main#61118cab4878ce66b8cb12b467b682b493f20e6c"
|
source = "git+https://github.com/clash-verge-rev/sysproxy-rs.git?branch=main#44aaf00ec9c6779e5a461a55d882eddff7841c98"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iptools",
|
"iptools",
|
||||||
"log",
|
"log",
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
- 修复 Windows 系统代理设置偶发失败的问题
|
- 修复 Windows 系统代理设置偶发失败的问题
|
||||||
- 修复 Windows 关机被应用阻止的问题
|
- 修复 Windows 关机被应用阻止的问题
|
||||||
|
- 修复 Windows 服务模式下 TUN 使用 system/mixed 堆栈时无法接管流量的问题,防火墙放行规则改为自动添加
|
||||||
|
|
||||||
**🍎 macOS**
|
**🍎 macOS**
|
||||||
|
|
||||||
@@ -60,6 +61,7 @@
|
|||||||
- 新增代理页排查提示,方便检查订阅和内核状态
|
- 新增代理页排查提示,方便检查订阅和内核状态
|
||||||
- 新增订阅更新频率提醒,间隔不足 24 小时时提示
|
- 新增订阅更新频率提醒,间隔不足 24 小时时提示
|
||||||
- 新增启动失败提示,显示原因并保存启动日志
|
- 新增启动失败提示,显示原因并保存启动日志
|
||||||
|
- 新增 TUN「Mips」堆栈选项,需配合 mihomo v1.19.31 及以上内核
|
||||||
|
|
||||||
**🍎 macOS**
|
**🍎 macOS**
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ tracing = { workspace = true }
|
|||||||
tauri-plugin-devtools = { version = "2.1.0", optional = true }
|
tauri-plugin-devtools = { version = "2.1.0", optional = true }
|
||||||
tauri-plugin-mihomo = { git = "https://github.com/clash-verge-rev/tauri-plugin-mihomo", branch = "main" }
|
tauri-plugin-mihomo = { git = "https://github.com/clash-verge-rev/tauri-plugin-mihomo", branch = "main" }
|
||||||
async-trait = "0.1.92"
|
async-trait = "0.1.92"
|
||||||
clash_verge_service_ipc = { git = "https://github.com/clash-verge-rev/clash-verge-service-ipc.git", tag = "v2.6.9", version = "2.6.9", features = [
|
clash_verge_service_ipc = { git = "https://github.com/clash-verge-rev/clash-verge-service-ipc.git", tag = "v2.7.0", version = "2.7.0", features = [
|
||||||
"client",
|
"client",
|
||||||
] }
|
] }
|
||||||
arc-swap = "1.9.2"
|
arc-swap = "1.9.2"
|
||||||
@@ -115,8 +115,6 @@ libc = "0.2.189"
|
|||||||
|
|
||||||
[target.'cfg(target_os = "macos")'.dependencies]
|
[target.'cfg(target_os = "macos")'.dependencies]
|
||||||
tauri-plugin-wdio-webdriver = { version = "=1.3.0", optional = true }
|
tauri-plugin-wdio-webdriver = { version = "=1.3.0", optional = true }
|
||||||
core-foundation = "0.9"
|
|
||||||
system-configuration = "0.7"
|
|
||||||
objc2 = "0.6.4"
|
objc2 = "0.6.4"
|
||||||
objc2-foundation = { version = "0.3.2", features = [
|
objc2-foundation = { version = "0.3.2", features = [
|
||||||
"NSString",
|
"NSString",
|
||||||
|
|||||||
@@ -476,10 +476,7 @@ impl CoreManager {
|
|||||||
// rather than fail — only if the watcher is actually live; a user toggling while
|
// rather than fail — only if the watcher is actually live; a user toggling while
|
||||||
// offline still fails fast.
|
// offline still fails fast.
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
let watcher_armed = crate::core::network_watch::is_armed();
|
if crate::core::network_watch::is_armed()
|
||||||
#[cfg(not(target_os = "macos"))]
|
|
||||||
let watcher_armed = false;
|
|
||||||
if watcher_armed
|
|
||||||
&& !crate::utils::resolve::is_resolve_done()
|
&& !crate::utils::resolve::is_resolve_done()
|
||||||
&& Config::verge()
|
&& Config::verge()
|
||||||
.await
|
.await
|
||||||
|
|||||||
@@ -5,53 +5,35 @@
|
|||||||
|
|
||||||
use crate::{config::Config, core::CoreManager, core::proxy_control, process::AsyncHandler};
|
use crate::{config::Config, core::CoreManager, core::proxy_control, process::AsyncHandler};
|
||||||
use clash_verge_logging::{Type, logging};
|
use clash_verge_logging::{Type, logging};
|
||||||
use core_foundation::{
|
use parking_lot::Mutex;
|
||||||
array::CFArray,
|
use sysproxy::NetworkServiceMonitor;
|
||||||
runloop::{CFRunLoop, kCFRunLoopCommonModes},
|
|
||||||
string::CFString,
|
|
||||||
};
|
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
|
||||||
use system_configuration::dynamic_store::{SCDynamicStore, SCDynamicStoreBuilder, SCDynamicStoreCallBackContext};
|
|
||||||
|
|
||||||
/// Set once the subscription is live. Startup defers the proxy write to the watcher only then.
|
static MONITOR: Mutex<Option<NetworkServiceMonitor>> = Mutex::new(None);
|
||||||
static ARMED: AtomicBool = AtomicBool::new(false);
|
|
||||||
|
|
||||||
pub fn is_armed() -> bool {
|
pub fn is_armed() -> bool {
|
||||||
ARMED.load(Ordering::Acquire)
|
MONITOR.lock().is_some()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Subscribe to the primary IPv4 service on the main run loop. Armed on return, so a service
|
/// Subscribe to the primary IPv4 service on the main run loop. Armed on return, so a service
|
||||||
/// appearing from here on is never missed.
|
/// appearing from here on is never missed.
|
||||||
pub fn start() {
|
pub fn start() {
|
||||||
let store = SCDynamicStoreBuilder::new("clash-verge-rev")
|
match NetworkServiceMonitor::start(|| {
|
||||||
.callback_context(SCDynamicStoreCallBackContext {
|
AsyncHandler::spawn(reapply);
|
||||||
callout: on_change,
|
}) {
|
||||||
info: (),
|
Ok(monitor) => {
|
||||||
})
|
*MONITOR.lock() = Some(monitor);
|
||||||
.build();
|
logging!(
|
||||||
let keys = CFArray::from_CFTypes(&[CFString::from_static_string("State:/Network/Global/IPv4")]);
|
debug,
|
||||||
let Some(source) = store
|
Type::Core,
|
||||||
.filter(|store| store.set_notification_keys(&keys, &CFArray::<CFString>::from_CFTypes(&[])))
|
"network watch armed; the system proxy is re-applied on network changes"
|
||||||
.and_then(|store| store.create_run_loop_source())
|
);
|
||||||
else {
|
}
|
||||||
logging!(
|
Err(error) => logging!(
|
||||||
warn,
|
warn,
|
||||||
Type::Core,
|
Type::Core,
|
||||||
"could not watch the network; the proxy is not re-applied on changes"
|
"could not watch the network; the proxy is not re-applied on changes: {error}"
|
||||||
);
|
),
|
||||||
return;
|
}
|
||||||
};
|
|
||||||
CFRunLoop::get_main().add_source(&source, unsafe { kCFRunLoopCommonModes });
|
|
||||||
ARMED.store(true, Ordering::Release);
|
|
||||||
logging!(
|
|
||||||
debug,
|
|
||||||
Type::Core,
|
|
||||||
"network watch armed; the system proxy is re-applied on network changes"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn on_change(_: SCDynamicStore, _: CFArray<CFString>, (): &mut ()) {
|
|
||||||
AsyncHandler::spawn(reapply);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn reapply() {
|
async fn reapply() {
|
||||||
@@ -66,10 +48,17 @@ async fn reapply() {
|
|||||||
.latest_arc()
|
.latest_arc()
|
||||||
.enable_system_proxy
|
.enable_system_proxy
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
|| !proxy_control::has_network_service().await
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if !proxy_control::has_network_service().await {
|
||||||
|
logging!(
|
||||||
|
debug,
|
||||||
|
Type::Core,
|
||||||
|
"network changed without a service to write the proxy on; waiting for the next change"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if let Err(error) = manager.apply_proxy_after_start().await {
|
if let Err(error) = manager.apply_proxy_after_start().await {
|
||||||
logging!(
|
logging!(
|
||||||
warn,
|
warn,
|
||||||
|
|||||||
@@ -385,12 +385,11 @@ async fn current_service_proxy_config(verge: &IVerge) -> Result<MacosProxyConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Whether macOS has a network service to write the proxy on right now.
|
/// Whether macOS has a network service to write the proxy on right now.
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
pub async fn has_network_service() -> bool {
|
pub async fn has_network_service() -> bool {
|
||||||
tokio::task::spawn_blocking(
|
tokio::task::spawn_blocking(|| sysproxy::Sysproxy::has_network_service().unwrap_or(true))
|
||||||
|| !matches!(sysproxy::Sysproxy::get_system_proxy(), Err(error) if is_missing_network_service(&error)),
|
.await
|
||||||
)
|
.unwrap_or(true)
|
||||||
.await
|
|
||||||
.unwrap_or(true)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_reportable(error: &anyhow::Error) -> bool {
|
pub fn is_reportable(error: &anyhow::Error) -> bool {
|
||||||
|
|||||||
@@ -31,6 +31,13 @@ export const StackModeSwitch = (props: Props) => {
|
|||||||
>
|
>
|
||||||
Mixed
|
Mixed
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant={value?.toLowerCase() === 'mips' ? 'contained' : 'outlined'}
|
||||||
|
onClick={() => onChange?.('mips')}
|
||||||
|
sx={{ textTransform: 'capitalize' }}
|
||||||
|
>
|
||||||
|
Mips
|
||||||
|
</Button>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user