mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
feat: disable running with admin permission and check service mode
This commit is contained in:
@@ -19,6 +19,16 @@ fn main() -> std::io::Result<()> {
|
||||
println!("app exists");
|
||||
return Ok(());
|
||||
}
|
||||
// 权限检测
|
||||
if feat::check_permission().is_ok() {
|
||||
println!("please do not run with admin permission");
|
||||
tauri::api::dialog::blocking::message(
|
||||
None::<&tauri::Window>,
|
||||
"Please do not run with admin permission",
|
||||
"If you want to use Tun mode, please enable service mode instead",
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
|
||||
|
||||
Reference in New Issue
Block a user