mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-27 05:04:27 +00:00
Add AppKitPrevention header to reduce redundancy.
Note this header should be included last in implementation files, which is why I added extra padding.
This commit is contained in:
1 parent
c56694382e
commit
135d05b8b8
32 files changed
+76
-91
No files matched your search
@@ -732,6 +732,7 @@
|
||||
7205C4331E12C23C00E370AE /* ConfigGenerateAppcast.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigGenerateAppcast.xcconfig; sourceTree = "<group>"; };
|
||||
7205C4341E12C66D00E370AE /* ConfigGenerateAppcastRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigGenerateAppcastRelease.xcconfig; sourceTree = "<group>"; };
|
||||
7205C4351E12CA7000E370AE /* ConfigGenerateAppcastDebug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigGenerateAppcastDebug.xcconfig; sourceTree = "<group>"; };
|
||||
720767D01E2E3DD300F9A850 /* AppKitPrevention.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppKitPrevention.h; sourceTree = "<group>"; };
|
||||
720B16421C66433D006985FB /* UITests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "UITests-Info.plist"; path = "UITests/UITests-Info.plist"; sourceTree = SOURCE_ROOT; };
|
||||
720B16431C66433D006985FB /* SUTestApplicationTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SUTestApplicationTest.swift; path = UITests/SUTestApplicationTest.swift; sourceTree = SOURCE_ROOT; };
|
||||
7210C7671B9A9A1500EB90AC /* SUUnarchiverTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUUnarchiverTest.swift; sourceTree = "<group>"; };
|
||||
@@ -1036,6 +1037,7 @@
|
||||
1495006D195FBBBD00BC5B5B /* Sparkle */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
720767D01E2E3DD300F9A850 /* AppKitPrevention.h */,
|
||||
61299B3909CB055000B7442F /* Appcast Support */,
|
||||
55C14BD5136EEFD000649790 /* Autoupdate */,
|
||||
089C1665FE841158C02AAC07 /* Framework Resources */,
|
||||
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// AppKitPrevention.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 1/17/17.
|
||||
// Copyright © 2017 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
// #include (not #import) this header to prevent AppKit from being imported
|
||||
// Note this should be your LAST #include in your implementation file
|
||||
|
||||
// If this error is triggered, you can have Xcode indicate to you which source file including this header caused the issue
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a core or daemon-safe module and should NOT import AppKit
|
||||
#endif
|
||||
Vendored
+2
-3
@@ -12,9 +12,8 @@
|
||||
#import "SULocalizations.h"
|
||||
#import "SUErrors.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface NSXMLElement (SUAppcastExtensions)
|
||||
@property (readonly, copy) NSDictionary *attributesAsDictionary;
|
||||
|
||||
Vendored
+2
-3
@@ -10,9 +10,8 @@
|
||||
#import "SULog.h"
|
||||
#import "SUConstants.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUAppcastItem ()
|
||||
@property (copy, readwrite) NSString *title;
|
||||
|
||||
Vendored
+2
-3
@@ -15,9 +15,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <xar/xar.h>
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
static BOOL applyBinaryDeltaToFile(xar_t x, xar_file_t file, NSString *sourceFilePath, NSString *destinationFilePath)
|
||||
{
|
||||
|
||||
Vendored
+2
-3
@@ -18,9 +18,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <xar/xar.h>
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
int compareFiles(const FTSENT **a, const FTSENT **b)
|
||||
{
|
||||
|
||||
Vendored
+2
-3
@@ -21,9 +21,8 @@
|
||||
#include <sys/xattr.h>
|
||||
#include <xar/xar.h>
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
extern int bsdiff(int argc, const char **argv);
|
||||
|
||||
|
||||
Vendored
+1
-3
@@ -20,9 +20,7 @@
|
||||
#define VERSION_COMMAND @"version"
|
||||
#define VERSION_ALTERNATE_COMMAND @"--version"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
static void printUsage(NSString *programName)
|
||||
{
|
||||
|
||||
Vendored
+2
-3
@@ -13,9 +13,8 @@
|
||||
#import "SULog.h"
|
||||
#import "SUFileManager.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUBinaryDeltaUnarchiver ()
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -8,9 +8,8 @@
|
||||
|
||||
#import "SUBundleIcon.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUBundleIcon
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -11,9 +11,8 @@
|
||||
#import "SUCodeSigningVerifier.h"
|
||||
#import "SULog.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUCodeSigningVerifier
|
||||
|
||||
|
||||
Vendored
+1
-3
@@ -13,9 +13,7 @@
|
||||
#define DEBUG 0
|
||||
#endif
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
// Define some minimum intervals to avoid DoS-like checking attacks
|
||||
const NSTimeInterval SUMinimumUpdateCheckInterval = DEBUG ? 60 : (60 * 60);
|
||||
|
||||
Vendored
+2
-3
@@ -16,9 +16,8 @@
|
||||
#import "SULog.h"
|
||||
#include <CommonCrypto/CommonDigest.h>
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUDSAVerifier {
|
||||
SecKeyRef _secKey;
|
||||
|
||||
Vendored
+2
-3
@@ -10,9 +10,8 @@
|
||||
#import "SUUnarchiverNotifier.h"
|
||||
#import "SULog.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUDiskImageUnarchiver ()
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -15,9 +15,8 @@
|
||||
#include <sys/errno.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
static char SUAppleQuarantineIdentifier[] = "com.apple.quarantine";
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -9,9 +9,8 @@
|
||||
#import "SUGuidedPackageInstaller.h"
|
||||
#import "SUFileManager.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUGuidedPackageInstaller ()
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -11,9 +11,8 @@
|
||||
#include <sys/mount.h> // For statfs for isRunningOnReadOnlyVolume
|
||||
#import "SULog.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
// This class should not rely on AppKit and should also be process independent
|
||||
// For example, it should not have code that tests writabilty to somewhere on disk,
|
||||
|
||||
Vendored
+2
-3
@@ -15,9 +15,8 @@
|
||||
#import "SULog.h"
|
||||
#import "SUErrors.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUInstaller
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -13,9 +13,8 @@
|
||||
|
||||
#include "SULog.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Constants:
|
||||
|
||||
Vendored
+2
-3
@@ -7,9 +7,8 @@
|
||||
|
||||
#import "SUOperatingSystem.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101000
|
||||
@interface NSProcessInfo ()
|
||||
|
||||
Vendored
+2
-3
@@ -11,9 +11,8 @@
|
||||
#import "SUErrors.h"
|
||||
#import "SULog.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUPackageInstaller ()
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -11,9 +11,8 @@
|
||||
#import "SULog.h"
|
||||
#import "SUErrors.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUPipedUnarchiver ()
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -14,9 +14,8 @@
|
||||
#import "SULog.h"
|
||||
#import "SUErrors.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUPlainInstaller ()
|
||||
|
||||
|
||||
+2
-3
@@ -9,9 +9,8 @@
|
||||
#import "SUVersionComparisonProtocol.h"
|
||||
#import "SUStandardVersionComparator.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUStandardVersionComparator
|
||||
|
||||
|
||||
Vendored
+2
-4
@@ -9,14 +9,12 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SUSystemProfiler.h"
|
||||
|
||||
#import "SUHost.h"
|
||||
#import "SUOperatingSystem.h"
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
static NSString *const SUSystemProfilerApplicationNameKey = @"appName";
|
||||
static NSString *const SUSystemProfilerApplicationVersionKey = @"appVersion";
|
||||
|
||||
Vendored
+2
-3
@@ -11,9 +11,8 @@
|
||||
#import "SUConstants.h"
|
||||
#import "SUFileManager.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUSystemUpdateInfo
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -12,9 +12,8 @@
|
||||
#import "SUDiskImageUnarchiver.h"
|
||||
#import "SUBinaryDeltaUnarchiver.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUUnarchiver
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -10,9 +10,8 @@
|
||||
#import "SULocalizations.h"
|
||||
#import "SUErrors.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUUnarchiverNotifier ()
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -8,9 +8,8 @@
|
||||
|
||||
#import "SUUpdatePermissionResponse.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUUpdatePermissionResponse
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -13,9 +13,8 @@
|
||||
#import "SUHost.h"
|
||||
#import "SULog.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUUpdateValidator ()
|
||||
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
|
||||
#import "SUFileOperationConstants.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
char * const SUFileOpRemoveQuarantineCommand = "xattr-d-apple-quarantine";
|
||||
char * const SUFileOpCopyCommand = "cp";
|
||||
|
||||
+2
-3
@@ -10,9 +10,8 @@
|
||||
#import "SUFileManager.h"
|
||||
#import "SUFileOperationConstants.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
// If we fail, we exit with a unique status code
|
||||
// We don't try to NSLog because the logs can't be seen anywhere,
|
||||
|
||||
Reference in new issue
Block a user