mirror of https://github.com/2dust/v2rayN
Add Check update for sing-box core
parent
6b12549cd9
commit
0808ec1612
|
@ -332,7 +332,13 @@ namespace v2rayN.Handler
|
|||
coreExes = new List<string> { "sing-box-client", "sing-box" },
|
||||
arguments = "run",
|
||||
coreUrl = Global.singboxCoreUrl,
|
||||
redirectInfo = true,
|
||||
redirectInfo = true,
|
||||
coreReleaseApiUrl = Global.singboxCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
||||
coreDownloadUrl32 = Global.singboxCoreUrl + "/download/{0}/sing-box-{1}-windows-386.zip",
|
||||
coreDownloadUrl64 = Global.singboxCoreUrl + "/download/{0}/sing-box-{1}-windows-amd64.zip",
|
||||
coreDownloadUrlArm64 = Global.singboxCoreUrl + "/download/{0}/sing-box-{1}-windows-arm64.zip",
|
||||
match = "sing-box",
|
||||
versionArg = "version",
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -403,7 +403,10 @@ namespace v2rayN.Handler
|
|||
break;
|
||||
case ECoreType.clash:
|
||||
case ECoreType.clash_meta:
|
||||
version = Regex.Match(echo, $"v[0-9.]+").Groups[0].Value;
|
||||
version = Regex.Match(echo, $"v[0-9.]+").Groups[0].Value;
|
||||
break;
|
||||
case ECoreType.sing_box:
|
||||
version = Regex.Match(echo, $"([0-9.]+)").Groups[1].Value;
|
||||
break;
|
||||
}
|
||||
return version;
|
||||
|
@ -468,15 +471,35 @@ namespace v2rayN.Handler
|
|||
switch (RuntimeInformation.ProcessArchitecture)
|
||||
{
|
||||
case Architecture.Arm64:
|
||||
url = string.Format(coreInfo.coreDownloadUrlArm64, version);
|
||||
url = coreInfo.coreDownloadUrlArm64;
|
||||
break;
|
||||
case Architecture.X86:
|
||||
url = string.Format(coreInfo.coreDownloadUrl32, version);
|
||||
url = coreInfo.coreDownloadUrl32;
|
||||
break;
|
||||
default:
|
||||
url = string.Format(coreInfo.coreDownloadUrl64, version);
|
||||
url = coreInfo.coreDownloadUrl64;
|
||||
break;
|
||||
}
|
||||
url = string.Format(url, version);
|
||||
break;
|
||||
}
|
||||
case ECoreType.sing_box:
|
||||
{
|
||||
curVersion = "v" + getCoreVersion(type);
|
||||
message = string.Format(ResUI.IsLatestCore, curVersion);
|
||||
switch (RuntimeInformation.ProcessArchitecture)
|
||||
{
|
||||
case Architecture.Arm64:
|
||||
url = coreInfo.coreDownloadUrlArm64;
|
||||
break;
|
||||
case Architecture.X86:
|
||||
url = coreInfo.coreDownloadUrl32;
|
||||
break;
|
||||
default:
|
||||
url = coreInfo.coreDownloadUrl64;
|
||||
break;
|
||||
}
|
||||
url = string.Format(url, version, version.Replace("v", ""));
|
||||
break;
|
||||
}
|
||||
case ECoreType.v2rayN:
|
||||
|
|
|
@ -133,6 +133,7 @@ namespace v2rayN.ViewModels
|
|||
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; }
|
||||
|
||||
|
||||
|
@ -472,6 +473,10 @@ namespace v2rayN.ViewModels
|
|||
{
|
||||
CheckUpdateCore(ECoreType.clash_meta);
|
||||
});
|
||||
CheckUpdateSingBoxCoreCmd = ReactiveCommand.Create(() =>
|
||||
{
|
||||
CheckUpdateCore(ECoreType.sing_box);
|
||||
});
|
||||
CheckUpdateGeoCmd = ReactiveCommand.Create(() =>
|
||||
{
|
||||
CheckUpdateGeo();
|
||||
|
|
|
@ -229,6 +229,11 @@
|
|||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="Clash.Meta Core" />
|
||||
<Separator Margin="-40,5" />
|
||||
<MenuItem
|
||||
x:Name="menuCheckUpdateSingBoxCore"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="SingBox Core" />
|
||||
<Separator Margin="-40,5" />
|
||||
<MenuItem
|
||||
x:Name="menuCheckUpdateGeo"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
|
|
|
@ -129,6 +129,7 @@ namespace v2rayN.Views
|
|||
this.BindCommand(ViewModel, vm => vm.CheckUpdateXrayCoreCmd, v => v.menuCheckUpdateXrayCore).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.CheckUpdateClashCoreCmd, v => v.menuCheckUpdateClashCore).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.CheckUpdateClashMetaCoreCmd, v => v.menuCheckUpdateClashMetaCore).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.CheckUpdateSingBoxCoreCmd, v => v.menuCheckUpdateSingBoxCore).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.CheckUpdateGeoCmd, v => v.menuCheckUpdateGeo).DisposeWith(disposables);
|
||||
|
||||
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables);
|
||||
|
|
Loading…
Reference in New Issue