diff --git a/ClashX/AppDelegate.swift b/ClashX/AppDelegate.swift index d3e7e9a..65a51dc 100644 --- a/ClashX/AppDelegate.swift +++ b/ClashX/AppDelegate.swift @@ -1089,6 +1089,22 @@ extension AppDelegate { } @IBAction func useAlphaMeta(_ sender: NSMenuItem) { + if UserDefaults.standard.object(forKey: "useAlphaCore") as? Bool == nil { + let alert = NSAlert() + alert.messageText = """ +If you don't know what you're doing, never turn this switch on. +如果你不知道你在做什么, 请绝对不要打开这个开关. +Running Meta Core without any authentication under sudo privileges can have devastating consequences. +在sudo 权限下运行未经验证的 Meta 核心, 可能造成严重后果. +""" + alert.alertStyle = .warning + alert.addButton(withTitle: NSLocalizedString("Continue", comment: "")) + alert.addButton(withTitle: NSLocalizedString("Cancel", comment: "")) + if alert.runModal() != .alertFirstButtonReturn { + return + } + } + let use = sender.state != .on MenuItemFactory.useAlphaCore = use sender.state = use ? .on : .off