mirror of https://github.com/2dust/v2rayN
Code clean
parent
81efd25e0a
commit
12be8bda52
|
@ -1,9 +1,9 @@
|
|||
<Application
|
||||
x:Class="v2rayN.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
ShutdownMode="OnExplicitShutdown"
|
||||
StartupUri="Views/MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
|
|
@ -177,4 +177,4 @@
|
|||
|
||||
#endregion global variable
|
||||
}
|
||||
}
|
||||
}
|
|
@ -205,7 +205,6 @@ namespace v2rayN.Handler
|
|||
};
|
||||
}
|
||||
|
||||
|
||||
LazyConfig.Instance.SetConfig(config);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -155,4 +155,4 @@ namespace v2rayN.Handler
|
|||
return coreConfigV2ray.GenerateClientSpeedtestConfigString(selecteds, out msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -62,7 +62,6 @@ namespace v2rayN.Handler
|
|||
Utils.SaveLog("Tun mode restart the core once");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -378,4 +378,4 @@ namespace v2rayN.Handler
|
|||
|
||||
#endregion Core Type
|
||||
}
|
||||
}
|
||||
}
|
|
@ -78,7 +78,7 @@ namespace v2rayN.Handler
|
|||
if (optionCount > 1)
|
||||
{
|
||||
options[1].m_Option = m_Option;
|
||||
options[1].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(strProxy); // !! remember to deallocate memory 1
|
||||
options[1].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(strProxy); // !! remember to deallocate memory 1
|
||||
// except for these addresses ...
|
||||
if (optionCount > 2)
|
||||
{
|
||||
|
@ -91,10 +91,10 @@ namespace v2rayN.Handler
|
|||
list.dwSize = Marshal.SizeOf(list);
|
||||
if (connectionName != null)
|
||||
{
|
||||
list.szConnection = Marshal.StringToHGlobalAuto(connectionName); // !! remember to deallocate memory 3
|
||||
list.szConnection = Marshal.StringToHGlobalAuto(connectionName); // !! remember to deallocate memory 3
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
list.szConnection = IntPtr.Zero;
|
||||
}
|
||||
list.dwOptionCount = options.Length;
|
||||
|
@ -141,7 +141,7 @@ namespace v2rayN.Handler
|
|||
}
|
||||
|
||||
// FREE the data ASAP
|
||||
if(list.szConnection != IntPtr.Zero) Marshal.FreeHGlobal(list.szConnection); // release mem 3
|
||||
if (list.szConnection != IntPtr.Zero) Marshal.FreeHGlobal(list.szConnection); // release mem 3
|
||||
if (optionCount > 1)
|
||||
{
|
||||
Marshal.FreeHGlobal(options[1].m_Value.m_StringPtr); // release mem 1
|
||||
|
@ -155,7 +155,7 @@ namespace v2rayN.Handler
|
|||
if (returnvalue != 0)
|
||||
{
|
||||
// throw the error codes, they might be helpful
|
||||
throw new ApplicationException($"Set Internet Proxy failed with error code: {Marshal.GetLastWin32Error()}" );
|
||||
throw new ApplicationException($"Set Internet Proxy failed with error code: {Marshal.GetLastWin32Error()}");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -256,8 +256,8 @@ namespace v2rayN.Handler
|
|||
|
||||
// Constants
|
||||
public const int RAS_MaxEntryName = 256;
|
||||
public const int MAX_PATH = 260; // Standard MAX_PATH value in Windows
|
||||
|
||||
public const int MAX_PATH = 260; // Standard MAX_PATH value in Windows
|
||||
}
|
||||
|
||||
#endregion WinInet structures
|
||||
|
@ -310,6 +310,7 @@ namespace v2rayN.Handler
|
|||
[DllImport("WinInet.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool InternetSetOption(IntPtr hInternet, InternetOption dwOption, IntPtr lpBuffer, int dwBufferLength);
|
||||
|
||||
[DllImport("Rasapi32.dll", CharSet = CharSet.Auto)]
|
||||
public static extern uint RasEnumEntries(
|
||||
string? reserved, // Reserved, must be null
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
using PacLib;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using v2rayN.Mode;
|
||||
using v2rayN.Properties;
|
||||
using v2rayN.Tool;
|
||||
|
||||
namespace v2rayN.Handler
|
||||
{
|
||||
|
@ -33,7 +28,6 @@ namespace v2rayN.Handler
|
|||
|
||||
static SysProxyHandle()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static bool UpdateSysProxy(Config config, bool forceDisable)
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
public ConstItem constItem { get; set; }
|
||||
public SpeedTestItem speedTestItem { get; set; }
|
||||
public Mux4SboxItem mux4SboxItem { get; set; }
|
||||
public HysteriaItem hysteriaItem { get; set; }
|
||||
public HysteriaItem hysteriaItem { get; set; }
|
||||
public List<InItem> inbound { get; set; }
|
||||
public List<KeyEventItem> globalHotkeys { get; set; }
|
||||
public List<CoreTypeItem> coreTypeItem { get; set; }
|
||||
|
|
|
@ -16,4 +16,4 @@
|
|||
hysteria2 = 26,
|
||||
v2rayN = 99
|
||||
}
|
||||
}
|
||||
}
|
|
@ -89,7 +89,7 @@ namespace v2rayN.ViewModels
|
|||
public ReactiveCommand<Unit, Unit> AddShadowsocksServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddSocksServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddTrojanServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddHysteria2ServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddHysteria2ServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddCustomServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddServerViaClipboardCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddServerViaScanCmd { get; }
|
||||
|
@ -148,11 +148,14 @@ namespace v2rayN.ViewModels
|
|||
public ReactiveCommand<Unit, Unit> CheckUpdateNCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> CheckUpdateV2flyCoreCmd { get; }
|
||||
|
||||
//public ReactiveCommand<Unit, Unit> CheckUpdateSagerNetCoreCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> CheckUpdateXrayCoreCmd { get; }
|
||||
|
||||
//public ReactiveCommand<Unit, Unit> CheckUpdateClashCoreCmd { get; }
|
||||
//public ReactiveCommand<Unit, Unit> CheckUpdateClashMetaCoreCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> CheckUpdateSingBoxCoreCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> CheckUpdateGeoCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> ReloadCmd { get; }
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<reactiveui:ReactiveWindow
|
||||
x:Class="v2rayN.Views.AddServerWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:resx="clr-namespace:v2rayN.Resx"
|
||||
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
||||
Title="{x:Static resx:ResUI.menuServers}"
|
||||
|
|
|
@ -328,21 +328,27 @@ namespace v2rayN.Views
|
|||
case Key.V:
|
||||
ViewModel?.AddServerViaClipboard();
|
||||
break;
|
||||
|
||||
case Key.P:
|
||||
ViewModel?.ServerSpeedtest(ESpeedActionType.Ping);
|
||||
break;
|
||||
|
||||
case Key.O:
|
||||
ViewModel?.ServerSpeedtest(ESpeedActionType.Tcping);
|
||||
break;
|
||||
|
||||
case Key.R:
|
||||
ViewModel?.ServerSpeedtest(ESpeedActionType.Realping);
|
||||
break;
|
||||
|
||||
case Key.S:
|
||||
_ = ViewModel?.ScanScreenTaskAsync();
|
||||
break;
|
||||
|
||||
case Key.T:
|
||||
ViewModel?.ServerSpeedtest(ESpeedActionType.Speedtest);
|
||||
break;
|
||||
|
||||
case Key.E:
|
||||
ViewModel?.ServerSpeedtest(ESpeedActionType.Mixedtest);
|
||||
break;
|
||||
|
@ -652,4 +658,4 @@ namespace v2rayN.Views
|
|||
|
||||
#endregion Drag and Drop
|
||||
}
|
||||
}
|
||||
}
|
|
@ -309,7 +309,6 @@
|
|||
Margin="{StaticResource SettingItemMargin}"
|
||||
Style="{StaticResource DefComboBox}" />
|
||||
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="15"
|
||||
Grid.Column="0"
|
||||
|
@ -335,10 +334,7 @@
|
|||
Margin="{StaticResource SettingItemMargin}"
|
||||
materialDesign:HintAssist.Hint="Down"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
|
||||
</StackPanel>
|
||||
|
||||
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
|
|
Loading…
Reference in New Issue