Skip to content

Commit

Permalink
fix yanue#420, #
Browse files Browse the repository at this point in the history
  • Loading branch information
yanue committed Mar 1, 2020
1 parent 1593ceb commit ca9cb03
Show file tree
Hide file tree
Showing 12 changed files with 174 additions and 347 deletions.
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ target 'V2rayU' do
pod "GCDWebServer"
pod 'SwiftSocket', :git => 'https://github.com/odariusgeorge/SwiftSocket.git', :branch => 'patch-1'
pod 'MASShortcut'
pod 'Swifter', '~> 1.4.7'


end
6 changes: 5 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ PODS:
- Preferences (0.3.0)
- QRCoder (1.1.0)
- Sparkle (1.21.3)
- Swifter (1.4.7)
- SwiftSocket (2.0.2)
- SwiftyJSON (5.0.0)

Expand All @@ -17,6 +18,7 @@ DEPENDENCIES:
- Preferences (from `https://github.com/sindresorhus/Preferences.git`)
- QRCoder
- Sparkle
- Swifter (~> 1.4.7)
- SwiftSocket (from `https://github.com/odariusgeorge/SwiftSocket.git`, branch `patch-1`)
- SwiftyJSON

Expand All @@ -27,6 +29,7 @@ SPEC REPOS:
- MASShortcut
- QRCoder
- Sparkle
- Swifter
- SwiftyJSON

EXTERNAL SOURCES:
Expand All @@ -51,9 +54,10 @@ SPEC CHECKSUMS:
Preferences: cfd4b0cbc5adfb5781b819ad3a000324d0fc9f48
QRCoder: cbd2bee531cc86d286df7942334cfed94c803ae4
Sparkle: 3f75576db8b0265adef36c43249d747f22d0b708
Swifter: 2327ef5d872c638aebab79646ce494af508b0c8f
SwiftSocket: 2f7a7e26a7489f5f33b69da914ec366368dfcbcc
SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7

PODFILE CHECKSUM: 407a3efc71b95e99861a0c05290182ea384ac364
PODFILE CHECKSUM: 5f8ca0729788c399da041513b75057075032e5e1

COCOAPODS: 1.8.4
4 changes: 0 additions & 4 deletions V2rayU.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
6D6DF5F67A917F78FF652D45 /* .gitignore in Resources */ = {isa = PBXBuildFile; fileRef = 6D6DF8F5112A8407EE959998 /* .gitignore */; };
6D6DF6553CF221AEB71913EE /* PreferenceGeneral.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D6DFFB29020127E034AD168 /* PreferenceGeneral.swift */; };
6D6DF6F065067CD879201FF9 /* Scanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D6DF87840CDA04AF0E9D36E /* Scanner.swift */; };
6D6DF70EA6ADC7628931E630 /* HttpServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D6DF1B2E4D0B61B7390F1B1 /* HttpServer.swift */; };
6D6DF807BE591BE396221EF3 /* PreferenceAdvance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D6DF701C75D8D416096D717 /* PreferenceAdvance.swift */; };
6D6DF87497313615AFE3320A /* PreferencePac.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D6DF3151BBA6E56836AF6DE /* PreferencePac.swift */; };
6D6DF8BFC33F97E9AFCA5A4B /* V2rayConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D6DFD9F5991B38B128888D6 /* V2rayConfig.swift */; };
Expand Down Expand Up @@ -194,7 +193,6 @@
6D6DF085C3C411989C416D0D /* user-rule.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "user-rule.txt"; sourceTree = "<group>"; };
6D6DF12EA09D2D80788666D0 /* QrcodeWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QrcodeWindow.swift; sourceTree = "<group>"; };
6D6DF181C5D472DBBB71B72A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = V2rayU/Base.lproj/PreferencePac.xib; sourceTree = SOURCE_ROOT; };
6D6DF1B2E4D0B61B7390F1B1 /* HttpServer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HttpServer.swift; sourceTree = "<group>"; };
6D6DF3151BBA6E56836AF6DE /* PreferencePac.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferencePac.swift; sourceTree = "<group>"; };
6D6DF3A2857899778B719CE1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = V2rayU/Base.lproj/PreferenceAbout.xib; sourceTree = SOURCE_ROOT; };
6D6DF3C1564D0EBC5A99C9C1 /* gfwlist.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = gfwlist.txt; sourceTree = "<group>"; };
Expand Down Expand Up @@ -341,7 +339,6 @@
667029D121AFB86E0079EF41 /* QrcodeWindow.xib */,
6D6DF12EA09D2D80788666D0 /* QrcodeWindow.swift */,
6D6DFBED570A0D1FDED0BD53 /* preference */,
6D6DF1B2E4D0B61B7390F1B1 /* HttpServer.swift */,
6618372823E9BF1A000F7410 /* ToastWindow.swift */,
6618372C23E9BF73000F7410 /* ToastWindow.xib */,
66107B8822DEDBE4002FFB60 /* Localizable.strings */,
Expand Down Expand Up @@ -679,7 +676,6 @@
6D6DF6553CF221AEB71913EE /* PreferenceGeneral.swift in Sources */,
66BC2B89228C589E00FBB716 /* V2raySubscribe.swift in Sources */,
6D6DF807BE591BE396221EF3 /* PreferenceAdvance.swift in Sources */,
6D6DF70EA6ADC7628931E630 /* HttpServer.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
18 changes: 8 additions & 10 deletions V2rayU/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Cocoa
import ServiceManagement
import Swifter

let launcherAppIdentifier = "net.yanue.V2rayU.Launcher"
let appVersion = getAppVersion()
Expand All @@ -25,6 +26,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
// default settings
self.checkDefault()

// auto Clear Logs
if UserDefaults.getBool(forKey: .autoClearLog) {
print("ClearLogs")
V2rayLaunch.ClearLogs()
}

// auto launch
if UserDefaults.getBool(forKey: .autoLaunch) {
// Insert code here to initialize your application
Expand All @@ -37,12 +44,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}

// auto Clear Logs
if UserDefaults.getBool(forKey: .autoClearLog) {
print("ClearLogs")
V2rayLaunch.ClearLogs()
}

// check v2ray core
V2rayCore().check()
// generate plist
Expand Down Expand Up @@ -128,9 +129,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {

@objc func onWakeNote(note: NSNotification) {
print("onWakeNote")
if UserDefaults.getBool(forKey: .v2rayTurnOn) {
V2rayLaunch.Start()
}
// check v2ray core
V2rayCore().check()
// auto check updates
Expand All @@ -147,7 +145,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}

@objc func onSleepNote(note: NSNotification) {
V2rayLaunch.Stop()
print("onSleepNote")
}

func applicationWillTerminate(_ aNotification: Notification) {
Expand Down
2 changes: 1 addition & 1 deletion V2rayU/Base.lproj/PreferenceAdvance.xib
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1Aj-RG-gYn">
<rect key="frame" x="119" y="56" width="222" height="17"/>
<rect key="frame" x="51" y="56" width="359" height="17"/>
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Label" id="GyI-8o-VH6">
<font key="font" metaFont="label" size="12"/>
Expand Down
Loading

0 comments on commit ca9cb03

Please sign in to comment.