diff --git a/v2rayN/v2rayN/Sample/tun_singbox_rules b/v2rayN/v2rayN/Sample/tun_singbox_rules index 528adb76..df1dc4ec 100644 --- a/v2rayN/v2rayN/Sample/tun_singbox_rules +++ b/v2rayN/v2rayN/Sample/tun_singbox_rules @@ -1,8 +1,4 @@ [ - { - "protocol": [ "dns" ], - "outbound": "dns_out" - }, { "network": "udp", "port": [ @@ -20,12 +16,5 @@ "ff00::/8" ], "outbound": "block" - }, - { - "source_ip_cidr": [ - "224.0.0.0/3", - "ff00::/8" - ], - "outbound": "block" } ] \ No newline at end of file diff --git a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs index eb622188..e1052645 100644 --- a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs @@ -1390,8 +1390,7 @@ namespace v2rayN.ViewModels { Process.Start(startInfo); MyAppExit(false); - } - catch { } + } catch { } } private void ImportOldGuiConfig() @@ -1621,6 +1620,13 @@ namespace v2rayN.ViewModels if (_config.tunModeItem.enableTun != EnableTun) { _config.tunModeItem.enableTun = EnableTun; + // 非管理员运行时tun模式开启逻辑修改 + if (EnableTun && !Utils.IsAdministrator()) + { + RebootAsAdmin(); + _config.tunModeItem.enableTun = EnableTun = false; + return; + } Reload(); } } @@ -1839,7 +1845,7 @@ namespace v2rayN.ViewModels if (_config.uiItem.autoHideStartup) { Observable.Range(1, 1) - .Delay(TimeSpan.FromSeconds(2)) + .Delay(TimeSpan.FromSeconds(0.5)) .Subscribe(x => { Application.Current.Dispatcher.Invoke(() => diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml.cs b/v2rayN/v2rayN/Views/MainWindow.xaml.cs index f1a51b0c..a363d8e6 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/MainWindow.xaml.cs @@ -212,8 +212,6 @@ namespace v2rayN.Views var IsAdministrator = Utils.IsAdministrator(); this.Title = $"{Utils.GetVersion()} - {(IsAdministrator ? ResUI.RunAsAdmin : ResUI.NotRunAsAdmin)}"; - spEnableTun.Visibility = IsAdministrator ? Visibility.Visible : Visibility.Collapsed; - //if (_config.uiItem.autoHideStartup) //{ // WindowState = WindowState.Minimized;