mirror of https://github.com/2dust/v2rayN
Check for updates mihomo
parent
8ee5304148
commit
c9a278b4a2
|
@ -1,6 +1,5 @@
|
|||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reactive.Linq;
|
||||
using System.Text;
|
||||
using v2rayN.Enums;
|
||||
using v2rayN.Handler.CoreConfig;
|
||||
|
|
|
@ -336,7 +336,11 @@ namespace v2rayN.Handler
|
|||
arguments = "-f config.json",
|
||||
coreUrl = Global.MihomoCoreUrl,
|
||||
coreReleaseApiUrl = Global.MihomoCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
|
||||
coreDownloadUrl32 = Global.ClashMetaCoreUrl + "/download/{0}/mihomo-windows-386-{0}.zip",
|
||||
coreDownloadUrl64 = Global.ClashMetaCoreUrl + "/download/{0}/mihomo-windows-amd64-compatible-{0}.zip",
|
||||
coreDownloadUrlArm64 = Global.ClashMetaCoreUrl + "/download/{0}/mihomo-windows-arm64-{0}.zip",
|
||||
match = "Mihomo",
|
||||
versionArg = "-v",
|
||||
redirectInfo = true,
|
||||
});
|
||||
|
||||
|
|
|
@ -150,18 +150,10 @@ namespace v2rayN.ViewModels
|
|||
|
||||
//CheckUpdate
|
||||
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> CheckUpdateClashMetaCoreCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> CheckUpdateSingBoxCoreCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> CheckUpdateGeoCmd { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> ReloadCmd { get; }
|
||||
|
||||
[Reactive]
|
||||
|
@ -520,29 +512,17 @@ namespace v2rayN.ViewModels
|
|||
{
|
||||
CheckUpdateN();
|
||||
});
|
||||
//CheckUpdateV2flyCoreCmd = ReactiveCommand.Create(() =>
|
||||
//{
|
||||
// CheckUpdateCore(ECoreType.v2fly_v5);
|
||||
//});
|
||||
//CheckUpdateSagerNetCoreCmd = ReactiveCommand.Create(() =>
|
||||
//{
|
||||
// CheckUpdateCore(ECoreType.SagerNet);
|
||||
//});
|
||||
CheckUpdateXrayCoreCmd = ReactiveCommand.Create(() =>
|
||||
{
|
||||
CheckUpdateCore(ECoreType.Xray);
|
||||
CheckUpdateCore(ECoreType.Xray, null);
|
||||
});
|
||||
CheckUpdateClashMetaCoreCmd = ReactiveCommand.Create(() =>
|
||||
{
|
||||
CheckUpdateCore(ECoreType.mihomo, false);
|
||||
});
|
||||
//CheckUpdateClashCoreCmd = ReactiveCommand.Create(() =>
|
||||
//{
|
||||
// CheckUpdateCore(ECoreType.clash);
|
||||
//});
|
||||
//CheckUpdateClashMetaCoreCmd = ReactiveCommand.Create(() =>
|
||||
//{
|
||||
// CheckUpdateCore(ECoreType.clash_meta);
|
||||
//});
|
||||
CheckUpdateSingBoxCoreCmd = ReactiveCommand.Create(() =>
|
||||
{
|
||||
CheckUpdateCore(ECoreType.sing_box);
|
||||
CheckUpdateCore(ECoreType.sing_box, null);
|
||||
});
|
||||
CheckUpdateGeoCmd = ReactiveCommand.Create(() =>
|
||||
{
|
||||
|
@ -1473,7 +1453,7 @@ namespace v2rayN.ViewModels
|
|||
(new UpdateHandle()).CheckUpdateGuiN(_config, _updateUI, _config.guiItem.checkPreReleaseUpdate);
|
||||
}
|
||||
|
||||
private void CheckUpdateCore(ECoreType type)
|
||||
private void CheckUpdateCore(ECoreType type, bool? preRelease)
|
||||
{
|
||||
void _updateUI(bool success, string msg)
|
||||
{
|
||||
|
@ -1499,7 +1479,7 @@ namespace v2rayN.ViewModels
|
|||
}
|
||||
}
|
||||
}
|
||||
(new UpdateHandle()).CheckUpdateCore(type, _config, _updateUI, _config.guiItem.checkPreReleaseUpdate);
|
||||
(new UpdateHandle()).CheckUpdateCore(type, _config, _updateUI, preRelease ?? _config.guiItem.checkPreReleaseUpdate);
|
||||
}
|
||||
|
||||
private void CheckUpdateGeo()
|
||||
|
|
|
@ -37,8 +37,8 @@
|
|||
</Window.Resources>
|
||||
|
||||
<materialDesign:DialogHost
|
||||
Identifier="RootDialog"
|
||||
materialDesign:TransitionAssist.DisableTransitions="True"
|
||||
Identifier="RootDialog"
|
||||
SnackbarMessageQueue="{Binding ElementName=MainSnackbar, Path=MessageQueue}"
|
||||
Style="{StaticResource MaterialDesignEmbeddedDialogHost}">
|
||||
<Grid>
|
||||
|
@ -231,28 +231,14 @@
|
|||
x:Name="menuCheckUpdateN"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="V2rayN" />
|
||||
<!--<MenuItem
|
||||
x:Name="menuCheckUpdateV2flyCore"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="V2fly v5 Core" />
|
||||
<MenuItem
|
||||
x:Name="menuCheckUpdateSagerNetCore"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="SagerNet Core" />-->
|
||||
<MenuItem
|
||||
x:Name="menuCheckUpdateXrayCore"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="Xray Core" />
|
||||
<!--<Separator Margin="-40,5" />
|
||||
<MenuItem
|
||||
x:Name="menuCheckUpdateClashCore"
|
||||
x:Name="menuCheckUpdateMihomoCore"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="Clash Core" />
|
||||
<MenuItem
|
||||
x:Name="menuCheckUpdateClashMetaCore"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="Clash.Meta Core" />
|
||||
<Separator Margin="-40,5" />-->
|
||||
Header="Mihomo Core" />
|
||||
<MenuItem
|
||||
x:Name="menuCheckUpdateSingBoxCore"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
|
|
|
@ -144,11 +144,8 @@ namespace v2rayN.Views
|
|||
|
||||
//check update
|
||||
this.BindCommand(ViewModel, vm => vm.CheckUpdateNCmd, v => v.menuCheckUpdateN).DisposeWith(disposables);
|
||||
//this.BindCommand(ViewModel, vm => vm.CheckUpdateV2flyCoreCmd, v => v.menuCheckUpdateV2flyCore).DisposeWith(disposables);
|
||||
//this.BindCommand(ViewModel, vm => vm.CheckUpdateSagerNetCoreCmd, v => v.menuCheckUpdateSagerNetCore).DisposeWith(disposables);
|
||||
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.CheckUpdateClashMetaCoreCmd, v => v.menuCheckUpdateMihomoCore).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.CheckUpdateSingBoxCoreCmd, v => v.menuCheckUpdateSingBoxCore).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.CheckUpdateGeoCmd, v => v.menuCheckUpdateGeo).DisposeWith(disposables);
|
||||
|
||||
|
|
Loading…
Reference in New Issue