Skip to content

Commit 2421285

Browse files
committedOct 14, 2018
Merge branch 'master' into feature/yaml
# Conflicts: # .gitignore # ClashX.xcodeproj/project.pbxproj # ClashX/AppDelegate.swift # ClashX/Support Files/initConfig.ini # ClashX/Support Files/sampleConfig.ini
2 parents c6583bf + db4751f commit 2421285

22 files changed

+2619
-42
lines changed
 

‎.gitmodules

Whitespace-only changes.

‎ClashX.xcodeproj/project.pbxproj

+30-14
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
4913C82321157D0200F6B87C /* Notification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4913C82221157D0200F6B87C /* Notification.swift */; };
1212
492C4869210EE6B9004554A0 /* ApiRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 492C4868210EE6B9004554A0 /* ApiRequest.swift */; };
1313
492C4871210EF62E004554A0 /* ClashConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 492C4870210EF62E004554A0 /* ClashConfig.swift */; };
14+
492D7321216CEC4000146BC1 /* ClashX.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 492D731F216CEC4000146BC1 /* ClashX.a */; };
1415
4931969B21631E5E00A8E6E7 /* SpeedDataRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4931969A21631E5D00A8E6E7 /* SpeedDataRecorder.swift */; };
1516
493196A2216331F400A8E6E7 /* NetworkChangeNotifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 493196A1216331F400A8E6E7 /* NetworkChangeNotifier.swift */; };
1617
4949D154213242F600EF85E6 /* Paths.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4949D153213242F600EF85E6 /* Paths.swift */; };
@@ -33,7 +34,8 @@
3334
49722FF1211F338B00650A41 /* Witness.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49722FEC211F338B00650A41 /* Witness.swift */; };
3435
49722FF2211F338B00650A41 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 49722FEE211F338B00650A41 /* Info.plist */; };
3536
497F0DF320DE2FE50077AD41 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 497F0DF220DE2FE50077AD41 /* Icon.icns */; };
36-
4989F98020D01C8F0001E564 /* clash.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4989F97E20D01C8F0001E564 /* clash.a */; };
37+
4981C88B216BAE4A008CC14A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4981C88D216BAE4A008CC14A /* Localizable.strings */; };
38+
4981C890216BAF0C008CC14A /* String+Localized.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4981C88F216BAF0C008CC14A /* String+Localized.swift */; };
3739
4989F98420D02D200001E564 /* Country.mmdb in Resources */ = {isa = PBXBuildFile; fileRef = 4989F98320D02D200001E564 /* Country.mmdb */; };
3840
4989F98E20D0AE990001E564 /* sampleConfig.yml in Resources */ = {isa = PBXBuildFile; fileRef = 4989F98D20D0AE990001E564 /* sampleConfig.yml */; };
3941
4997732520D251A60009B136 /* SWBApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 4997732320D251A60009B136 /* SWBApplication.m */; };
@@ -104,6 +106,8 @@
104106
4913C82221157D0200F6B87C /* Notification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Notification.swift; sourceTree = "<group>"; };
105107
492C4868210EE6B9004554A0 /* ApiRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiRequest.swift; sourceTree = "<group>"; };
106108
492C4870210EF62E004554A0 /* ClashConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClashConfig.swift; sourceTree = "<group>"; };
109+
492D731F216CEC4000146BC1 /* ClashX.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = ClashX.a; path = ClashX/ClashX.a; sourceTree = SOURCE_ROOT; };
110+
492D7320216CEC4000146BC1 /* ClashX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClashX.h; path = ClashX/ClashX.h; sourceTree = SOURCE_ROOT; };
107111
4931969A21631E5D00A8E6E7 /* SpeedDataRecorder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpeedDataRecorder.swift; sourceTree = "<group>"; };
108112
493196A1216331F400A8E6E7 /* NetworkChangeNotifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkChangeNotifier.swift; sourceTree = "<group>"; };
109113
4949D153213242F600EF85E6 /* Paths.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Paths.swift; sourceTree = "<group>"; };
@@ -129,8 +133,11 @@
129133
49722FED211F338B00650A41 /* Witness.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Witness.h; sourceTree = "<group>"; };
130134
49722FEE211F338B00650A41 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
131135
497F0DF220DE2FE50077AD41 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = "<group>"; };
132-
4989F97E20D01C8F0001E564 /* clash.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = clash.a; sourceTree = "<group>"; };
133-
4989F97F20D01C8F0001E564 /* clash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clash.h; sourceTree = "<group>"; };
136+
4981C887216BAB8A008CC14A /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
137+
4981C888216BAB8A008CC14A /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = "zh-Hans"; path = "../zh-Hans.lproj/Main.storyboard"; sourceTree = "<group>"; };
138+
4981C88C216BAE4A008CC14A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
139+
4981C88E216BAE4D008CC14A /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
140+
4981C88F216BAF0C008CC14A /* String+Localized.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Localized.swift"; sourceTree = "<group>"; };
134141
4989F98320D02D200001E564 /* Country.mmdb */ = {isa = PBXFileReference; lastKnownFileType = file; path = Country.mmdb; sourceTree = "<group>"; };
135142
4989F98D20D0AE990001E564 /* sampleConfig.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = sampleConfig.yml; sourceTree = "<group>"; };
136143
4997732320D251A60009B136 /* SWBApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWBApplication.m; sourceTree = "<group>"; };
@@ -169,7 +176,7 @@
169176
isa = PBXFrameworksBuildPhase;
170177
buildActionMask = 2147483647;
171178
files = (
172-
4989F98020D01C8F0001E564 /* clash.a in Frameworks */,
179+
492D7321216CEC4000146BC1 /* ClashX.a in Frameworks */,
173180
0D318CDAC9464E01DAD1F92B /* Pods_ClashX.framework in Frameworks */,
174181
);
175182
runOnlyForDeploymentPostprocessing = 0;
@@ -288,6 +295,7 @@
288295
4966E9E5211824F300A391FB /* NSImage+extension.swift */,
289296
496BDEDF21196F1E00C5207F /* Logger.swift */,
290297
49B10869216A356D0064FFCE /* String+Extension.swift */,
298+
4981C88F216BAF0C008CC14A /* String+Localized.swift */,
291299
);
292300
path = Basic;
293301
sourceTree = "<group>";
@@ -325,7 +333,6 @@
325333
4989F98520D0AA300001E564 /* ViewControllers */,
326334
49CF3B5D20CE80D2001EBF94 /* script */,
327335
49CF3B4B20CE5232001EBF94 /* ProxyConfig.xcodeproj */,
328-
49CF3B4320CD79A0001EBF94 /* clash */,
329336
49CF3B3A20CD783A001EBF94 /* Support Files */,
330337
49CF3B2020CD7463001EBF94 /* AppDelegate.swift */,
331338
49CF3B2420CD7465001EBF94 /* Assets.xcassets */,
@@ -341,21 +348,16 @@
341348
49CF3B3A20CD783A001EBF94 /* Support Files */ = {
342349
isa = PBXGroup;
343350
children = (
351+
492D731F216CEC4000146BC1 /* ClashX.a */,
352+
492D7320216CEC4000146BC1 /* ClashX.h */,
344353
4989F98D20D0AE990001E564 /* sampleConfig.yml */,
345354
4989F98320D02D200001E564 /* Country.mmdb */,
355+
49722FE7211F28CC00650A41 /* initConfig.ini */,
356+
4981C88D216BAE4A008CC14A /* Localizable.strings */,
346357
);
347358
path = "Support Files";
348359
sourceTree = "<group>";
349360
};
350-
49CF3B4320CD79A0001EBF94 /* clash */ = {
351-
isa = PBXGroup;
352-
children = (
353-
4989F97E20D01C8F0001E564 /* clash.a */,
354-
4989F97F20D01C8F0001E564 /* clash.h */,
355-
);
356-
path = clash;
357-
sourceTree = "<group>";
358-
};
359361
49CF3B5D20CE80D2001EBF94 /* script */ = {
360362
isa = PBXGroup;
361363
children = (
@@ -462,6 +464,7 @@
462464
knownRegions = (
463465
en,
464466
Base,
467+
"zh-Hans",
465468
);
466469
mainGroup = 49CF3B1420CD7463001EBF94;
467470
productRefGroup = 49CF3B1E20CD7463001EBF94 /* Products */;
@@ -504,6 +507,7 @@
504507
buildActionMask = 2147483647;
505508
files = (
506509
49CF3B2520CD7465001EBF94 /* Assets.xcassets in Resources */,
510+
4981C88B216BAE4A008CC14A /* Localizable.strings in Resources */,
507511
495340B020DE5F7200B0D3FF /* StatusItemView.xib in Resources */,
508512
49CF3B2820CD7465001EBF94 /* Main.storyboard in Resources */,
509513
49CF3B5F20CE80D2001EBF94 /* install_proxy_helper.sh in Resources */,
@@ -608,6 +612,7 @@
608612
4966E9E32118153A00A391FB /* NSUserNotificationCenter+Extension.swift in Sources */,
609613
4931969B21631E5E00A8E6E7 /* SpeedDataRecorder.swift in Sources */,
610614
499976C821359F0400E7BF83 /* ClashWebViewContoller.swift in Sources */,
615+
4981C890216BAF0C008CC14A /* String+Localized.swift in Sources */,
611616
49722FE4211ED56C00650A41 /* parseINI.swift in Sources */,
612617
4966E9E6211824F300A391FB /* NSImage+extension.swift in Sources */,
613618
4952C3CE2116EA2E004A4FA8 /* ProxyServerModel.swift in Sources */,
@@ -632,10 +637,20 @@
632637
/* End PBXTargetDependency section */
633638

634639
/* Begin PBXVariantGroup section */
640+
4981C88D216BAE4A008CC14A /* Localizable.strings */ = {
641+
isa = PBXVariantGroup;
642+
children = (
643+
4981C88C216BAE4A008CC14A /* en */,
644+
4981C88E216BAE4D008CC14A /* zh-Hans */,
645+
);
646+
name = Localizable.strings;
647+
sourceTree = "<group>";
648+
};
635649
49CF3B2620CD7465001EBF94 /* Main.storyboard */ = {
636650
isa = PBXVariantGroup;
637651
children = (
638652
49CF3B2720CD7465001EBF94 /* Base */,
653+
4981C887216BAB8A008CC14A /* zh-Hans */,
639654
);
640655
name = Main.storyboard;
641656
sourceTree = "<group>";
@@ -644,6 +659,7 @@
644659
isa = PBXVariantGroup;
645660
children = (
646661
49E07A8A20D501A000A088A3 /* Base */,
662+
4981C888216BAB8A008CC14A /* zh-Hans */,
647663
);
648664
name = Main.storyboard;
649665
sourceTree = "<group>";

‎ClashX/AppDelegate.swift

+23-11
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
4141
var statusItemView:StatusItemView!
4242

4343
var isRunning = false
44-
45-
func applicationDidFinishLaunching(_ aNotification: Notification) {
44+
func applicationDidFinishLaunching(_ notification: Notification) {
4645
signal(SIGPIPE, SIG_IGN)
4746
failLaunchProtect()
48-
4947
_ = ProxyConfigManager.install()
50-
ConfigFileFactory.upgardeIniIfNeed()
51-
ConfigFileFactory.copySampleConfigIfNeed()
52-
5348
PFMoveToApplicationsFolderIfNecessary()
5449

55-
5650
statusItemView = StatusItemView.create(statusItem: nil,statusMenu: statusMenu)
5751
statusItemView.onPopUpMenuAction = {
5852
[weak self] in
@@ -64,7 +58,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
6458
startProxy()
6559
updateLoggingLevel()
6660
}
67-
61+
62+
6863

6964
func applicationWillTerminate(_ aNotification: Notification) {
7065
if ConfigManager.shared.proxyPortAutoSet {
@@ -89,7 +84,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
8984
.showNetSpeedIndicatorObservable
9085
.bind {[unowned self] (show) in
9186
self.showNetSpeedIndicatorMenuItem.state = (show ?? true) ? .on : .off
92-
self.statusItem = NSStatusBar.system.statusItem(withLength: (show ?? true) ? 65 : 25)
87+
let statusItemLength:CGFloat = (show ?? true) ? 65 : 25
88+
if (self.statusItem == nil) {
89+
self.statusItem = NSStatusBar.system.statusItem(withLength: statusItemLength)
90+
}
91+
self.statusItem.length = statusItemLength
9392
self.statusItem.view = self.statusItemView
9493
self.statusItemView.showSpeedContainer(show: (show ?? true))
9594
self.statusItemView.statusItem = self.statusItem
@@ -120,7 +119,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
120119
case .rule:self.proxyModeRuleMenuItem.state = .on
121120
}
122121
self.allowFromLanMenuItem.state = config!.allowLan ? .on : .off
123-
self.proxyModeMenuItem.title = "Proxy Mode (\(config!.mode.rawValue))"
122+
self.proxyModeMenuItem.title = "\("Proxy Mode".localized()) (\(config!.mode.rawValue.localized()))"
124123

125124
self.updateProxyList()
126125

@@ -301,6 +300,19 @@ class AppDelegate: NSObject, NSApplicationDelegate {
301300
LaunchAtLogin.shared.isEnabled = !LaunchAtLogin.shared.isEnabled
302301
}
303302

303+
var genConfigWindow:NSWindowController?=nil
304+
@IBAction func actionGenConfig(_ sender: Any) {
305+
let ctrl = PreferencesWindowController(windowNibName: "PreferencesWindowController")
306+
307+
308+
genConfigWindow?.close()
309+
genConfigWindow=ctrl
310+
ctrl.window?.title = ctrl.contentViewController?.title ?? ""
311+
ctrl.showWindow(nil)
312+
NSApp.activate(ignoringOtherApps: true)
313+
ctrl.window?.makeKeyAndOrderFront(self)
314+
315+
}
304316

305317
@IBAction func openConfigFolder(_ sender: Any) {
306318
let path = (NSHomeDirectory() as NSString).appendingPathComponent("/.config/clash")
@@ -382,7 +394,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
382394
}
383395

384396
@IBAction func actionShowNetSpeedIndicator(_ sender: NSMenuItem) {
385-
ConfigManager.shared.showNetSpeedIndicator = !ConfigManager.shared.showNetSpeedIndicator
397+
ConfigManager.shared.showNetSpeedIndicator = !(sender.state == .on)
386398
}
387399

388400
@IBAction func actionShowLog(_ sender: Any) {

‎ClashX/Base.lproj/Main.storyboard

+3-3
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
301301
<prototypeCellViews>
302302
<tableCellView identifier="delayCell" id="qZT-29-xCE">
303-
<rect key="frame" x="277.5" y="1" width="168" height="17"/>
303+
<rect key="frame" x="278" y="1" width="168" height="17"/>
304304
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
305305
<subviews>
306306
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="1" translatesAutoresizingMaskIntoConstraints="NO" id="QCv-NJ-qh9">
@@ -331,11 +331,11 @@
331331
</tableView>
332332
</subviews>
333333
</clipView>
334-
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="iP6-D2-2yO">
334+
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="iP6-D2-2yO">
335335
<rect key="frame" x="1" y="283" width="448" height="16"/>
336336
<autoresizingMask key="autoresizingMask"/>
337337
</scroller>
338-
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="cen-QY-aDc">
338+
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="cen-QY-aDc">
339339
<rect key="frame" x="224" y="17" width="15" height="102"/>
340340
<autoresizingMask key="autoresizingMask"/>
341341
</scroller>

‎ClashX/Basic/String+Localized.swift

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// String+Localized.swift
3+
// ClashX
4+
//
5+
// Created by 称一称 on 2018/10/8.
6+
// Copyright © 2018年 west2online. All rights reserved.
7+
//
8+
9+
import Foundation
10+
11+
// to use english as showing language
12+
// defaults write com.west2online.ClashX AppleLanguages '("en-US")'
13+
extension String {
14+
func localized(bundle: Bundle = .main, tableName: String = "Localizable") -> String {
15+
return NSLocalizedString(self, tableName: tableName, value: "\(self)", comment: "")
16+
}
17+
}

‎ClashX/ClashX-Bridging-Header.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
//
22
// Use this file to import your target's public headers that you would like to expose to Swift.
33
//
4-
#import "clash.h"
4+
#import "ClashX.h"

‎ClashX/General/ConfigManager.swift

+2-6
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,15 @@ class ConfigManager {
122122
.default
123123
.rx
124124
.notification(kSystemNetworkStatusDidChange)
125+
.debounce(2, scheduler: MainScheduler.instance)
125126
.subscribeOn(MainScheduler.instance)
126127
.bind{ _ in
127128
let (http,https,socks) = NetworkChangeNotifier.currentSystemProxySetting()
128129
let proxySetted =
129130
http == (self.currentConfig?.port ?? 0) &&
130131
https == (self.currentConfig?.port ?? 0) &&
131132
socks == (self.currentConfig?.socketPort ?? 0)
132-
if (self.proxyPortAutoSet && !proxySetted) {
133-
self.proxyPortAutoSet = proxySetted
134-
}
133+
self.proxyPortAutoSet = proxySetted
135134
}.disposed(by: disposeBag)
136135
}
137-
138-
139-
140136
}

‎ClashX/General/JSBridgeHandler.swift

+10
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ class JsBridgeHelper {
5858
responseCallback?(str ?? "")
5959
}
6060

61+
bridge.registerHandler("getStartAtLogin") { (_, responseCallback) in
62+
responseCallback?(LaunchAtLogin.shared.isEnabled)
63+
}
64+
65+
bridge.registerHandler("setStartAtLogin") { (anydata, responseCallback) in
66+
if let enable = anydata as? Bool {
67+
LaunchAtLogin.shared.isEnabled = enable
68+
}
69+
}
70+
6171

6272
// ping-pong
6373
bridge.registerHandler("ping"){ (anydata, responseCallback) in

‎ClashX/General/QRCodeUtil.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class QRCodeUtil: NSObject {
3030
}
3131

3232
let detector = CIDetector(ofType: CIDetectorTypeQRCode,
33-
context: nil,
33+
context: CIContext(options: [CIContextOption.useSoftwareRenderer : true]),
3434
options: [CIDetectorAccuracy:CIDetectorAccuracyHigh])!
3535
var ssUrls = [String]()
3636

‎ClashX/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.5.4</string>
20+
<string>1.5.5</string>
2121
<key>CFBundleVersion</key>
22-
<string>1.5.4</string>
22+
<string>1.5.5</string>
2323
<key>LSApplicationCategoryType</key>
2424
<string>public.app-category.utilities</string>
2525
<key>LSMinimumSystemVersion</key>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
Localizable.strings
3+
ClashX
4+
5+
Created by 称一称 on 2018/10/8.
6+
Copyright © 2018年 west2online. All rights reserved.
7+
*/

‎ClashX/Support Files/initConfig.ini

+793
Large diffs are not rendered by default.

‎ClashX/Support Files/sampleConfig.ini

+799
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
Localizable.strings
3+
ClashX
4+
5+
Created by 称一称 on 2018/10/8.
6+
Copyright © 2018年 west2online. All rights reserved.
7+
*/
8+
9+
"Proxy Mode" = "出站模式";
10+
11+
"Global" = "全局";
12+
"Rule" = "规则";
13+
"Direct" = "直连";

‎ClashX/Vendor/NetworkChangeNotifier.swift

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import Foundation
1414

1515
class NetworkChangeNotifier {
1616
static func start(){
17+
// disable this function temporary.
18+
return
19+
1720
let changed: SCDynamicStoreCallBack = {_,_,_ in
1821
print("Network configuration changed")
1922
NotificationCenter.default.post(name: kSystemNetworkStatusDidChange, object: nil)

‎ClashX/clash

-1
This file was deleted.

‎ClashX/go.mod

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module github.com/yichengchen/clashX/ClashX
2+
3+
require (
4+
github.com/Dreamacro/clash v0.7.2-0.20181001114215-16c94454590f
5+
github.com/gopherjs/gopherjs v0.0.0-20181004151105-1babbf986f6f // indirect
6+
github.com/jtolds/gls v4.2.1+incompatible // indirect
7+
github.com/sirupsen/logrus v1.1.1 // indirect
8+
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
9+
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a // indirect
10+
golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4 // indirect
11+
)

‎ClashX/go.sum

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
github.com/Dreamacro/clash v0.7.2-0.20181001114215-16c94454590f h1:Yb4A+0DhfnGVFAdT1B0tZfKNDQR3exfzNfdfInJMsjc=
2+
github.com/Dreamacro/clash v0.7.2-0.20181001114215-16c94454590f/go.mod h1:XZQDVMR5vZV5HBPkZPOpMQN6E/BG84B5+4wPCdjIQlI=
3+
github.com/Dreamacro/go-shadowsocks2 v0.1.1 h1:Z6Z1ZQFtIKqB3ZghASl4taaJmL7SOw+KpJ+QZpax+TI=
4+
github.com/Dreamacro/go-shadowsocks2 v0.1.1/go.mod h1:6Fuc8zRHwXqCV9Xaw9qNfrh6OUYpDGrlPVPW4oQ34Gs=
5+
github.com/Yawning/chacha20 v0.0.0-20170904085104-e3b1f968fc63 h1:I6/SJSN9wJMJ+ZyQaCHUlzoTA4ypU5Bb44YWR1wTY/0=
6+
github.com/Yawning/chacha20 v0.0.0-20170904085104-e3b1f968fc63/go.mod h1:nf+Komq6fVP4SwmKEaVGxHTyQGKREVlwjQKpvOV39yE=
7+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
8+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
9+
github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
10+
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
11+
github.com/go-chi/chi v3.3.3+incompatible h1:KHkmBEMNkwKuK4FdQL7N2wOeB9jnIx7jR5wsuSBEFI8=
12+
github.com/go-chi/chi v3.3.3+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ=
13+
github.com/go-chi/cors v1.0.0 h1:e6x8k7uWbUwYs+aXDoiUzeQFT6l0cygBYyNhD7/1Tg0=
14+
github.com/go-chi/cors v1.0.0/go.mod h1:K2Yje0VW/SJzxiyMYu6iPQYa7hMjQX2i/F491VChg1I=
15+
github.com/go-chi/render v1.0.1 h1:4/5tis2cKaNdnv9zFLfXzcquC9HbeZgCnxGnKrltBS8=
16+
github.com/go-chi/render v1.0.1/go.mod h1:pq4Rr7HbnsdaeHagklXub+p6Wd16Af5l9koip1OvJns=
17+
github.com/gofrs/uuid v3.1.0+incompatible h1:q2rtkjaKT4YEr6E1kamy0Ha4RtepWlQBedyHx0uzKwA=
18+
github.com/gofrs/uuid v3.1.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
19+
github.com/gopherjs/gopherjs v0.0.0-20181004151105-1babbf986f6f h1:JJ2EP5vV3LAD2U1CxQtD7PTOO15Y96kXmKDz7TjxGHs=
20+
github.com/gopherjs/gopherjs v0.0.0-20181004151105-1babbf986f6f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
21+
github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE=
22+
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
23+
github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe h1:CHRGQ8V7OlCYtwaKPJi3iA7J+YdNKdo8j7nG5IgDhjs=
24+
github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
25+
github.com/oschwald/geoip2-golang v1.2.1 h1:3iz+jmeJc6fuCyWeKgtXSXu7+zvkxJbHFXkMT5FVebU=
26+
github.com/oschwald/geoip2-golang v1.2.1/go.mod h1:0LTTzix/Ao1uMvOhAV4iLU0Lz7eCrP94qZWBTDKf0iE=
27+
github.com/oschwald/maxminddb-golang v1.3.0 h1:oTh8IBSj10S5JNlUDg5WjJ1QdBMdeaZIkPEVfESSWgE=
28+
github.com/oschwald/maxminddb-golang v1.3.0/go.mod h1:3jhIUymTJ5VREKyIhWm66LJiQt04F0UCDdodShpjWsY=
29+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
30+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
31+
github.com/sirupsen/logrus v1.1.0 h1:65VZabgUiV9ktjGM5nTq0+YurgTyX+YI2lSSfDjI+qU=
32+
github.com/sirupsen/logrus v1.1.0/go.mod h1:zrgwTnHtNr00buQ1vSptGe8m1f/BbgsPukg8qsT7A+A=
33+
github.com/sirupsen/logrus v1.1.1 h1:VzGj7lhU7KEB9e9gMpAV/v5XT2NVSvLJhJLCWbnkgXg=
34+
github.com/sirupsen/logrus v1.1.1/go.mod h1:zrgwTnHtNr00buQ1vSptGe8m1f/BbgsPukg8qsT7A+A=
35+
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
36+
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
37+
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a h1:JSvGDIbmil4Ui/dDdFBExb7/cmkNjyX5F97oglmvCDo=
38+
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
39+
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
40+
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
41+
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
42+
golang.org/x/crypto v0.0.0-20180927165925-5295e8364332 h1:hvQVdF6P9DX4OiKA5tpehlG6JsgzmyQiThG7q5Bn3UQ=
43+
golang.org/x/crypto v0.0.0-20180927165925-5295e8364332/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
44+
golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4 h1:Vk3wNqEZwyGyei9yq5ekj7frek2u7HUfffJ1/opblzc=
45+
golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
46+
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8=
47+
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
48+
gopkg.in/eapache/channels.v1 v1.1.0 h1:5bGAyKKvyCTWjSj7mhefG6Lc68VyN4MH1v8/7OoeeB4=
49+
gopkg.in/eapache/channels.v1 v1.1.0/go.mod h1:BHIBujSvu9yMTrTYbTCjDD43gUhtmaOtTWDe7sTv1js=
50+
gopkg.in/ini.v1 v1.38.3 h1:ourkRZgR6qjJYoec9lYhX4+nuN1tEbV34dQEQ3IRk9U=
51+
gopkg.in/ini.v1 v1.38.3/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=

‎ClashX/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main
1+
package main // import "github.com/yichengchen/clashX/ClashX"
22

33
import (
44
"C"

‎ClashX/zh-Hans.lproj/Main.strings

+162
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
2+
/* Class = "NSMenuItem"; title = "ERROR"; ObjectID = "0iu-lB-eZN"; */
3+
"0iu-lB-eZN.title" = "ERROR";
4+
5+
/* Class = "NSMenuItem"; title = "Log level"; ObjectID = "3Da-fL-Mzr"; */
6+
"3Da-fL-Mzr.title" = "日志等级";
7+
8+
/* Class = "NSMenuItem"; title = "Generate config"; ObjectID = "5Ab-VJ-iIm"; */
9+
"5Ab-VJ-iIm.title" = "生成配置";
10+
11+
/* Class = "NSMenuItem"; title = "Speed test"; ObjectID = "5Mz-Qv-9Yc"; */
12+
"5Mz-Qv-9Yc.title" = "测速";
13+
14+
/* Class = "NSMenuItem"; title = "QR Code from screen"; ObjectID = "89G-Oc-S3l"; */
15+
"89G-Oc-S3l.title" = "扫描屏幕二维码";
16+
17+
/* Class = "NSTextFieldCell"; title = "GitHub for ClashX:"; ObjectID = "89f-5u-Eo0"; */
18+
"89f-5u-Eo0.title" = "GitHub for ClashX:";
19+
20+
/* Class = "NSMenuItem"; title = "Rule"; ObjectID = "89n-bD-JHk"; */
21+
"89n-bD-JHk.title" = "规则判断";
22+
23+
/* Class = "NSMenuItem"; title = "Set as system proxy"; ObjectID = "8se-yr-wmp"; */
24+
"8se-yr-wmp.title" = "设置为系统代理";
25+
26+
/* Class = "NSMenuItem"; title = "Ports"; ObjectID = "9i0-LH-x04"; */
27+
"9i0-LH-x04.title" = "端口";
28+
29+
/* Class = "NSTextFieldCell"; title = "https://github.com/yichengchen/clashX"; ObjectID = "9ox-Fc-Wk3"; */
30+
"9ox-Fc-Wk3.title" = "https://github.com/yichengchen/clashX";
31+
32+
/* Class = "NSMenu"; title = "Main Menu"; ObjectID = "AYu-sK-qS6"; */
33+
"AYu-sK-qS6.title" = "Main Menu";
34+
35+
/* Class = "NSMenuItem"; title = "Start at login"; ObjectID = "B1J-XB-BiZ"; */
36+
"B1J-XB-BiZ.title" = "开机启动";
37+
38+
/* Class = "NSTextFieldCell"; title = "https://github.com/Dreamacro/clash"; ObjectID = "Bej-j7-KKV"; */
39+
"Bej-j7-KKV.title" = "https://github.com/Dreamacro/clash";
40+
41+
/* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "DIu-9t-BTE"; */
42+
"DIu-9t-BTE.title" = "Text Cell";
43+
44+
/* Class = "NSMenuItem"; title = "Help"; ObjectID = "Dd9-2F-FVY"; */
45+
"Dd9-2F-FVY.title" = "帮助";
46+
47+
/* Class = "NSMenuItem"; title = "Open config Folder"; ObjectID = "DwE-WX-ETZ"; */
48+
"DwE-WX-ETZ.title" = "打开配置文件夹";
49+
50+
/* Class = "NSMenuItem"; title = "Import bunch json file"; ObjectID = "GRE-Ra-Pkx"; */
51+
"GRE-Ra-Pkx.title" = "导入批量Json文件";
52+
53+
/* Class = "NSTextFieldCell"; title = "Proxy"; ObjectID = "Gh1-x5-fnZ"; */
54+
"Gh1-x5-fnZ.title" = "Proxy";
55+
56+
/* Class = "NSMenu"; title = "Generate Config"; ObjectID = "IeJ-1Q-UaF"; */
57+
"IeJ-1Q-UaF.title" = "Generate Config";
58+
59+
/* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "JK9-7d-hkq"; */
60+
"JK9-7d-hkq.title" = "Text Cell";
61+
62+
/* Class = "NSMenuItem"; title = "Config"; ObjectID = "JMV-Dy-CI0"; */
63+
"JMV-Dy-CI0.title" = "配置";
64+
65+
/* Class = "NSMenuItem"; title = "Copy export command"; ObjectID = "Jmb-PK-rMW"; */
66+
"Jmb-PK-rMW.title" = "复制终端代理命令";
67+
68+
/* Class = "NSTextFieldCell"; title = "ClashX"; ObjectID = "MzG-sW-3g7"; */
69+
"MzG-sW-3g7.title" = "ClashX";
70+
71+
/* Class = "NSMenuItem"; title = "Quit"; ObjectID = "NXU-86-Eem"; */
72+
"NXU-86-Eem.title" = "退出";
73+
74+
/* Class = "NSMenu"; title = "Ports"; ObjectID = "Ng4-Ia-KSz"; */
75+
"Ng4-Ia-KSz.title" = "Ports";
76+
77+
/* Class = "NSMenuItem"; title = "Direct"; ObjectID = "Np6-Pm-Lo3"; */
78+
"Np6-Pm-Lo3.title" = "直接连接";
79+
80+
/* Class = "NSMenuItem"; title = "SSURL from pasteboard"; ObjectID = "QX2-2U-3Ad"; */
81+
"QX2-2U-3Ad.title" = "从剪贴板导入SSURL";
82+
83+
/* Class = "NSTextFieldCell"; title = "100"; ObjectID = "TLq-Oj-0EH"; */
84+
"TLq-Oj-0EH.title" = "100";
85+
86+
/* Class = "NSMenu"; title = "Proxy mode (Global)"; ObjectID = "UU2-uE-YB4"; */
87+
"UU2-uE-YB4.title" = "Proxy mode (Global)";
88+
89+
/* Class = "NSMenuItem"; title = "socks port:"; ObjectID = "Uy1-g8-r6Q"; */
90+
"Uy1-g8-r6Q.title" = "socks port:";
91+
92+
/* Class = "NSMenuItem"; title = "Allow connect from Lan"; ObjectID = "Vz8-7n-vx6"; */
93+
"Vz8-7n-vx6.title" = "允许局域网连接";
94+
95+
/* Class = "NSMenuItem"; title = "http port:"; ObjectID = "WNw-8Y-VFw"; */
96+
"WNw-8Y-VFw.title" = "http port:";
97+
98+
/* Class = "NSTableColumn"; headerCell.title = "Proxies"; ObjectID = "WQk-kX-Jr8"; */
99+
"WQk-kX-Jr8.headerCell.title" = "代理";
100+
101+
/* Class = "NSMenuItem"; title = "Dashboard (dev)"; ObjectID = "XG6-2M-PNi"; */
102+
"XG6-2M-PNi.title" = "Dashboard (dev)";
103+
104+
/* Class = "NSMenuItem"; title = "DEBUG"; ObjectID = "XIR-Go-fWA"; */
105+
"XIR-Go-fWA.title" = "DEBUG";
106+
107+
/* Class = "NSMenuItem"; title = "Show network indicator"; ObjectID = "YIO-Vj-64f"; */
108+
"YIO-Vj-64f.title" = "显示实时速率";
109+
110+
/* Class = "NSMenuItem"; title = "Generate Config"; ObjectID = "a4G-S3-jxT"; */
111+
"a4G-S3-jxT.title" = "生成配置文件";
112+
113+
/* Class = "NSTextFieldCell"; title = "2018-08-19"; ObjectID = "aib-YP-mvk"; */
114+
"aib-YP-mvk.title" = "2018-08-19";
115+
116+
/* Class = "NSMenuItem"; title = "INFO"; ObjectID = "d8V-h0-0zF"; */
117+
"d8V-h0-0zF.title" = "INFO";
118+
119+
/* Class = "NSTableColumn"; headerCell.title = "Delay(ms)"; ObjectID = "gNv-c4-4xR"; */
120+
"gNv-c4-4xR.headerCell.title" = "延迟(毫秒)";
121+
122+
/* Class = "NSViewController"; title = "SpeedTest"; ObjectID = "gtD-dn-7Dy"; */
123+
"gtD-dn-7Dy.title" = "测速";
124+
125+
/* Class = "NSMenuItem"; title = "About"; ObjectID = "hUb-k9-TEf"; */
126+
"hUb-k9-TEf.title" = "关于";
127+
128+
/* Class = "NSMenuItem"; title = "api port:"; ObjectID = "hwG-qf-DeZ"; */
129+
"hwG-qf-DeZ.title" = "api port:";
130+
131+
/* Class = "NSMenuItem"; title = "Proxy mode (Global)"; ObjectID = "jGT-1M-xJu"; */
132+
"jGT-1M-xJu.title" = "Proxy mode (Global)";
133+
134+
/* Class = "NSMenuItem"; title = "WARNING"; ObjectID = "ko2-Ir-DxA"; */
135+
"ko2-Ir-DxA.title" = "WARNING";
136+
137+
/* Class = "NSTextFieldCell"; title = "GitHub for Clash:"; ObjectID = "lsq-AW-K0M"; */
138+
"lsq-AW-K0M.title" = "GitHub for Clash:";
139+
140+
/* Class = "NSMenu"; title = "Help"; ObjectID = "ogW-pn-jeR"; */
141+
"ogW-pn-jeR.title" = "帮助";
142+
143+
/* Class = "NSMenuItem"; title = "Check Update"; ObjectID = "p0T-J8-Emx"; */
144+
"p0T-J8-Emx.title" = "检查更新";
145+
146+
/* Class = "NSTextFieldCell"; title = "Version:1.1.0(1.1.0)"; ObjectID = "pVE-Ti-FcK"; */
147+
"pVE-Ti-FcK.title" = "Version:1.1.0(1.1.0)";
148+
149+
/* Class = "NSMenuItem"; title = "Reload config"; ObjectID = "q3G-VH-eyy"; */
150+
"q3G-VH-eyy.title" = "重载配置文件";
151+
152+
/* Class = "NSMenu"; title = "Config"; ObjectID = "tck-zU-JKQ"; */
153+
"tck-zU-JKQ.title" = "配置";
154+
155+
/* Class = "NSMenu"; title = "Log level"; ObjectID = "wqo-3T-4qO"; */
156+
"wqo-3T-4qO.title" = "日志等级";
157+
158+
/* Class = "NSMenuItem"; title = "Show Log"; ObjectID = "xxZ-9l-69m"; */
159+
"xxZ-9l-69m.title" = "显示日志";
160+
161+
/* Class = "NSMenuItem"; title = "Global"; ObjectID = "yiM-U4-MNg"; */
162+
"yiM-U4-MNg.title" = "全局连接";

‎appcast.xml

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
<description>Most recent changes with links to updates.</description>
77
<language>cn</language>
88
<item>
9-
<title>1.5.4</title>
9+
<title>1.5.5</title>
1010
<description>
1111
<![CDATA[
12+
<ul>
13+
<li>1.5.5</li>
14+
<li>bug fixs</li>
15+
<li>add Chinese support at status bar</li>
16+
</ul>
1217
<ul>
1318
<li>1.5.4</li>
1419
<li>Add Fallback group</li>
@@ -111,7 +116,7 @@
111116
]]>
112117
</description>
113118
<pubDate>Sun, 26 Aug 2018 15:20:11 +0000</pubDate>
114-
<enclosure url="https://github.com/yichengchen/clashX/releases/download/1.5.4/ClashX.dmg" sparkle:version="1.5.4" type="application/octet-stream"/>
119+
<enclosure url="https://github.com/yichengchen/clashX/releases/download/1.5.5/ClashX.dmg" sparkle:version="1.5.5" type="application/octet-stream"/>
115120
</item>
116121
</channel>
117122
</rss>

‎zh-Hans.lproj/Main.storyboard

+683
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.