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