From 5b8fea2d5ddb37670fee7e58a24bf8c603544c8f Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Fri, 30 Jun 2023 15:23:08 +0800 Subject: [PATCH] Revert "feat: migrated to ~/.config/ClashMeta" This reverts commit 9f3bf507b71980601968641f00bb59b2f0e3adb2. --- ClashX/AppDelegate.swift | 4 ++-- ClashX/General/Managers/ClashResourceManager.swift | 2 +- ClashX/Info.plist | 12 ++++++------ ClashX/Macro/Paths.swift | 2 +- ClashX/Resources/sampleConfig.yaml | 2 +- ClashX/Support Files/en.lproj/Localizable.strings | 2 +- .../Support Files/zh-Hans.lproj/Localizable.strings | 2 +- ClashX/Views/StatusItem/StatusItemTool.swift | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ClashX/AppDelegate.swift b/ClashX/AppDelegate.swift index 08fdb275e..b30ee4cb2 100644 --- a/ClashX/AppDelegate.swift +++ b/ClashX/AppDelegate.swift @@ -882,7 +882,7 @@ extension AppDelegate { }.done { Logger.log("Init config file success.") - self.showUpdateNotification("ClashX_Meta_1.3.0_UpdateTips", info: "Config Floder migrated from\n~/.config/clash to\n~/.config/ClashMeta") + self.showUpdateNotification("ClashX_Meta_1.3.0_UpdateTips", info: "Config Floder migrated from\n~/.config/clash to\n~/.config/clash.meta") }.catch { error in @@ -1521,7 +1521,7 @@ extension AppDelegate { guard let components = URLComponents(string: url), let scheme = components.scheme, - scheme.hasPrefix("clashmeta"), + scheme.hasPrefix("clash"), let host = components.host else { return } diff --git a/ClashX/General/Managers/ClashResourceManager.swift b/ClashX/General/Managers/ClashResourceManager.swift index 63f78bb6d..c89df5d89 100644 --- a/ClashX/General/Managers/ClashResourceManager.swift +++ b/ClashX/General/Managers/ClashResourceManager.swift @@ -70,7 +70,7 @@ class ClashResourceManager { static func showCreateConfigDirFailAlert(err: String) { let alert = NSAlert() - alert.messageText = NSLocalizedString("ClashX fail to create ~/.config/ClashMeta folder. Please check privileges or manually create folder and restart ClashX." + err, comment: "") + alert.messageText = NSLocalizedString("ClashX fail to create ~/.config/clash.meta folder. Please check privileges or manually create folder and restart ClashX." + err, comment: "") alert.alertStyle = .warning alert.addButton(withTitle: NSLocalizedString("Quit", comment: "")) alert.runModal() diff --git a/ClashX/Info.plist b/ClashX/Info.plist index 748bfdded..d5d676e99 100644 --- a/ClashX/Info.plist +++ b/ClashX/Info.plist @@ -41,10 +41,10 @@ CFBundleURLIconFile Icon CFBundleURLName - com.metacubex.ClashX + com.west2online.ClashX CFBundleURLSchemes - clashxmeta + clashx @@ -53,10 +53,10 @@ CFBundleURLIconFile Icon CFBundleURLName - com.metacubex.ClashX + com.west2online.Clash CFBundleURLSchemes - clashmeta + clash @@ -101,12 +101,12 @@ NSUbiquitousContainers - iCloud.com.metacubex.ClashX + iCloud.com.west2online.ClashX NSUbiquitousContainerIsDocumentScopePublic NSUbiquitousContainerName - ClashXMeta + ClashX NSUbiquitousContainerSupportedFolderLevels Any diff --git a/ClashX/Macro/Paths.swift b/ClashX/Macro/Paths.swift index 781dfdc37..ecccf50e9 100644 --- a/ClashX/Macro/Paths.swift +++ b/ClashX/Macro/Paths.swift @@ -7,7 +7,7 @@ // import Foundation -let kConfigFolderPath = "\(NSHomeDirectory())/.config/ClashMeta/" +let kConfigFolderPath = "\(NSHomeDirectory())/.config/clash.meta/" let kDefaultConfigFilePath = "\(kConfigFolderPath)config.yaml" diff --git a/ClashX/Resources/sampleConfig.yaml b/ClashX/Resources/sampleConfig.yaml index 3ea997222..de58eea03 100644 --- a/ClashX/Resources/sampleConfig.yaml +++ b/ClashX/Resources/sampleConfig.yaml @@ -1,5 +1,5 @@ #---------------------------------------------------# -## 配置文件需要放置在 $HOME/.config/ClashMeta/*.yaml +## 配置文件需要放置在 $HOME/.config/clash.meta/*.yaml ## 这份文件是clashX的基础配置文件,请尽量新建配置文件进行修改。 diff --git a/ClashX/Support Files/en.lproj/Localizable.strings b/ClashX/Support Files/en.lproj/Localizable.strings index eefcd235a..4623a5247 100644 --- a/ClashX/Support Files/en.lproj/Localizable.strings +++ b/ClashX/Support Files/en.lproj/Localizable.strings @@ -29,7 +29,7 @@ "Cancel" = "Cancel"; /* No comment provided by engineer. */ -"ClashX fail to create ~/.config/ClashMeta folder. Please check privileges or manually create folder and restart ClashX." = "ClashX fail to create ~/.config/ClashMeta folder. Please check privileges or manually create folder and restart ClashX."; +"ClashX fail to create ~/.config/clash.meta folder. Please check privileges or manually create folder and restart ClashX." = "ClashX fail to create ~/.config/clash.meta folder. Please check privileges or manually create folder and restart ClashX."; /* No comment provided by engineer. */ "ClashX needs to install/update a helper tool with administrator privileges, otherwise ClashX won't be able to configure system proxy." = "ClashX needs to install/update a helper tool with administrator privileges, otherwise ClashX won't be able to configure system proxy."; diff --git a/ClashX/Support Files/zh-Hans.lproj/Localizable.strings b/ClashX/Support Files/zh-Hans.lproj/Localizable.strings index 1510ba681..e6c8390cf 100644 --- a/ClashX/Support Files/zh-Hans.lproj/Localizable.strings +++ b/ClashX/Support Files/zh-Hans.lproj/Localizable.strings @@ -29,7 +29,7 @@ "Cancel" = "取消"; /* No comment provided by engineer. */ -"ClashX fail to create ~/.config/ClashMeta folder. Please check privileges or manually create folder and restart ClashX." = "ClashX 创建 ~/.config/ClashMeta 文件夹失败,请检查权限设置或者手动创建文件夹后重启 ClashX"; +"ClashX fail to create ~/.config/clash.meta folder. Please check privileges or manually create folder and restart ClashX." = "ClashX 创建 ~/.config/clash.meta 文件夹失败,请检查权限设置或者手动创建文件夹后重启 ClashX"; /* No comment provided by engineer. */ "ClashX needs to install/update a helper tool with administrator privileges, otherwise ClashX won't be able to configure system proxy." = "ClashX 需要使用管理员权限安装/更新一个帮助程序,否则 ClashX 将无法设置系统代理。"; diff --git a/ClashX/Views/StatusItem/StatusItemTool.swift b/ClashX/Views/StatusItem/StatusItemTool.swift index 829b4d5c6..50d5d4cb0 100644 --- a/ClashX/Views/StatusItem/StatusItemTool.swift +++ b/ClashX/Views/StatusItem/StatusItemTool.swift @@ -10,7 +10,7 @@ import AppKit enum StatusItemTool { static let menuImage: NSImage = { - let customImagePath = (NSHomeDirectory() as NSString).appendingPathComponent("/.config/ClashMeta/menuImage.png") + let customImagePath = (NSHomeDirectory() as NSString).appendingPathComponent("/.config/clash.meta/menuImage.png") if let image = NSImage(contentsOfFile: customImagePath) { return image }