From e2067bc10095768e694bf5136841029b3662047e Mon Sep 17 00:00:00 2001 From: MPTres Date: Sun, 14 Nov 2021 15:42:40 +0800 Subject: [PATCH] URL scheme to update current config. Motivation: i have a script that changes the configuration. When that happens, the app detects the change and ask the user to update. This would allow to programatically tell ClashX to update the config without user intervention --- ClashX/AppDelegate.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ClashX/AppDelegate.swift b/ClashX/AppDelegate.swift index 7908959..7d255cb 100644 --- a/ClashX/AppDelegate.swift +++ b/ClashX/AppDelegate.swift @@ -931,6 +931,8 @@ extension AppDelegate { DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { NotificationCenter.default.post(name: Notification.Name(rawValue: "didGetUrl"), object: nil, userInfo: userInfo) } + } else if host == "update-config" { + updateConfig() } } }