Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
162b3ab29c | ||
|
|
b8848823cd | ||
|
|
378f350c52 | ||
|
|
e7231d33b3 | ||
|
|
7c633374f6 |
@@ -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());
|
||||
}
|
||||
@@ -919,7 +919,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);
|
||||
|
||||
@@ -32,4 +32,4 @@ using System.Runtime.InteropServices;
|
||||
// 方法是按如下所示使用“*”:
|
||||
//[assembly: AssemblyVersion("1.0.*")]
|
||||
//[assembly: AssemblyVersion("1.0.0")]
|
||||
[assembly: AssemblyFileVersion("3.27")]
|
||||
[assembly: AssemblyFileVersion("3.28")]
|
||||
|
||||
@@ -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