Browse Source

Add Portable Mode for mihomo

pull/5636/head
2dust 3 months ago
parent
commit
f10f7b6268
  1. 11
      v2rayN/ServiceLib/Handler/CoreInfoHandler.cs

11
v2rayN/ServiceLib/Handler/CoreInfoHandler.cs

@ -106,7 +106,7 @@ namespace ServiceLib.Handler
{ {
coreType = ECoreType.clash, coreType = ECoreType.clash,
coreExes = new List<string> { "clash-windows-amd64-v3", "clash-windows-amd64", "clash-windows-386", "clash" }, coreExes = new List<string> { "clash-windows-amd64-v3", "clash-windows-amd64", "clash-windows-386", "clash" },
arguments = "-f config.json", arguments = "-f config.json" + PortableMode(),
coreUrl = Global.ClashCoreUrl, coreUrl = Global.ClashCoreUrl,
coreReleaseApiUrl = Global.ClashCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl), coreReleaseApiUrl = Global.ClashCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
match = "v", match = "v",
@ -118,7 +118,7 @@ namespace ServiceLib.Handler
{ {
coreType = ECoreType.clash_meta, coreType = ECoreType.clash_meta,
coreExes = new List<string> { "Clash.Meta-windows-amd64-compatible", "Clash.Meta-windows-amd64", "Clash.Meta-windows-386", "Clash.Meta", "clash" }, coreExes = new List<string> { "Clash.Meta-windows-amd64-compatible", "Clash.Meta-windows-amd64", "Clash.Meta-windows-386", "Clash.Meta", "clash" },
arguments = "-f config.json", arguments = "-f config.json" + PortableMode(),
coreUrl = Global.ClashMetaCoreUrl, coreUrl = Global.ClashMetaCoreUrl,
coreReleaseApiUrl = Global.ClashMetaCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl), coreReleaseApiUrl = Global.ClashMetaCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
match = "v", match = "v",
@ -130,7 +130,7 @@ namespace ServiceLib.Handler
{ {
coreType = ECoreType.mihomo, coreType = ECoreType.mihomo,
coreExes = new List<string> { $"mihomo-windows-amd64{(Avx2.X64.IsSupported ? "" : "-compatible")}", "mihomo-windows-amd64-compatible", "mihomo-windows-amd64", "mihomo-windows-386", "mihomo", "clash" }, coreExes = new List<string> { $"mihomo-windows-amd64{(Avx2.X64.IsSupported ? "" : "-compatible")}", "mihomo-windows-amd64-compatible", "mihomo-windows-amd64", "mihomo-windows-386", "mihomo", "clash" },
arguments = "-f config.json", arguments = "-f config.json" + PortableMode(),
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", coreDownloadUrl32 = Global.ClashMetaCoreUrl + "/download/{0}/mihomo-windows-386-{0}.zip",
@ -208,5 +208,10 @@ namespace ServiceLib.Handler
redirectInfo = true, redirectInfo = true,
}); });
} }
private string PortableMode()
{
return $" -d \"{Utils.GetBinPath("")}\"";
}
} }
} }
Loading…
Cancel
Save