-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d2af41
commit b627cda
Showing
494 changed files
with
49,196 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
github "SwiftyBeaver/SwiftyBeaver" | ||
github "sparkle-project/Sparkle" "ui-separation-and-xpc" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
github "SwiftyBeaver/SwiftyBeaver" "1.5.2" | ||
github "sparkle-project/Sparkle" "67320fcb80bb802453e97542d0da4d0e6eae702d" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
AccessModifierOffset: -4 | ||
AlignEscapedNewlinesLeft: true | ||
AlignTrailingComments: false | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: None | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakBeforeMultilineStrings: false | ||
AlwaysBreakTemplateDeclarations: false | ||
BinPackParameters: true | ||
BreakBeforeBinaryOperators: true | ||
BreakBeforeBraces: Linux | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializersBeforeComma: false | ||
ColumnLimit: 0 | ||
CommentPragmas: '^ IWYU pragma:' | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: false | ||
#DerivePointerAlignment: false | ||
DisableFormat: false | ||
#ForEachMacros: foreach,Q_FOREACH | ||
IndentCaseLabels: true | ||
IndentFunctionDeclarationAfterType: true | ||
IndentWidth: 4 | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
Language: Cpp | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: All | ||
ObjCSpaceAfterProperty: true | ||
ObjCSpaceBeforeProtocolList: true | ||
#PointerAlignment: Right | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 1 | ||
SpacesInAngles: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInContainerLiterals: false | ||
SpacesInParentheses: false | ||
Standard: Cpp03 | ||
TabWidth: 4 | ||
UseTab: Never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
build/ | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata | ||
*.xccheckout | ||
*.moved-aside | ||
DerivedData | ||
*.xcuserstate | ||
|
||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear on external disk | ||
.Spotlight-V100 | ||
.Trashes | ||
|
||
# With Carthage, if Sparkle is included as a Git submodule (e.g. with the | ||
# --use-submodules option), the main module's .gitignore can't reach all the | ||
# way inside the submodule to ignore the added Carthage/Build symlink, and Git | ||
# keeps complaining about untracked changes in the submodule forever, which | ||
# is very annoying. To avoid that issue, ignore here in Sparkle instead. | ||
Carthage/Build | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: objective-c | ||
osx_image: xcode9 | ||
before_install: | ||
- brew update | ||
script: make ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// AgentConnection.h | ||
// Sparkle | ||
// | ||
// Created by Mayur Pawashe on 7/17/16. | ||
// Copyright © 2016 Sparkle Project. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@protocol AgentConnectionDelegate <NSObject> | ||
|
||
- (void)agentConnectionDidInitiate; | ||
- (void)agentConnectionDidInvalidate; | ||
|
||
@end | ||
|
||
@protocol SPUInstallerAgentProtocol; | ||
|
||
@interface AgentConnection : NSObject | ||
|
||
- (instancetype)initWithHostBundleIdentifier:(NSString *)bundleIdentifier delegate:(id<AgentConnectionDelegate>)delegate; | ||
|
||
- (void)startListener; | ||
- (void)invalidate; | ||
|
||
@property (nonatomic, readonly, nullable) id<SPUInstallerAgentProtocol> agent; | ||
@property (nonatomic, readonly) BOOL connected; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
108 changes: 108 additions & 0 deletions
108
Carthage/Checkouts/Sparkle/Autoupdate/AgentConnection.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
// | ||
// AgentConnection.m | ||
// Sparkle | ||
// | ||
// Created by Mayur Pawashe on 7/17/16. | ||
// Copyright © 2016 Sparkle Project. All rights reserved. | ||
// | ||
|
||
#import "AgentConnection.h" | ||
#import "SPUMessageTypes.h" | ||
#import "SPUInstallerAgentProtocol.h" | ||
#import "SUInstallerAgentInitiationProtocol.h" | ||
|
||
|
||
#include "AppKitPrevention.h" | ||
|
||
@interface AgentConnection () <NSXPCListenerDelegate, SUInstallerAgentInitiationProtocol> | ||
|
||
@property (nonatomic) NSXPCListener *xpcListener; | ||
@property (nonatomic, nullable) NSXPCConnection *activeConnection; | ||
@property (nonatomic, nullable) id<SPUInstallerAgentProtocol> agent; | ||
@property (nonatomic, weak) id<AgentConnectionDelegate> delegate; | ||
@property (nonatomic) BOOL connected; | ||
|
||
@end | ||
|
||
@implementation AgentConnection | ||
|
||
@synthesize xpcListener = _xpcListener; | ||
@synthesize activeConnection = _activeConnection; | ||
@synthesize agent = _agent; | ||
@synthesize delegate = _delegate; | ||
@synthesize connected = _connected; | ||
|
||
- (instancetype)initWithHostBundleIdentifier:(NSString *)bundleIdentifier delegate:(id<AgentConnectionDelegate>)delegate | ||
{ | ||
self = [super init]; | ||
if (self != nil) { | ||
// Agents should always be the one that connect to daemons due to how mach bootstraps work | ||
// For this reason, we are the ones that are creating a listener, not the agent | ||
_xpcListener = [[NSXPCListener alloc] initWithMachServiceName:SPUProgressAgentServiceNameForBundleIdentifier(bundleIdentifier)]; | ||
_xpcListener.delegate = self; | ||
_delegate = delegate; | ||
} | ||
return self; | ||
} | ||
|
||
- (void)startListener | ||
{ | ||
[self.xpcListener resume]; | ||
} | ||
|
||
- (void)invalidate | ||
{ | ||
self.delegate = nil; | ||
|
||
[self.activeConnection invalidate]; | ||
self.activeConnection = nil; | ||
|
||
[self.xpcListener invalidate]; | ||
self.xpcListener = nil; | ||
} | ||
|
||
- (BOOL)listener:(NSXPCListener *)__unused listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection | ||
{ | ||
if (self.activeConnection != nil) { | ||
[newConnection invalidate]; | ||
return NO; | ||
} | ||
|
||
newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerAgentInitiationProtocol)]; | ||
newConnection.exportedObject = self; | ||
|
||
newConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SPUInstallerAgentProtocol)]; | ||
|
||
self.activeConnection = newConnection; | ||
|
||
__weak AgentConnection *weakSelf = self; | ||
newConnection.interruptionHandler = ^{ | ||
[weakSelf.activeConnection invalidate]; | ||
}; | ||
|
||
newConnection.invalidationHandler = ^{ | ||
dispatch_async(dispatch_get_main_queue(), ^{ | ||
[weakSelf.delegate agentConnectionDidInvalidate]; | ||
}); | ||
}; | ||
|
||
[newConnection resume]; | ||
|
||
self.agent = newConnection.remoteObjectProxy; | ||
|
||
return YES; | ||
} | ||
|
||
- (void)connectionDidInitiateWithReply:(void (^)(void))acknowledgement | ||
{ | ||
dispatch_async(dispatch_get_main_queue(), ^{ | ||
self.connected = YES; | ||
|
||
[self.delegate agentConnectionDidInitiate]; | ||
self.delegate = nil; | ||
}); | ||
|
||
acknowledgement(); | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// AppInstaller.h | ||
// Sparkle | ||
// | ||
// Created by Mayur Pawashe on 3/7/16. | ||
// Copyright © 2016 Sparkle Project. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "SUUnarchiverProtocol.h" | ||
|
||
@interface AppInstaller : NSObject | ||
|
||
- (instancetype)initWithHostBundleIdentifier:(NSString *)hostBundleIdentifier; | ||
|
||
- (void)start; | ||
|
||
- (void)cleanupAndExitWithStatus:(int)status __attribute__((noreturn)); | ||
|
||
@end |
Oops, something went wrong.