Improvements and Adjustments

InitCoreInfo()
This commit is contained in:
2dust 2025-01-15 17:31:13 +08:00
parent f1601c463b
commit f19edc9370

View file

@ -52,9 +52,9 @@
private void InitCoreInfo()
{
_coreInfo = [];
_coreInfo.Add(new CoreInfo
_coreInfo =
[
new CoreInfo
{
CoreType = ECoreType.v2rayN,
Url = Global.NUrl,
@ -65,36 +65,36 @@
DownloadUrlLinuxArm64 = Global.NUrl + "/download/{0}/v2rayN-linux-arm64.zip",
DownloadUrlOSX64 = Global.NUrl + "/download/{0}/v2rayN-macos-64.zip",
DownloadUrlOSXArm64 = Global.NUrl + "/download/{0}/v2rayN-macos-arm64.zip",
});
},
_coreInfo.Add(new CoreInfo
new CoreInfo
{
CoreType = ECoreType.v2fly,
CoreExes = new List<string> { "wv2ray", "v2ray" },
CoreExes = ["wv2ray", "v2ray"],
Arguments = "",
Url = Global.V2flyCoreUrl,
ReleaseApiUrl = Global.V2flyCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
Match = "V2Ray",
VersionArg = "-version",
RedirectInfo = true,
});
},
_coreInfo.Add(new CoreInfo
new CoreInfo
{
CoreType = ECoreType.v2fly_v5,
CoreExes = new List<string> { "v2ray" },
CoreExes = ["v2ray"],
Arguments = "run -c config.json -format jsonv5",
Url = Global.V2flyCoreUrl,
ReleaseApiUrl = Global.V2flyCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
Match = "V2Ray",
VersionArg = "version",
RedirectInfo = true,
});
},
_coreInfo.Add(new CoreInfo
new CoreInfo
{
CoreType = ECoreType.Xray,
CoreExes = new List<string> { "xray", "wxray" },
CoreExes = ["xray", "wxray"],
Arguments = "run -c {0}",
Url = Global.XrayCoreUrl,
ReleaseApiUrl = Global.XrayCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
@ -107,12 +107,12 @@
Match = "Xray",
VersionArg = "-version",
RedirectInfo = true,
});
},
_coreInfo.Add(new CoreInfo
new CoreInfo
{
CoreType = ECoreType.mihomo,
CoreExes = new List<string> { "mihomo-windows-amd64-compatible", "mihomo-windows-amd64", "mihomo-linux-amd64", "mihomo", "clash" },
CoreExes = ["mihomo-windows-amd64-compatible", "mihomo-windows-amd64", "mihomo-linux-amd64", "mihomo", "clash"],
Arguments = "-f config.json" + PortableMode(),
Url = Global.MihomoCoreUrl,
ReleaseApiUrl = Global.MihomoCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
@ -125,40 +125,40 @@
Match = "Mihomo",
VersionArg = "-v",
RedirectInfo = true,
});
},
_coreInfo.Add(new CoreInfo
new CoreInfo
{
CoreType = ECoreType.hysteria,
CoreExes = new List<string> { "hysteria-windows-amd64", "hysteria" },
CoreExes = ["hysteria-windows-amd64", "hysteria"],
Arguments = "",
Url = Global.HysteriaCoreUrl,
ReleaseApiUrl = Global.HysteriaCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
RedirectInfo = true,
});
},
_coreInfo.Add(new CoreInfo
new CoreInfo
{
CoreType = ECoreType.naiveproxy,
CoreExes = new List<string> { "naiveproxy", "naive" },
CoreExes = ["naiveproxy", "naive"],
Arguments = "config.json",
Url = Global.NaiveproxyCoreUrl,
RedirectInfo = false,
});
},
_coreInfo.Add(new CoreInfo
new CoreInfo
{
CoreType = ECoreType.tuic,
CoreExes = new List<string> { "tuic-client", "tuic" },
CoreExes = ["tuic-client", "tuic"],
Arguments = "-c config.json",
Url = Global.TuicCoreUrl,
RedirectInfo = true,
});
},
_coreInfo.Add(new CoreInfo
new CoreInfo
{
CoreType = ECoreType.sing_box,
CoreExes = new List<string> { "sing-box-client", "sing-box" },
CoreExes = ["sing-box-client", "sing-box"],
Arguments = "run -c {0} --disable-color",
Url = Global.SingboxCoreUrl,
RedirectInfo = true,
@ -171,25 +171,27 @@
DownloadUrlOSXArm64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-darwin-arm64.tar.gz",
Match = "sing-box",
VersionArg = "version",
});
},
_coreInfo.Add(new CoreInfo
new CoreInfo
{
CoreType = ECoreType.juicity,
CoreExes = new List<string> { "juicity-client", "juicity" },
CoreExes = ["juicity-client", "juicity"],
Arguments = "run -c config.json",
Url = Global.JuicityCoreUrl
});
},
_coreInfo.Add(new CoreInfo
new CoreInfo
{
CoreType = ECoreType.hysteria2,
CoreExes = new List<string> { "hysteria-windows-amd64", "hysteria-linux-amd64", "hysteria" },
CoreExes = ["hysteria-windows-amd64", "hysteria-linux-amd64", "hysteria"],
Arguments = "",
Url = Global.HysteriaCoreUrl,
ReleaseApiUrl = Global.HysteriaCoreUrl.Replace(Global.GithubUrl, Global.GithubApiUrl),
RedirectInfo = true,
});
}
];
}
private string PortableMode()