From 4717b6377555ab34cb265b79260b6dda35b565b9 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sun, 18 Feb 2024 11:02:50 +0800 Subject: [PATCH] Bug fix 4 mihomo --- v2rayN/v2rayN/Handler/LazyConfig.cs | 3 ++- v2rayN/v2rayN/Handler/UpdateHandle.cs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/v2rayN/v2rayN/Handler/LazyConfig.cs b/v2rayN/v2rayN/Handler/LazyConfig.cs index 89953f82..d57f4bfa 100644 --- a/v2rayN/v2rayN/Handler/LazyConfig.cs +++ b/v2rayN/v2rayN/Handler/LazyConfig.cs @@ -12,6 +12,7 @@ namespace v2rayN.Handler public static LazyConfig Instance => _instance.Value; private int? _statePort; + public int StatePort { get @@ -349,7 +350,7 @@ namespace v2rayN.Handler { coreType = ECoreType.mihomo, coreExes = new List { $"mihomo-windows-amd64{(Avx2.X64.IsSupported ? "" : "-compatible")}", "mihomo-windows-amd64-compatible", "mihomo-windows-amd64", "mihomo-windows-386", "mihomo", "clash" }, - arguments = "-f config.yaml", + arguments = "-f config.json", coreUrl = Global.MihomoCoreUrl, coreReleaseApiUrl = Global.MihomoCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl), match = "Mihomo", diff --git a/v2rayN/v2rayN/Handler/UpdateHandle.cs b/v2rayN/v2rayN/Handler/UpdateHandle.cs index bf541c0b..24d62a02 100644 --- a/v2rayN/v2rayN/Handler/UpdateHandle.cs +++ b/v2rayN/v2rayN/Handler/UpdateHandle.cs @@ -54,7 +54,7 @@ namespace v2rayN.Handler StartInfo = new ProcessStartInfo { FileName = "v2rayUpgrade.exe", - Arguments = fileName.AppendQuotes(), + Arguments = fileName.AppendQuotes(), WorkingDirectory = Utils.StartupPath() } }; @@ -392,6 +392,7 @@ namespace v2rayN.Handler case ECoreType.clash: case ECoreType.clash_meta: + case ECoreType.mihomo: version = Regex.Match(echo, $"v[0-9.]+").Groups[0].Value; break; @@ -453,6 +454,7 @@ namespace v2rayN.Handler } case ECoreType.clash: case ECoreType.clash_meta: + case ECoreType.mihomo: { curVersion = getCoreVersion(type); message = string.Format(ResUI.IsLatestCore, type, curVersion);