From abf06c1085330f7a0966882b6c7fb62681b94d8e Mon Sep 17 00:00:00 2001 From: Timothy Qiu Date: Wed, 13 Sep 2017 09:59:48 +0800 Subject: [PATCH 1/5] Fixes #490 by quoting script path in Apple Script --- ShadowsocksX-NG/ProxyConfHelper.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShadowsocksX-NG/ProxyConfHelper.m b/ShadowsocksX-NG/ProxyConfHelper.m index ba7f6f43..d81b9472 100644 --- a/ShadowsocksX-NG/ProxyConfHelper.m +++ b/ShadowsocksX-NG/ProxyConfHelper.m @@ -51,12 +51,12 @@ + (void)install { NSString *helperPath = [NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] resourcePath], @"install_helper.sh"]; NSLog(@"run install script: %@", helperPath); NSDictionary *error; - NSString *script = [NSString stringWithFormat:@"do shell script \"bash %@\" with administrator privileges", helperPath]; + NSString *script = [NSString stringWithFormat:@"do shell script \"/bin/bash \\\"%@\\\"\" with administrator privileges", helperPath]; NSAppleScript *appleScript = [[NSAppleScript new] initWithSource:script]; if ([appleScript executeAndReturnError:&error]) { NSLog(@"installation success"); } else { - NSLog(@"installation failure"); + NSLog(@"installation failure: %@", error); } } } From 19c8d047ebe4f2cbefe2fcaffa0ecc7925b999e3 Mon Sep 17 00:00:00 2001 From: Qiu Yuzhou Date: Sat, 16 Sep 2017 17:11:22 +0800 Subject: [PATCH 2/5] Quote script path in Apple Script. --- ShadowsocksX-NG/AppDelegate.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowsocksX-NG/AppDelegate.swift b/ShadowsocksX-NG/AppDelegate.swift index a90f763b..02426916 100755 --- a/ShadowsocksX-NG/AppDelegate.swift +++ b/ShadowsocksX-NG/AppDelegate.swift @@ -57,7 +57,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele if attrs[FileAttributeKey.ownerAccountName] as! String != NSUserName() { //try fileMgr.setAttributes([FileAttributeKey.ownerAccountName: NSUserName()], ofItemAtPath: dirPath) let bashFilePath = Bundle.main.path(forResource: "fix_dir_owner.sh", ofType: nil)! - let script = "do shell script \"bash \(bashFilePath) \(NSUserName()) \" with administrator privileges" + let script = "do shell script \"bash \\\"(bashFilePath)\\\" \(NSUserName()) \" with administrator privileges" if let appleScript = NSAppleScript(source: script) { var err: NSDictionary? = nil appleScript.executeAndReturnError(&err) From a32bd42c65128e3d713cd06ae121e46a74ef87e9 Mon Sep 17 00:00:00 2001 From: Qiu Yuzhou Date: Sat, 16 Sep 2017 17:16:51 +0800 Subject: [PATCH 3/5] Fix #484. Remove "Shadowsocks-NG" and keep the "SIP002" and "Legacy" on the qrcode. --- ShadowsocksX-NG/SWBQRCodeWindowController.m | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ShadowsocksX-NG/SWBQRCodeWindowController.m b/ShadowsocksX-NG/SWBQRCodeWindowController.m index a11cf5b7..20e0d4fe 100644 --- a/ShadowsocksX-NG/SWBQRCodeWindowController.m +++ b/ShadowsocksX-NG/SWBQRCodeWindowController.m @@ -19,7 +19,7 @@ - (void)windowDidLoad { [super windowDidLoad]; // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. - [self setQRCode:self.qrCode withOverlayText:@"Shadowsocks-NG SIP002"]; + [self setQRCode:self.qrCode withOverlayText:@"SIP002"]; } - (void)setQRCode:(NSString*) qrCode withOverlayText: (NSString*) text { @@ -35,14 +35,9 @@ - (void)setQRCode:(NSString*) qrCode withOverlayText: (NSString*) text { }; NSMutableAttributedString* attrsText = [[NSMutableAttributedString alloc] initWithString: text attributes: attrs]; - [attrsText setAttributes:@{ - NSForegroundColorAttributeName: [NSColor darkGrayColor], - NSBackgroundColorAttributeName: [NSColor whiteColor], - NSFontAttributeName: [NSFont fontWithName:@"Helvetica" size:(CGFloat)16], - } range: NSMakeRange(0, 14)]; [image lockFocus]; - [attrsText drawAtPoint: NSMakePoint(45, 8)]; + [attrsText drawAtPoint: NSMakePoint(100, 5)]; [image unlockFocus]; } self.imageView.image = image; @@ -108,9 +103,9 @@ - (IBAction) copyQRCode: (id) sender{ - (void)flagsChanged:(NSEvent *)event { NSUInteger modifiers = event.modifierFlags & NSDeviceIndependentModifierFlagsMask; if (modifiers & NSAlternateKeyMask) { - [self setQRCode:self.legacyQRCode withOverlayText:@"Shadowsocks-NG Legacy"]; + [self setQRCode:self.legacyQRCode withOverlayText:@"Legacy"]; } else { - [self setQRCode:self.qrCode withOverlayText:@"Shadowsocks-NG SIP002"]; + [self setQRCode:self.qrCode withOverlayText:@"SIP002"]; } } From 8ee9c7837acf73d9cfac79f23c5690b6ac6bc356 Mon Sep 17 00:00:00 2001 From: Qiu Yuzhou Date: Sat, 16 Sep 2017 17:19:34 +0800 Subject: [PATCH 4/5] Bump versiont to 1.6.1 --- README.md | 2 +- ShadowsocksX-NG/Info.plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7d7d82f9..1d5a7caa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ShadowsocksX-NG -Current version is 1.6.0 +Current version is 1.6.1 [![Build Status](https://travis-ci.org/shadowsocks/ShadowsocksX-NG.svg?branch=develop)](https://travis-ci.org/shadowsocks/ShadowsocksX-NG) diff --git a/ShadowsocksX-NG/Info.plist b/ShadowsocksX-NG/Info.plist index 96dbd739..77049e26 100644 --- a/ShadowsocksX-NG/Info.plist +++ b/ShadowsocksX-NG/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.6.0 + 1.6.1 CFBundleSignature ???? CFBundleURLTypes From b31452e984f48d831fc8a913d8f8a6a2bf972911 Mon Sep 17 00:00:00 2001 From: Qiu Yuzhou Date: Sat, 16 Sep 2017 17:20:11 +0800 Subject: [PATCH 5/5] Remove gitter link in readme. --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 1d5a7caa..2478a23f 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,6 @@ so that you could configure your apps to use the SOCKS5 proxy manually. ## Contributing -[![gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ShadowsocksX-NG/Lobby) - Contributions must be available on a separately named branch based on the latest version of the main branch `develop`. ref: [GitFlow](http://nvie.com/posts/a-successful-git-branching-model/)