修改修改非管理员模式下tun模式启动逻辑;缩短自动隐藏时间
This commit is contained in:
@@ -1,8 +1,4 @@
|
|||||||
[
|
[
|
||||||
{
|
|
||||||
"protocol": [ "dns" ],
|
|
||||||
"outbound": "dns_out"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"network": "udp",
|
"network": "udp",
|
||||||
"port": [
|
"port": [
|
||||||
@@ -20,12 +16,5 @@
|
|||||||
"ff00::/8"
|
"ff00::/8"
|
||||||
],
|
],
|
||||||
"outbound": "block"
|
"outbound": "block"
|
||||||
},
|
|
||||||
{
|
|
||||||
"source_ip_cidr": [
|
|
||||||
"224.0.0.0/3",
|
|
||||||
"ff00::/8"
|
|
||||||
],
|
|
||||||
"outbound": "block"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1390,8 +1390,7 @@ namespace v2rayN.ViewModels
|
|||||||
{
|
{
|
||||||
Process.Start(startInfo);
|
Process.Start(startInfo);
|
||||||
MyAppExit(false);
|
MyAppExit(false);
|
||||||
}
|
} catch { }
|
||||||
catch { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ImportOldGuiConfig()
|
private void ImportOldGuiConfig()
|
||||||
@@ -1621,6 +1620,13 @@ namespace v2rayN.ViewModels
|
|||||||
if (_config.tunModeItem.enableTun != EnableTun)
|
if (_config.tunModeItem.enableTun != EnableTun)
|
||||||
{
|
{
|
||||||
_config.tunModeItem.enableTun = EnableTun;
|
_config.tunModeItem.enableTun = EnableTun;
|
||||||
|
// <20>ǹ<EFBFBD><C7B9><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>ʱtunģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DFBC><EFBFBD>
|
||||||
|
if (EnableTun && !Utils.IsAdministrator())
|
||||||
|
{
|
||||||
|
RebootAsAdmin();
|
||||||
|
_config.tunModeItem.enableTun = EnableTun = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
Reload();
|
Reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1839,7 +1845,7 @@ namespace v2rayN.ViewModels
|
|||||||
if (_config.uiItem.autoHideStartup)
|
if (_config.uiItem.autoHideStartup)
|
||||||
{
|
{
|
||||||
Observable.Range(1, 1)
|
Observable.Range(1, 1)
|
||||||
.Delay(TimeSpan.FromSeconds(2))
|
.Delay(TimeSpan.FromSeconds(0.5))
|
||||||
.Subscribe(x =>
|
.Subscribe(x =>
|
||||||
{
|
{
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
|||||||
@@ -212,8 +212,6 @@ namespace v2rayN.Views
|
|||||||
var IsAdministrator = Utils.IsAdministrator();
|
var IsAdministrator = Utils.IsAdministrator();
|
||||||
this.Title = $"{Utils.GetVersion()} - {(IsAdministrator ? ResUI.RunAsAdmin : ResUI.NotRunAsAdmin)}";
|
this.Title = $"{Utils.GetVersion()} - {(IsAdministrator ? ResUI.RunAsAdmin : ResUI.NotRunAsAdmin)}";
|
||||||
|
|
||||||
spEnableTun.Visibility = IsAdministrator ? Visibility.Visible : Visibility.Collapsed;
|
|
||||||
|
|
||||||
//if (_config.uiItem.autoHideStartup)
|
//if (_config.uiItem.autoHideStartup)
|
||||||
//{
|
//{
|
||||||
// WindowState = WindowState.Minimized;
|
// WindowState = WindowState.Minimized;
|
||||||
|
|||||||
Reference in New Issue
Block a user