mirror of https://github.com/2dust/v2rayN
修改修改非管理员模式下tun模式启动逻辑;缩短自动隐藏时间
parent
02225ad0b8
commit
6d7385788e
|
@ -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"
|
||||
}
|
||||
]
|
|
@ -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(() =>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue