Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47dce69aa4 | ||
|
|
3aeaadade6 | ||
|
|
162b3ab29c | ||
|
|
b8848823cd | ||
|
|
378f350c52 | ||
|
|
e7231d33b3 | ||
|
|
7c633374f6 |
@@ -847,7 +847,7 @@ namespace v2rayN.Forms
|
||||
{
|
||||
//刷新
|
||||
RefreshServers();
|
||||
LoadV2ray();
|
||||
//LoadV2ray();
|
||||
UI.Show(UIRes.I18N("SuccessfullyImportedCustomServer"));
|
||||
}
|
||||
else
|
||||
@@ -1136,7 +1136,7 @@ namespace v2rayN.Forms
|
||||
{
|
||||
//TODO: reload is not good.
|
||||
RefreshServers();
|
||||
LoadV2ray();
|
||||
//LoadV2ray();
|
||||
}
|
||||
}
|
||||
private void menuSelectAll_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace v2rayN.Handler
|
||||
// TODO: 统计配置
|
||||
statistic(config, ref v2rayConfig);
|
||||
|
||||
Utils.ToJsonFile(v2rayConfig, fileName);
|
||||
Utils.ToJsonFile(v2rayConfig, fileName, false);
|
||||
|
||||
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
|
||||
}
|
||||
@@ -624,8 +624,7 @@ namespace v2rayN.Handler
|
||||
//ws
|
||||
case "ws":
|
||||
WsSettings wsSettings = new WsSettings
|
||||
{
|
||||
connectionReuse = true
|
||||
{
|
||||
};
|
||||
|
||||
string path = config.path();
|
||||
@@ -689,7 +688,6 @@ namespace v2rayN.Handler
|
||||
{
|
||||
TcpSettings tcpSettings = new TcpSettings
|
||||
{
|
||||
connectionReuse = true,
|
||||
header = new Header
|
||||
{
|
||||
type = config.headerType()
|
||||
@@ -919,7 +917,7 @@ namespace v2rayN.Handler
|
||||
//传出设置
|
||||
ServerOutbound(config, ref v2rayConfig);
|
||||
|
||||
Utils.ToJsonFile(v2rayConfig, fileName);
|
||||
Utils.ToJsonFile(v2rayConfig, fileName, false);
|
||||
|
||||
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
lstV2ray = new List<string>
|
||||
{
|
||||
"xray",
|
||||
"wv2ray",
|
||||
"v2ray"
|
||||
};
|
||||
@@ -161,7 +162,7 @@ namespace v2rayN.Handler
|
||||
private string V2rayFindexe() {
|
||||
//查找v2ray文件是否存在
|
||||
string fileName = string.Empty;
|
||||
lstV2ray.Reverse();
|
||||
//lstV2ray.Reverse();
|
||||
foreach (string name in lstV2ray)
|
||||
{
|
||||
string vName = string.Format("{0}.exe", name);
|
||||
|
||||
@@ -420,11 +420,7 @@ namespace v2rayN.Mode
|
||||
}
|
||||
|
||||
public class TcpSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否重用 TCP 连接
|
||||
/// </summary>
|
||||
public bool connectionReuse { get; set; }
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据包头部伪装设置
|
||||
/// </summary>
|
||||
@@ -488,12 +484,7 @@ namespace v2rayN.Mode
|
||||
}
|
||||
|
||||
public class WsSettings
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public bool connectionReuse { get; set; }
|
||||
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
@@ -32,4 +32,4 @@ using System.Runtime.InteropServices;
|
||||
// 方法是按如下所示使用“*”:
|
||||
//[assembly: AssemblyVersion("1.0.*")]
|
||||
//[assembly: AssemblyVersion("1.0.0")]
|
||||
[assembly: AssemblyFileVersion("3.27")]
|
||||
[assembly: AssemblyFileVersion("3.29")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
geosite:category-ads,
|
||||
geosite:category-ads-all,
|
||||
|
||||
@@ -119,16 +119,22 @@ namespace v2rayN
|
||||
/// <param name="obj"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
public static int ToJsonFile(Object obj, string filePath)
|
||||
public static int ToJsonFile(Object obj, string filePath, bool nullValue = true)
|
||||
{
|
||||
int result;
|
||||
try
|
||||
{
|
||||
using (StreamWriter file = File.CreateText(filePath))
|
||||
{
|
||||
//JsonSerializer serializer = new JsonSerializer();
|
||||
JsonSerializer serializer = new JsonSerializer() { Formatting = Formatting.Indented };
|
||||
//JsonSerializer serializer = new JsonSerializer() { Formatting = Formatting.Indented, NullValueHandling = NullValueHandling.Ignore };
|
||||
JsonSerializer serializer;
|
||||
if (nullValue)
|
||||
{
|
||||
serializer = new JsonSerializer() { Formatting = Formatting.Indented };
|
||||
}
|
||||
else
|
||||
{
|
||||
serializer = new JsonSerializer() { Formatting = Formatting.Indented, NullValueHandling = NullValueHandling.Ignore };
|
||||
}
|
||||
|
||||
serializer.Serialize(file, obj);
|
||||
}
|
||||
@@ -800,7 +806,7 @@ namespace v2rayN
|
||||
public static string GetTempPath(string filename)
|
||||
{
|
||||
return Path.Combine(GetTempPath(), filename);
|
||||
}
|
||||
}
|
||||
|
||||
public static string UnGzip(byte[] buf)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user