From 09df20a910c6969ade09e94d99d29cc1b2ae3d77 Mon Sep 17 00:00:00 2001 From: Alter Step Date: Fri, 18 Apr 2014 00:19:18 -0700 Subject: [PATCH] Port to Mavericks --- .../DNSCrypt-OSX-Installer.pkgproj | 69 +- .../com.opendns.osx.DNSCryptMenuBar.plist | 2 +- DNSCrypt-OSX-Installer/sign.sh | 2 +- .../DNSCrypt.xcodeproj/project.pbxproj | 12 +- DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h | 42 +- DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m | 38 +- .../DNSCrypt/en.lproj/DNSCrypt.xib | 2734 +++-------------- .../DNSCrypt/extra/html/releasenotes.haml | 7 + .../DNSCrypt/extra/html/releasenotes.html | 42 +- .../DNSCrypt/extra/usr/lib/libldns.1.dylib | Bin 578728 -> 271876 bytes .../DNSCrypt/extra/usr/scripts/common.inc | 3 + .../extra/usr/scripts/start-dnscrypt-proxy.sh | 3 + 12 files changed, 512 insertions(+), 2442 deletions(-) mode change 100755 => 100644 DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/lib/libldns.1.dylib diff --git a/DNSCrypt-OSX-Installer/DNSCrypt-OSX-Installer.pkgproj b/DNSCrypt-OSX-Installer/DNSCrypt-OSX-Installer.pkgproj index 16b2b93..f382765 100755 --- a/DNSCrypt-OSX-Installer/DNSCrypt-OSX-Installer.pkgproj +++ b/DNSCrypt-OSX-Installer/DNSCrypt-OSX-Installer.pkgproj @@ -511,38 +511,6 @@ UID 0 - - CHILDREN - - GID - 0 - PATH - /usr/local/lib/dnscrypt-proxy/libdcplugin_example_ldns_forward_after_nxdomain.la - PATH_TYPE - 0 - PERMISSIONS - 493 - TYPE - 3 - UID - 0 - - - CHILDREN - - GID - 0 - PATH - /usr/local/lib/dnscrypt-proxy/libdcplugin_example_ldns_forward_after_nxdomain.so - PATH_TYPE - 0 - PERMISSIONS - 493 - TYPE - 3 - UID - 0 - CHILDREN @@ -671,6 +639,39 @@ CHILDREN + + CHILDREN + + + CHILDREN + + GID + 0 + PATH + /usr/local/share/dnscrypt-proxy/dnscrypt-resolvers.csv + PATH_TYPE + 0 + PERMISSIONS + 420 + TYPE + 3 + UID + 0 + + + GID + 0 + PATH + dnscrypt-proxy + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 2 + UID + 0 + CHILDREN @@ -828,7 +829,7 @@ USE_HFS+_COMPRESSION VERSION - 1.3.1 + 1.4.0 UUID 7F7D70AB-F7A2-4027-8304-3063C7B9532F @@ -1460,7 +1461,7 @@ GID 80 PATH - /Users/j/Library/Developer/Xcode/DerivedData/DNSCrypt-Menubar-fcseadxtcidaaddjtyicaarzthfd/Build/Products/Release/DNSCrypt-Menubar.app + /Users/j/Library/Developer/Xcode/DerivedData/DNSCrypt-Menubar-fcseadxtcidaaddjtyicaarzthfd/Build/Products/Release/DNSCrypt Menubar.app PATH_TYPE 0 PERMISSIONS diff --git a/DNSCrypt-OSX-Installer/com.opendns.osx.DNSCryptMenuBar.plist b/DNSCrypt-OSX-Installer/com.opendns.osx.DNSCryptMenuBar.plist index 22e54d8..e3e6438 100644 --- a/DNSCrypt-OSX-Installer/com.opendns.osx.DNSCryptMenuBar.plist +++ b/DNSCrypt-OSX-Installer/com.opendns.osx.DNSCryptMenuBar.plist @@ -10,7 +10,7 @@ ProgramArguments - /Applications/DNSCrypt-Menubar.app/Contents/MacOS/DNSCrypt-Menubar + /Applications/DNSCrypt Menubar.app/Contents/MacOS/DNSCrypt Menubar LimitLoadToSessionType Aqua diff --git a/DNSCrypt-OSX-Installer/sign.sh b/DNSCrypt-OSX-Installer/sign.sh index 37330b9..3f4cc2f 100755 --- a/DNSCrypt-OSX-Installer/sign.sh +++ b/DNSCrypt-OSX-Installer/sign.sh @@ -1,6 +1,6 @@ #! /bin/sh -VERSION='0.19' +VERSION='0.21' cd build || exit 1 [ -d DNSCrypt.mpkg ] || exit 1 diff --git a/DNSCrypt-Preference-Pane/DNSCrypt.xcodeproj/project.pbxproj b/DNSCrypt-Preference-Pane/DNSCrypt.xcodeproj/project.pbxproj index 5cc4732..95b3549 100644 --- a/DNSCrypt-Preference-Pane/DNSCrypt.xcodeproj/project.pbxproj +++ b/DNSCrypt-Preference-Pane/DNSCrypt.xcodeproj/project.pbxproj @@ -192,7 +192,7 @@ 0946B0B713F47F52008277C6 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0460; + LastUpgradeCheck = 0510; }; buildConfigurationList = 0946B0BA13F47F52008277C6 /* Build configuration list for PBXProject "DNSCrypt" */; compatibilityVersion = "Xcode 3.2"; @@ -328,14 +328,17 @@ 0946B0DF13F47F53008277C6 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_ENABLE_OBJC_ARC = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", ); + GCC_ENABLE_OBJC_GC = no; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "DNSCrypt/DNSCrypt-Prefix.pch"; + GCC_VERSION = ""; INFOPLIST_FILE = "DNSCrypt/DNSCrypt-Info.plist"; INSTALL_PATH = "$(HOME)/Library/PreferencePanes"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -346,14 +349,17 @@ 0946B0E013F47F53008277C6 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_ENABLE_OBJC_ARC = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", ); + GCC_ENABLE_OBJC_GC = no; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "DNSCrypt/DNSCrypt-Prefix.pch"; + GCC_VERSION = ""; INFOPLIST_FILE = "DNSCrypt/DNSCrypt-Info.plist"; INSTALL_PATH = "$(HOME)/Library/PreferencePanes"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h index a730269..c426c2f 100644 --- a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h +++ b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h @@ -52,7 +52,6 @@ typedef enum { NSTextField *_statusText; WebView *_previewNotesWebView; WebView *_releaseNotesWebView; - WebView *_feedbackWebView; WebView *_aboutWebView; NSTextFieldCell *_staticResolversTextField; NSTextField *_blacklistIPsTextField; @@ -62,29 +61,28 @@ typedef enum { NSButton *_viewLogButton; NSButton *_queryLoggingButton; } -@property (nonatomic, retain) IBOutlet NSTabView *tabView; -@property (nonatomic, retain) IBOutlet NSTabViewItem *aboutTabViewItem; -@property (nonatomic, retain) IBOutlet NSTabViewItem *releaseNotesTabViewItem; +@property (nonatomic, strong) IBOutlet NSTabView *tabView; +@property (nonatomic, strong) IBOutlet NSTabViewItem *aboutTabViewItem; +@property (nonatomic, strong) IBOutlet NSTabViewItem *releaseNotesTabViewItem; -@property (nonatomic, retain) IBOutlet NSButton *dnscryptButton; -@property (nonatomic, retain) IBOutlet NSButton *opendnsButton; -@property (nonatomic, retain) IBOutlet NSButton *familyShieldButton; -@property (nonatomic, retain) IBOutlet NSButton *fallbackButton; +@property (nonatomic, strong) IBOutlet NSButton *dnscryptButton; +@property (nonatomic, strong) IBOutlet NSButton *opendnsButton; +@property (nonatomic, strong) IBOutlet NSButton *familyShieldButton; +@property (nonatomic, strong) IBOutlet NSButton *fallbackButton; -@property (nonatomic, retain) IBOutlet NSTextField *currentResolverTextField; -@property (nonatomic, retain) IBOutlet NSImageView *statusImageView; -@property (nonatomic, retain) IBOutlet NSTextField *statusText; -@property (nonatomic, retain) IBOutlet WebView *previewNotesWebView; -@property (nonatomic, retain) IBOutlet WebView *releaseNotesWebView; -@property (nonatomic, retain) IBOutlet WebView *feedbackWebView; -@property (nonatomic, retain) IBOutlet WebView *aboutWebView; -@property (nonatomic, retain) IBOutlet NSTextFieldCell *staticResolversTextField; -@property (nonatomic, retain) IBOutlet NSTextField *blacklistIPsTextField; -@property (nonatomic, retain) IBOutlet NSTextField *blacklistDomainsTextField; -@property (nonatomic, retain) IBOutlet NSTextField *exceptionsTextField; -@property (nonatomic, retain) IBOutlet WebView *helpWebView; -@property (nonatomic, retain) IBOutlet NSButton *viewLogButton; -@property (nonatomic, retain) IBOutlet NSButton *queryLoggingButton; +@property (nonatomic, strong) IBOutlet NSTextField *currentResolverTextField; +@property (nonatomic, strong) IBOutlet NSImageView *statusImageView; +@property (nonatomic, strong) IBOutlet NSTextField *statusText; +@property (nonatomic, strong) IBOutlet WebView *previewNotesWebView; +@property (nonatomic, strong) IBOutlet WebView *releaseNotesWebView; +@property (nonatomic, strong) IBOutlet WebView *aboutWebView; +@property (nonatomic, strong) IBOutlet NSTextFieldCell *staticResolversTextField; +@property (nonatomic, strong) IBOutlet NSTextField *blacklistIPsTextField; +@property (nonatomic, strong) IBOutlet NSTextField *blacklistDomainsTextField; +@property (nonatomic, strong) IBOutlet NSTextField *exceptionsTextField; +@property (nonatomic, strong) IBOutlet WebView *helpWebView; +@property (nonatomic, strong) IBOutlet NSButton *viewLogButton; +@property (nonatomic, strong) IBOutlet NSButton *queryLoggingButton; - (void) mainViewDidLoad; diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m index ea7f851..f893fff 100644 --- a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m +++ b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m @@ -14,7 +14,6 @@ @synthesize releaseNotesTabViewItem = _releaseNotesTabViewItem; @synthesize previewNotesWebView = _previewNotesWebView; @synthesize releaseNotesWebView = _releaseNotesWebView; -@synthesize feedbackWebView = _feedbackWebView; @synthesize aboutWebView = _aboutWebView; @synthesize staticResolversTextField = _staticResolversTextField; @synthesize blacklistIPsTextField = _blacklistIPsTextField; @@ -53,9 +52,7 @@ DNSConfigurationState currentState = kDNS_CONFIGURATION_UNKNOWN; [task launch]; data = [[pipe fileHandleForReading] readDataToEndOfFile]; [task waitUntilExit]; - [task release]; - [pipe release]; - result = [[[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding] autorelease]; + result = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding]; if ([result hasSuffix: @"\n"]) { result = [result substringToIndex: result.length - 1]; } @@ -114,19 +111,19 @@ DNSConfigurationState currentState = kDNS_CONFIGURATION_UNKNOWN; switch (currentState) { case kDNS_CONFIGURATION_UNKNOWN: _statusText.stringValue = NSLocalizedString(@"No network", @"Status"); - _statusImageView.image = [[[NSImage alloc] initWithContentsOfFile: [bundle pathForImageResource: @"shield_red.png"]] autorelease]; + _statusImageView.image = [[NSImage alloc] initWithContentsOfFile: [bundle pathForImageResource: @"shield_red.png"]]; break; case kDNS_CONFIGURATION_VANILLA: _statusText.stringValue = NSLocalizedString(@"Unprotected", @"Status"); - _statusImageView.image = [[[NSImage alloc] initWithContentsOfFile: [bundle pathForImageResource: @"shield_red.png"]] autorelease]; + _statusImageView.image = [[NSImage alloc] initWithContentsOfFile: [bundle pathForImageResource: @"shield_red.png"]]; break; case kDNS_CONFIGURATION_OPENDNS: _statusText.stringValue = NSLocalizedString(@"Unencrypted", @"Status"); - _statusImageView.image = [[[NSImage alloc] initWithContentsOfFile: [bundle pathForImageResource: @"shield_yellow.png"]] autorelease]; + _statusImageView.image = [[NSImage alloc] initWithContentsOfFile: [bundle pathForImageResource: @"shield_yellow.png"]]; break; case kDNS_CONFIGURATION_LOCALHOST: _statusText.stringValue = NSLocalizedString(@"Protected", @"Status"); - _statusImageView.image = [[[NSImage alloc] initWithContentsOfFile: [bundle pathForImageResource: @"shield_green.png"]] autorelease]; + _statusImageView.image = [[NSImage alloc] initWithContentsOfFile: [bundle pathForImageResource: @"shield_green.png"]]; break; default: return; @@ -175,7 +172,7 @@ DNSConfigurationState currentState = kDNS_CONFIGURATION_UNKNOWN; [self setCheckBoxesEnabled: FALSE]; _statusText.stringValue = NSLocalizedString(@"Updating", @"Updating network configuraiton"); - _statusImageView.image = [[[NSImage alloc] initWithContentsOfFile: [bundle pathForImageResource: @"ajax-loader.gif"]] autorelease]; + _statusImageView.image = [[NSImage alloc] initWithContentsOfFile: [bundle pathForImageResource: @"ajax-loader.gif"]]; _currentResolverTextField.stringValue = @""; [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-c", @"cd '" kDNSCRIPT_SCRIPTS_BASE_DIR @"' && exec ./gui-push-conf-change.sh menubar", nil]]; @@ -292,18 +289,6 @@ DNSConfigurationState currentState = kDNS_CONFIGURATION_UNKNOWN; [self performSelector: @selector(waitForUpdate) withObject: self afterDelay:kREFRESH_DELAY]; } -- (void) webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame { - if (sender != _feedbackWebView) { - return; - } - NSString *res; - res = [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-c", @"/usr/local/sbin/dnscrypt-proxy --version | head -n 1", nil]]; - NSCharacterSet *charset = [NSCharacterSet characterSetWithCharactersInString: @"\r\n<>'"]; - res = [[res componentsSeparatedByCharactersInSet: charset] componentsJoinedByString: @" "]; - NSString *script = [NSString stringWithFormat: @"document.querySelector('textarea[name=feedback]').value='\\n\\n\\n--\\nOpenDNS user interface for OSX " kDNSCRYPT_PACKAGE_VERSION "\\n%@'", res]; - [sender stringByEvaluatingJavaScriptFromString: script]; -} - - (void) mainViewDidLoad { currentState = kDNS_CONFIGURATION_UNKNOWN; @@ -314,7 +299,6 @@ DNSConfigurationState currentState = kDNS_CONFIGURATION_UNKNOWN; NSString *version = kDNSCRYPT_PACKAGE_VERSION; NSString *softwareBlurbFormat = NSLocalizedString(@"This software (v: %@) encrypts and authenticates DNS packets between your computer and OpenDNS. This prevents man-in-the-middle attacks and snooping of DNS traffic by ISPs or others.", @"Description of what the package does - %@ is replaced by the version number"); - NSString *provideFeedback = NSLocalizedString(@"Please help by providing feedback!", @"Ask for feedback"); NSString *describePorts = NSLocalizedString(@"DNSCrypt can use UDP and TCP ports 53 and 443.", @"Describe what ports DNSCrypt uses"); NSString *describeFallback = NSLocalizedString(@"If you prefer reliability over security, enable fallback to insecure DNS.", @"Describe what the 'fallback to insecure mode' checkbox does"); @@ -322,9 +306,6 @@ DNSConfigurationState currentState = kDNS_CONFIGURATION_UNKNOWN; [htmlString appendFormat: softwareBlurbFormat, version]; [htmlString appendString: @"

"]; - [htmlString appendString: @""]; - [htmlString appendString: provideFeedback]; - [htmlString appendString: @""]; [htmlString appendString: @"