Merge branch 'meta-dev' into meta
This commit is contained in:
commit
79a5fc62f7
|
@ -24,7 +24,7 @@ jobs:
|
|||
uses: robinraju/release-downloader@v1.8
|
||||
with:
|
||||
repository: 'MetaCubeX/Clash.Meta'
|
||||
tag: "v1.14.5"
|
||||
tag: "v1.15.0"
|
||||
fileName: ".*darwin.*64-v.*.gz"
|
||||
|
||||
# releaseId: "62870807"
|
||||
|
|
|
@ -881,6 +881,10 @@ extension AppDelegate {
|
|||
self.pushInitConfig()
|
||||
}.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")
|
||||
|
||||
|
||||
}.catch { error in
|
||||
ConfigManager.shared.isRunning = false
|
||||
self.proxyModeMenuItem.isEnabled = false
|
||||
|
@ -1214,6 +1218,19 @@ extension AppDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
// MARK: Meta Update Notification
|
||||
extension AppDelegate {
|
||||
func showUpdateNotification(_ udString: String, info: String) {
|
||||
guard !UserDefaults.standard.bool(forKey: udString) else { return }
|
||||
|
||||
UserDefaults.standard.set(true, forKey: udString)
|
||||
|
||||
NSUserNotificationCenter.default
|
||||
.postNotificationAlert(title: "Update Tips", info: info)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: Meta Menu
|
||||
|
||||
extension AppDelegate {
|
||||
|
@ -1504,7 +1521,7 @@ extension AppDelegate {
|
|||
|
||||
guard let components = URLComponents(string: url),
|
||||
let scheme = components.scheme,
|
||||
scheme.hasPrefix("clash"),
|
||||
scheme.hasPrefix("clashmeta"),
|
||||
let host = components.host
|
||||
else { return }
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ class ClashMetaConfig: NSObject {
|
|||
var mixedPort: Int?
|
||||
|
||||
var geodataMode: Bool?
|
||||
var geoxUrl: [String: String]?
|
||||
|
||||
var logLevel = ConfigManager.selectLoggingApiLevel.rawValue
|
||||
|
||||
|
@ -46,6 +47,7 @@ class ClashMetaConfig: NSObject {
|
|||
socksPort = "socks-port",
|
||||
logLevel = "log-level",
|
||||
geodataMode = "geodata-mode",
|
||||
geoxUrl = "geox-url",
|
||||
secret
|
||||
}
|
||||
|
||||
|
@ -80,6 +82,10 @@ class ClashMetaConfig: NSObject {
|
|||
if port == nil && mixedPort == nil {
|
||||
mixedPort = 7890
|
||||
}
|
||||
|
||||
if let urls = yaml[keys.geoxUrl.rawValue] as? [String: String] {
|
||||
geoxUrl = urls
|
||||
}
|
||||
}
|
||||
|
||||
mutating func updatePorts(_ usedPorts: String) {
|
||||
|
|
|
@ -70,7 +70,7 @@ class ClashResourceManager {
|
|||
|
||||
static func showCreateConfigDirFailAlert(err: String) {
|
||||
let alert = NSAlert()
|
||||
alert.messageText = NSLocalizedString("ClashX fail to create ~/.config/clash folder. Please check privileges or manually create folder and restart ClashX." + err, comment: "")
|
||||
alert.messageText = NSLocalizedString("ClashX fail to create ~/.config/ClashMeta folder. Please check privileges or manually create folder and restart ClashX." + err, comment: "")
|
||||
alert.alertStyle = .warning
|
||||
alert.addButton(withTitle: NSLocalizedString("Quit", comment: ""))
|
||||
alert.runModal()
|
||||
|
|
|
@ -41,10 +41,10 @@
|
|||
<key>CFBundleURLIconFile</key>
|
||||
<string>Icon</string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>com.west2online.ClashX</string>
|
||||
<string>com.metacubex.ClashX</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>clashx</string>
|
||||
<string>clashxmeta</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
|
@ -53,10 +53,10 @@
|
|||
<key>CFBundleURLIconFile</key>
|
||||
<string>Icon</string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>com.west2online.Clash</string>
|
||||
<string>com.metacubex.ClashX</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>clash</string>
|
||||
<string>clashmeta</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
|
@ -101,12 +101,12 @@
|
|||
<false/>
|
||||
<key>NSUbiquitousContainers</key>
|
||||
<dict>
|
||||
<key>iCloud.com.west2online.ClashX</key>
|
||||
<key>iCloud.com.metacubex.ClashX</key>
|
||||
<dict>
|
||||
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
|
||||
<true/>
|
||||
<key>NSUbiquitousContainerName</key>
|
||||
<string>ClashX</string>
|
||||
<string>ClashXMeta</string>
|
||||
<key>NSUbiquitousContainerSupportedFolderLevels</key>
|
||||
<string>Any</string>
|
||||
</dict>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//
|
||||
import Foundation
|
||||
|
||||
let kConfigFolderPath = "\(NSHomeDirectory())/.config/clash/"
|
||||
let kConfigFolderPath = "\(NSHomeDirectory())/.config/ClashMeta/"
|
||||
|
||||
let kDefaultConfigFilePath = "\(kConfigFolderPath)config.yaml"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#---------------------------------------------------#
|
||||
## 配置文件需要放置在 $HOME/.config/clash/*.yaml
|
||||
## 配置文件需要放置在 $HOME/.config/ClashMeta/*.yaml
|
||||
|
||||
## 这份文件是clashX的基础配置文件,请尽量新建配置文件进行修改。
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
"Cancel" = "Cancel";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"ClashX fail to create ~/.config/clash folder. Please check privileges or manually create folder and restart ClashX." = "ClashX fail to create ~/.config/clash 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/ClashMeta 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.";
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
"Cancel" = "取消";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"ClashX fail to create ~/.config/clash folder. Please check privileges or manually create folder and restart ClashX." = "ClashX 创建 ~/.config/clash 文件夹失败,请检查权限设置或者手动创建文件夹后重启 ClashX";
|
||||
"ClashX fail to create ~/.config/ClashMeta folder. Please check privileges or manually create folder and restart ClashX." = "ClashX 创建 ~/.config/ClashMeta 文件夹失败,请检查权限设置或者手动创建文件夹后重启 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 将无法设置系统代理。";
|
||||
|
|
|
@ -10,7 +10,7 @@ import AppKit
|
|||
|
||||
enum StatusItemTool {
|
||||
static let menuImage: NSImage = {
|
||||
let customImagePath = (NSHomeDirectory() as NSString).appendingPathComponent("/.config/clash/menuImage.png")
|
||||
let customImagePath = (NSHomeDirectory() as NSString).appendingPathComponent("/.config/ClashMeta/menuImage.png")
|
||||
if let image = NSImage(contentsOfFile: customImagePath) {
|
||||
return image
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue