pull/4811/head
2dust 2024-03-09 14:30:39 +08:00
parent 70584aff9d
commit 186d995919
5 changed files with 7 additions and 62 deletions

View File

@ -8,9 +8,6 @@ namespace v2rayN
public const string GithubUrl = "https://github.com";
public const string GithubApiUrl = "https://api.github.com/repos";
public const string V2rayWebsiteUrl = @"https://www.v2fly.org/";
public const string AboutUrl = @"https://github.com/2dust/v2rayN";
public const string UpdateUrl = AboutUrl + @"/releases";
public const string V2flyCoreUrl = "https://github.com/v2fly/v2ray-core/releases";
public const string XrayCoreUrl = "https://github.com/XTLS/Xray-core/releases";
public const string SagerNetCoreUrl = "https://github.com/SagerNet/v2ray-core/releases";
@ -23,7 +20,6 @@ namespace v2rayN
public const string TuicCoreUrl = "https://github.com/EAimTY/tuic/releases";
public const string SingboxCoreUrl = "https://github.com/SagerNet/sing-box/releases";
public const string GeoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat";
public const string SingboxGeoUrl = "https://github.com/soffchen/sing-{0}/releases/latest/download/{0}.db";
public const string SpeedPingTestUrl = @"https://www.google.com/generate_204";
public const string JuicityCoreUrl = "https://github.com/juicity/juicity/releases";
public const string CustomRoutingListUrl = @"https://raw.githubusercontent.com/2dust/v2rayCustomRoutingList/master/";
@ -57,16 +53,13 @@ namespace v2rayN
public const string StreamSecurity = "tls";
public const string StreamSecurityReality = "reality";
public const string Loopback = "127.0.0.1";
public const string InboundAPITagName = "api";
public const string InboundAPIProtocol = "dokodemo-door";
public const string HttpProtocol = "http://";
public const string HttpsProtocol = "https://";
public const string UserEMail = "t@t.tt";
public const string MyRegPath = "Software\\v2rayNGUI";
public const string AutoRunRegPath = @"Software\Microsoft\Windows\CurrentVersion\Run";
public const string AutoRunName = "v2rayNAutoRun";
public const string MyRegKeyLanguage = "CurrentLanguage";
public const string CustomIconName = "v2rayN.ico";
public const string IEProxyExceptions = "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*";
public const string RoutingRuleComma = "<COMMA>";

View File

@ -764,7 +764,7 @@ namespace v2rayN.Handler
{
if (_config.guiItem.enableStatistics)
{
string tag = Global.InboundAPITagName;
string tag = EInboundProtocol.api.ToString();
API4Ray apiObj = new();
Policy4Ray policyObj = new();
SystemPolicy4Ray policySystemSetting = new();

View File

@ -51,18 +51,18 @@ namespace v2rayN.Handler
public System.Windows.Media.ImageSource GetAppIcon(Config config)
{
int index = 1;
switch ((int)config.sysProxyType)
switch (config.sysProxyType)
{
case 0:
case ESysProxyType.ForcedClear:
index = 1;
break;
case 1:
case 3:
case ESysProxyType.ForcedChange:
case ESysProxyType.Pac:
index = 2;
break;
case 2:
case ESysProxyType.Unchanged:
index = 3;
break;
}

View File

@ -587,7 +587,7 @@ namespace v2rayN.Handler
}
switch (i.streamSecurity)
{
case "tls":
case Global.StreamSecurity:
break;
default:

View File

@ -602,54 +602,6 @@ namespace v2rayN.Handler
await AskToDownload(downloadHandle, url, false);
}
private async Task UpdateGeoFile4Singbox(string geoName, Config config, bool needStop, Action<bool, string> update)
{
_config = config;
_updateFunc = update;
var url = string.Format(Global.SingboxGeoUrl, geoName);
DownloadHandle downloadHandle = new();
downloadHandle.UpdateCompleted += async (sender2, args) =>
{
if (args.Success)
{
_updateFunc(false, string.Format(ResUI.MsgDownloadGeoFileSuccessfully, geoName));
var coreHandler = Locator.Current.GetService<CoreHandler>();
try
{
if (needStop)
{
coreHandler?.CoreStop();
await Task.Delay(3000);
}
string fileName = Utile.GetTempPath(Utile.GetDownloadFileName(url));
if (File.Exists(fileName))
{
string targetPath = Utile.GetConfigPath($"{geoName}.db");
File.Copy(fileName, targetPath, true);
File.Delete(fileName);
}
if (needStop) coreHandler?.LoadCore();
}
catch (Exception ex)
{
_updateFunc(false, ex.Message);
}
}
else
{
_updateFunc(false, args.Msg);
}
};
downloadHandle.Error += (sender2, args) =>
{
_updateFunc(false, args.GetException().Message);
};
await AskToDownload(downloadHandle, url, false);
}
#endregion private
}
}