aboutsummaryrefslogtreecommitdiff
path: root/tools/Crupest.V2ray/Crupest.V2ray/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'tools/Crupest.V2ray/Crupest.V2ray/Program.cs')
-rw-r--r--tools/Crupest.V2ray/Crupest.V2ray/Program.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/Crupest.V2ray/Crupest.V2ray/Program.cs b/tools/Crupest.V2ray/Crupest.V2ray/Program.cs
index a40aa21..0e98861 100644
--- a/tools/Crupest.V2ray/Crupest.V2ray/Program.cs
+++ b/tools/Crupest.V2ray/Crupest.V2ray/Program.cs
@@ -12,6 +12,8 @@ public static class Program
Assembly.GetExecutingAssembly().Location) ?? throw new Exception("Can't get the path of Crupest.V2ray."));
private const string ConfigOutputFileName = "config.json";
+ private const string SurgeRuleSetChinaOutputFileName = "ChinaRuleSet.txt";
+ private const string SurgeRuleSetGlobalOutputFileName = "GlobalRuleSet.txt";
public static void RunV2rayAndWatchConfigChange()
{
@@ -68,6 +70,16 @@ public static class Program
GeoDataManager.Instance.Download(CrupestV2rayDirectory, false);
return;
}
+ else if (verb == "generate-surge-rule-set" || verb == "gs")
+ {
+ SurgeConfigGenerator.GenerateTo(
+ Path.Join(CrupestV2rayDirectory, "proxy.txt"),
+ Path.Join(CrupestV2rayDirectory, SurgeRuleSetChinaOutputFileName),
+ Path.Join(CrupestV2rayDirectory, SurgeRuleSetGlobalOutputFileName),
+ true, false
+ );
+ return;
+ }
else if (verb == "generate" || verb == "g")
{
var config = V2rayConfig.FromDirectory(CrupestV2rayDirectory);