Remove old compile time availability guards (#2920)

This commit is contained in:
Zorg authored and GitHub committed 2026-09-12 20:55:57 -07:00
1 parent beb5a35007
commit 2be877fd1f
6 files changed
+1 -36

No files matched your search

-2
View File
@@ -73,8 +73,6 @@ SPU_OBJC_DIRECT_MEMBERS @interface SPUDeltaArchiveItem : NSObject
// For reading, file items cannot be extracted out of order.
@protocol SPUDeltaArchiveProtocol <NSObject>
@property (nonatomic, readonly, class) BOOL maySupportSafeExtraction;
// If non-nil, there was an error with reading or writing data from the archive
@property (nonatomic, readonly, nullable) NSError *error;
-5
View File
@@ -52,11 +52,6 @@ typedef struct
@synthesize error = _error;
+ (BOOL)maySupportSafeExtraction
{
return YES;
}
- (instancetype)initWithPatchFileForWriting:(NSString *)patchFile
{
self = [super init];
-16
View File
@@ -17,17 +17,9 @@
#include "AppKitPrevention.h"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120000
#define HAS_XAR_GET_SAFE_PATH 1
#else
#define HAS_XAR_GET_SAFE_PATH 0
#endif
#if HAS_XAR_GET_SAFE_PATH
// This is preferred over xar_get_path (which is deprecated) when it's available
// Don't use OS availability for this API
extern char *xar_get_safe_path(xar_file_t f) __attribute__((weak_import));
#endif
// Xar attribute keys
#define BINARY_DELTA_ATTRIBUTES_KEY "binary-delta-attributes"
@@ -92,12 +84,6 @@ extern char *xar_get_safe_path(xar_file_t f) __attribute__((weak_import));
}
}
// This indicates if safe extraction is available at compile time (SDK), but not if it's available at runtime.
+ (BOOL)maySupportSafeExtraction
{
return HAS_XAR_GET_SAFE_PATH;
}
- (nullable SPUDeltaArchiveHeader *)readHeader
{
NSString *patchFile = _patchFile;
@@ -323,7 +309,6 @@ static xar_file_t xarAddFile(NSMutableDictionary<NSString *, NSValue *> *fileTab
xar_iter_t iter = xar_iter_new();
for (xar_file_t file = xar_file_first(_x, iter); file; file = xar_file_next(iter)) {
char *pathCString;
#if HAS_XAR_GET_SAFE_PATH
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability-new"
if (xar_get_safe_path != NULL) {
@@ -331,7 +316,6 @@ static xar_file_t xarAddFile(NSMutableDictionary<NSString *, NSValue *> *fileTab
}
#pragma clang diagnostic pop
else
#endif
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+1 -1
View File
@@ -72,7 +72,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa
// Reject patches that did not generate valid hierarchical xar container paths
// These will not succeed to patch using recent versions of BinaryDelta
if ([[archive class] maySupportSafeExtraction] && majorDiffVersion == SUBinaryDeltaMajorVersion2 && minorDiffVersion < 3) {
if (majorDiffVersion == SUBinaryDeltaMajorVersion2 && minorDiffVersion < 3) {
if (error != NULL) {
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadCorruptFileError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"This patch version (%u.%u) is too old and potentially unsafe to apply. Please re-generate the patch using the latest version of BinaryDelta or generate_appcast. New version %u.%u patches will still be compatible with older versions of Sparkle.", majorDiffVersion, minorDiffVersion, majorDiffVersion, latestMinorVersionForMajorVersion(majorDiffVersion)] }];
}
@@ -28,12 +28,6 @@
*/
static const NSTimeInterval SUTerminationTimeDelay = 0.3;
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 140000
@interface NSApplication (ActivationAPIs)
- (void)activate;
@end
#endif
@interface InstallerProgressAppController () <NSApplicationDelegate, SPUInstallerAgentProtocol>
@end
-6
View File
@@ -35,12 +35,6 @@
#import <AppKit/AppKit.h>
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 140000
@interface NSApplication (ActivationAPIs)
- (void)activate;
@end
#endif
// Delay before we need to show the checking for updates progress window when user initiates an update check
static const NSTimeInterval SUShowCheckingForUpdatesTimeDelay = 0.3;