From 0b5d41370cc5f014523a997cf9e96c5dbc0191c4 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 5 Dec 2022 20:31:53 +0800 Subject: [PATCH] add clash premium core --- clashN/clashN/Global.cs | 2 +- clashN/clashN/Handler/LazyConfig.cs | 12 ++++++++++++ clashN/clashN/Mode/ECoreType.cs | 1 + clashN/clashN/Resx/ResUI.Designer.cs | 2 +- clashN/clashN/Resx/ResUI.resx | 2 +- clashN/clashN/Resx/ResUI.zh-Hans.resx | 2 +- 6 files changed, 17 insertions(+), 4 deletions(-) diff --git a/clashN/clashN/Global.cs b/clashN/clashN/Global.cs index 70468d6..f8b43ec 100644 --- a/clashN/clashN/Global.cs +++ b/clashN/clashN/Global.cs @@ -100,7 +100,7 @@ "" }; - public static readonly List coreTypes = new List { "clash", "clash_meta" }; + public static readonly List coreTypes = new List { "clash", "clash_premium", "clash_meta", }; public static readonly List allowSelectType = new List { "selector", "urltest", "loadbalance", "fallback" }; diff --git a/clashN/clashN/Handler/LazyConfig.cs b/clashN/clashN/Handler/LazyConfig.cs index d75f8e5..5ed1210 100644 --- a/clashN/clashN/Handler/LazyConfig.cs +++ b/clashN/clashN/Handler/LazyConfig.cs @@ -91,6 +91,18 @@ namespace clashN.Handler match = "Clash Meta" }); + coreInfos.Add(new CoreInfo + { + coreType = ECoreType.clash_premium, + coreExes = new List { "clash-windows-amd64-v3", "clash-windows-amd64", "clash-windows-386", "clash" }, + arguments = "-f config.yaml", + coreUrl = Global.clashCoreUrl, + coreLatestUrl = Global.clashCoreUrl + "/latest", + coreDownloadUrl32 = Global.clashCoreUrl + "/download/{0}/clash-windows-386-{0}.zip", + coreDownloadUrl64 = Global.clashCoreUrl + "/download/{0}/clash-windows-amd64-{0}.zip", + match = "Clash" + }); + } } } diff --git a/clashN/clashN/Mode/ECoreType.cs b/clashN/clashN/Mode/ECoreType.cs index fcc5f39..60568c2 100644 --- a/clashN/clashN/Mode/ECoreType.cs +++ b/clashN/clashN/Mode/ECoreType.cs @@ -5,6 +5,7 @@ namespace clashN.Mode { clash = 1, clash_meta = 2, + clash_premium = 3, clashN = 99 } } diff --git a/clashN/clashN/Resx/ResUI.Designer.cs b/clashN/clashN/Resx/ResUI.Designer.cs index 6d54d60..31d1f26 100644 --- a/clashN/clashN/Resx/ResUI.Designer.cs +++ b/clashN/clashN/Resx/ResUI.Designer.cs @@ -1655,7 +1655,7 @@ namespace clashN.Resx { } /// - /// 查找类似 To enable tun mode, please use Clash.Meta Core first; if you must use Clash Core, you need to download Clash Premium Core overlay 的本地化字符串。 + /// 查找类似 To enable tun mode, please use Clash.Meta Core first; or use Clash Premium Core 的本地化字符串。 /// public static string TunModeCoreTip { get { diff --git a/clashN/clashN/Resx/ResUI.resx b/clashN/clashN/Resx/ResUI.resx index 882ad31..5cac200 100644 --- a/clashN/clashN/Resx/ResUI.resx +++ b/clashN/clashN/Resx/ResUI.resx @@ -602,7 +602,7 @@ The ping of current service: {0} - To enable tun mode, please use Clash.Meta Core first; if you must use Clash Core, you need to download Clash Premium Core overlay + To enable tun mode, please use Clash.Meta Core first; or use Clash Premium Core Save diff --git a/clashN/clashN/Resx/ResUI.zh-Hans.resx b/clashN/clashN/Resx/ResUI.zh-Hans.resx index ba428dc..ab5d1f4 100644 --- a/clashN/clashN/Resx/ResUI.zh-Hans.resx +++ b/clashN/clashN/Resx/ResUI.zh-Hans.resx @@ -602,7 +602,7 @@ 当前服务的真连接延迟: {0} - 开启tun模式请优先使用Clash.Meta Core; 如一定要使用Clash Core, 需要下载Clash Premium Core覆盖 + 开启tun模式请优先使用Clash.Meta Core; 或者使用Clash Premium Core 保存