Add more AppKit prevention guards

This commit is contained in:
Zorg committed 2016-08-13 10:35:01 -04:00
1 parent d8ce7cb48b
commit fa2e857b4e
23 files changed
+92

No files matched your search

+4
View File
@@ -9,6 +9,10 @@
#import "SPUInstallationInfo.h"
#import "SUAppcastItem.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
static NSString *SUAppcastItemKey = @"SUAppcastItem";
static NSString *SUCanSilentlyInstallKey = @"SUCanSilentlyInstall";
+4
View File
@@ -12,6 +12,10 @@
#import "SUDSAVerifier.h"
#import "SUCodeSigningVerifier.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
@implementation SPUInstallerValidation
+ (BOOL)validateBundleUpdateForHost:(SUHost *)host newBundlePath:(NSString *)newBundlePath archivePath:(NSString *)archivePath DSASignature:(NSString *)DSASignature
+4
View File
@@ -9,6 +9,10 @@
#import "SPUMessageTypes.h"
#import "SUHost.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
NSString *SPUAppcastItemArchiveKey = @"SPUAppcastItemArchive";
// Tags added to the bundle identifier which is used as Mach service names
+4
View File
@@ -1,6 +1,10 @@
#import <Foundation/Foundation.h>
#import "AppInstaller.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
int main(int __unused argc, const char __unused *argv[])
{
@autoreleasepool
@@ -9,6 +9,10 @@
#import "SUInstallerConnection.h"
#import "SPUSystemAuthorization.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection Keep Alive";
@interface SUInstallerConnection () <SUInstallerCommunicationProtocol>
@@ -8,6 +8,10 @@
#import "SUXPCInstallerConnection.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
@interface SUXPCInstallerConnection ()
@property (nonatomic) NSXPCConnection *connection;
+4
View File
@@ -10,6 +10,10 @@
#import "SUInstallerConnection.h"
#import "SUInstallerCommunicationProtocol.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
@interface ServiceDelegate : NSObject <NSXPCListenerDelegate>
@end
+4
View File
@@ -9,6 +9,10 @@
#import "SUInstallerStatus.h"
#import "SPUSystemAuthorization.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
@interface SUInstallerStatus ()
@property (nonatomic, copy) void (^invalidationBlock)(void);
+4
View File
@@ -8,6 +8,10 @@
#import "SUXPCInstallerStatus.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
@interface SUXPCInstallerStatus ()
@property (nonatomic) NSXPCConnection *connection;
+4
View File
@@ -9,6 +9,10 @@
#import <Foundation/Foundation.h>
#import "SUInstallerStatus.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
@interface ServiceDelegate : NSObject <NSXPCListenerDelegate>
@end
@@ -12,6 +12,10 @@
#import "SPUURLRequest.h"
#import "SUErrors.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
static NSString *SUPersistentDownloadingReason = @"Downloading persistent file";
@interface SUPersistentDownloader () <NSURLDownloadDelegate>
+4
View File
@@ -8,6 +8,10 @@
#import "SPUDownloadData.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
static NSString *SPUDownloadDataKey = @"SPUDownloadData";
static NSString *SPUDownloadTextEncodingKey = @"SPUDownloadTextEncoding";
static NSString *SPUDownloadMIMETypeKey = @"SPUDownloadMIMEType";
+4
View File
@@ -9,6 +9,10 @@
#import "SPULocalCacheDirectory.h"
#import "SULog.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
static NSTimeInterval OLD_ITEM_DELETION_INTERVAL = 86400 * 10; // 10 days
@implementation SPULocalCacheDirectory
+4
View File
@@ -9,6 +9,10 @@
#import "SPUSecureCoding.h"
#import "SULog.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
static NSString *SURootObjectArchiveKey = @"SURootObjectArchive";
NSData * _Nullable SPUArchiveRootObjectSecurely(id<NSSecureCoding> rootObject)
+4
View File
@@ -10,6 +10,10 @@
#import "SPUInstallationType.h"
#import "SUFileManager.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
BOOL SPUNeedsSystemAuthorizationAccess(NSString *path, NSString *installationType)
{
BOOL needsAuthorization;
+4
View File
@@ -14,6 +14,10 @@
#import "SPUDownloadData.h"
#import "SUErrors.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
void SPUDownloadURLWithRequest(NSURLRequest * request, void (^completionBlock)(SPUDownloadData * _Nullable, NSError * _Nullable))
{
id<SUTemporaryDownloaderProtocol> downloader = nil;
+4
View File
@@ -8,6 +8,10 @@
#import "SPUURLRequest.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
static NSString *SPUURLRequestURLKey = @"SPUURLRequestURL";
static NSString *SPUURLRequestCachePolicyKey = @"SPUURLRequestCachePolicy";
static NSString *SPUURLRequestTimeoutIntervalKey = @"SPUURLRequestTimeoutInterval";
+4
View File
@@ -8,6 +8,10 @@
#import "SPUUpdaterTimer.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
@interface SPUUpdaterTimer ()
@property (nonatomic, readonly, weak) id<SPUUpdaterTimerDelegate> delegate;
+4
View File
@@ -8,6 +8,10 @@
#import "SPUXPCServiceInfo.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
BOOL SPUXPCServiceExists(NSString *bundleName)
{
NSBundle *xpcBundle = SPUXPCServiceBundle(bundleName);
+4
View File
@@ -18,6 +18,10 @@
#import "SPUInstallationInfo.h"
#import "SUDownloadedUpdate.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
@interface SUBasicUpdateDriver () <SUAppcastDriverDelegate>
@property (nonatomic, weak, readonly) id<SUBasicUpdateDriverDelegate> delegate;
+4
View File
@@ -8,6 +8,10 @@
#import "SUDownloadedUpdate.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
@implementation SUDownloadedUpdate
@synthesize updateItem = _updateItem;
+4
View File
@@ -15,6 +15,10 @@
#import "SUXPCInstallerStatus.h"
#import "SULog.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
// This timeout is if probing the installer takes too long
// It should be at least more than 1 second since a probe can take around that much time
#define PROBE_TIMEOUT 7
@@ -12,6 +12,10 @@
#import "SUErrors.h"
#import "SUConstants.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
#endif
@interface SUTemporaryDownloader () <NSURLDownloadDelegate>
@property (nonatomic, copy) void (^completionBlock)(SPUDownloadData * _Nullable downloadData, NSError * _Nullable error);