Skip to content

Commit

Permalink
Merge pull request #61 from reaperhulk/updated-sparkle
Browse files Browse the repository at this point in the history
allow arm64 building with newer sparkle framework
  • Loading branch information
johndbritton committed Dec 17, 2020
2 parents 1792137 + f5c5641 commit c86f193
Show file tree
Hide file tree
Showing 188 changed files with 5,721 additions and 278 deletions.
2 changes: 1 addition & 1 deletion Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<key>NSUIElement</key>
<string>1</string>
<key>SUFeedURL</key>
<string>http://www.abyssoft.com/software/teleport/versions.xml</string>
<string>https://invalid.invalid</string>
<key>TPRevision</key>
<string>DEFINED_BY_GIT</string>
</dict>
Expand Down
1 change: 1 addition & 0 deletions Sparkle.framework/PrivateHeaders
43 changes: 43 additions & 0 deletions Sparkle.framework/Versions/A/Headers/SPUDownloadData.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// SPUDownloadData.h
// Sparkle
//
// Created by Mayur Pawashe on 8/10/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif

#import "SUExport.h"

NS_ASSUME_NONNULL_BEGIN

/*!
* A class for containing downloaded data along with some information about it.
*/
SU_EXPORT @interface SPUDownloadData : NSObject <NSSecureCoding>

- (instancetype)initWithData:(NSData *)data textEncodingName:(NSString * _Nullable)textEncodingName MIMEType:(NSString * _Nullable)MIMEType;

/*!
* The raw data that was downloaded.
*/
@property (nonatomic, readonly) NSData *data;

/*!
* The IANA charset encoding name if available. Eg: "utf-8"
*/
@property (nonatomic, readonly, nullable, copy) NSString *textEncodingName;

/*!
* The MIME type if available. Eg: "text/plain"
*/
@property (nonatomic, readonly, nullable, copy) NSString *MIMEType;

@end

NS_ASSUME_NONNULL_END
25 changes: 25 additions & 0 deletions Sparkle.framework/Versions/A/Headers/SPUDownloader.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// SPUDownloader.h
// Downloader
//
// Created by Mayur Pawashe on 4/1/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import "SPUDownloaderProtocol.h"

@protocol SPUDownloaderDelegate;

// This object implements the protocol which we have defined. It provides the actual behavior for the service. It is 'exported' by the service to make it available to the process hosting the service over an NSXPCConnection.
@interface SPUDownloader : NSObject <SPUDownloaderProtocol>

// Due to XPC remote object reasons, this delegate is strongly referenced
// Invoke cleanup when done with this instance
- (instancetype)initWithDelegate:(id <SPUDownloaderDelegate>)delegate;

@end
38 changes: 38 additions & 0 deletions Sparkle.framework/Versions/A/Headers/SPUDownloaderDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// SPUDownloaderDelegate.h
// Sparkle
//
// Created by Mayur Pawashe on 4/1/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif

NS_ASSUME_NONNULL_BEGIN

@class SPUDownloadData;

@protocol SPUDownloaderDelegate <NSObject>

// This is only invoked for persistent downloads
- (void)downloaderDidSetDestinationName:(NSString *)destinationName temporaryDirectory:(NSString *)temporaryDirectory;

// Under rare cases, this may be called more than once, in which case the current progress should be reset back to 0
// This is only invoked for persistent downloads
- (void)downloaderDidReceiveExpectedContentLength:(int64_t)expectedContentLength;

// This is only invoked for persistent downloads
- (void)downloaderDidReceiveDataOfLength:(uint64_t)length;

// downloadData is nil if this is a persisent download, otherwise it's non-nil if it's a temporary download
- (void)downloaderDidFinishWithTemporaryDownloadData:(SPUDownloadData * _Nullable)downloadData;

- (void)downloaderDidFailWithError:(NSError *)error;

@end

NS_ASSUME_NONNULL_END
13 changes: 13 additions & 0 deletions Sparkle.framework/Versions/A/Headers/SPUDownloaderDeprecated.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// SPUDownloaderDeprecated.h
// Sparkle
//
// Created by Deadpikle on 12/20/17.
// Copyright © 2017 Sparkle Project. All rights reserved.
//

#import "SPUDownloader.h"

@interface SPUDownloaderDeprecated : SPUDownloader <SPUDownloaderProtocol>

@end
34 changes: 34 additions & 0 deletions Sparkle.framework/Versions/A/Headers/SPUDownloaderProtocol.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// SPUDownloaderProtocol.h
// PersistentDownloader
//
// Created by Mayur Pawashe on 4/1/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif

NS_ASSUME_NONNULL_BEGIN

@class SPUURLRequest;

// The protocol that this service will vend as its API. This header file will also need to be visible to the process hosting the service.
@protocol SPUDownloaderProtocol

- (void)startPersistentDownloadWithRequest:(SPUURLRequest *)request bundleIdentifier:(NSString *)bundleIdentifier desiredFilename:(NSString *)desiredFilename;

- (void)startTemporaryDownloadWithRequest:(SPUURLRequest *)request;

- (void)downloadDidFinish;

- (void)cleanup;

- (void)cancel;

@end

NS_ASSUME_NONNULL_END
20 changes: 20 additions & 0 deletions Sparkle.framework/Versions/A/Headers/SPUDownloaderSession.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// SPUDownloaderSession.h
// Sparkle
//
// Created by Deadpikle on 12/20/17.
// Copyright © 2017 Sparkle Project. All rights reserved.
//

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import "SPUDownloader.h"
#import "SPUDownloaderProtocol.h"

NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0)
@interface SPUDownloaderSession : SPUDownloader <SPUDownloaderProtocol>

@end
35 changes: 35 additions & 0 deletions Sparkle.framework/Versions/A/Headers/SPUURLRequest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// SPUURLRequest.h
// Sparkle
//
// Created by Mayur Pawashe on 5/19/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif

NS_ASSUME_NONNULL_BEGIN

// A class that wraps NSURLRequest and implements NSSecureCoding
// This class exists because NSURLRequest did not support NSSecureCoding in macOS 10.8
// I have not verified if NSURLRequest in 10.9 implements NSSecureCoding or not
@interface SPUURLRequest : NSObject <NSSecureCoding>

// Creates a new URL request
// Only these properties are currently tracked:
// * URL
// * Cache policy
// * Timeout interval
// * HTTP header fields
// * networkServiceType
+ (instancetype)URLRequestWithRequest:(NSURLRequest *)request;

@property (nonatomic, readonly) NSURLRequest *request;

@end

NS_ASSUME_NONNULL_END
25 changes: 13 additions & 12 deletions Sparkle.framework/Versions/A/Headers/SUAppcast.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,27 @@
#ifndef SUAPPCAST_H
#define SUAPPCAST_H

#import <Foundation/NSURLDownload.h>
#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import "SUExport.h"

@protocol SUAppcastDelegate;
NS_ASSUME_NONNULL_BEGIN

@class SUAppcastItem;
SU_EXPORT @interface SUAppcast : NSObject <NSURLDownloadDelegate>
SU_EXPORT @interface SUAppcast : NSObject

@property (weak) id<SUAppcastDelegate> delegate;
@property (copy) NSString *userAgentString;
@property (copy) NSDictionary *httpHeaders;
@property (copy, nullable) NSString *userAgentString;
@property (copy, nullable) NSDictionary<NSString *, NSString *> *httpHeaders;

- (void)fetchAppcastFromURL:(NSURL *)url;
- (void)fetchAppcastFromURL:(NSURL *)url inBackground:(BOOL)bg completionBlock:(void (^)(NSError *_Nullable))err;
- (SUAppcast *)copyWithoutDeltaUpdates;

@property (readonly, copy) NSArray *items;
@property (readonly, copy, nullable) NSArray *items;
@end

@protocol SUAppcastDelegate <NSObject>
- (void)appcastDidFinishLoading:(SUAppcast *)appcast;
- (void)appcast:(SUAppcast *)appcast failedToLoadWithError:(NSError *)error;
@end
NS_ASSUME_NONNULL_END

#endif
16 changes: 14 additions & 2 deletions Sparkle.framework/Versions/A/Headers/SUAppcastItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,40 @@
#ifndef SUAPPCASTITEM_H
#define SUAPPCASTITEM_H

#include "SUExport.h"
#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import "SUExport.h"
@class SUSignatures;

SU_EXPORT @interface SUAppcastItem : NSObject
@property (copy, readonly) NSString *title;
@property (copy, readonly) NSString *dateString;
@property (copy, readonly) NSDate *date;
@property (copy, readonly) NSString *itemDescription;
@property (strong, readonly) NSURL *releaseNotesURL;
@property (copy, readonly) NSString *DSASignature;
@property (strong, readonly) SUSignatures *signatures;
@property (copy, readonly) NSString *minimumSystemVersion;
@property (copy, readonly) NSString *maximumSystemVersion;
@property (strong, readonly) NSURL *fileURL;
@property (nonatomic, readonly) uint64_t contentLength;
@property (copy, readonly) NSString *versionString;
@property (copy, readonly) NSString *osString;
@property (copy, readonly) NSString *displayVersionString;
@property (copy, readonly) NSDictionary *deltaUpdates;
@property (strong, readonly) NSURL *infoURL;
@property (copy, readonly) NSNumber* phasedRolloutInterval;

// Initializes with data from a dictionary provided by the RSS class.
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict failureReason:(NSString **)error;

@property (getter=isDeltaUpdate, readonly) BOOL deltaUpdate;
@property (getter=isCriticalUpdate, readonly) BOOL criticalUpdate;
@property (getter=isMacOsUpdate, readonly) BOOL macOsUpdate;
@property (getter=isInformationOnlyUpdate, readonly) BOOL informationOnlyUpdate;

// Returns the dictionary provided in initWithDictionary; this might be useful later for extensions.
@property (readonly, copy) NSDictionary *propertiesDictionary;
Expand Down
26 changes: 26 additions & 0 deletions Sparkle.framework/Versions/A/Headers/SUCodeSigningVerifier.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// SUCodeSigningVerifier.h
// Sparkle
//
// Created by Andy Matuschak on 7/5/12.
//
//

#ifndef SUCODESIGNINGVERIFIER_H
#define SUCODESIGNINGVERIFIER_H

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import "SUExport.h"

SU_EXPORT @interface SUCodeSigningVerifier : NSObject
+ (BOOL)codeSignatureAtBundleURL:(NSURL *)oldBundlePath matchesSignatureAtBundleURL:(NSURL *)newBundlePath error:(NSError **)error;
+ (BOOL)codeSignatureIsValidAtBundleURL:(NSURL *)bundlePath error:(NSError **)error;
+ (BOOL)bundleAtURLIsCodeSigned:(NSURL *)bundlePath;
+ (NSDictionary *)codeSignatureInfoAtBundleURL:(NSURL *)bundlePath;
@end

#endif
21 changes: 17 additions & 4 deletions Sparkle.framework/Versions/A/Headers/SUErrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,32 @@
#ifndef SUERRORS_H
#define SUERRORS_H

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import "SUExport.h"

/**
* Error domain used by Sparkle
*/
SU_EXPORT extern NSString *const SUSparkleErrorDomain;

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc++98-compat"
typedef NS_ENUM(OSStatus, SUError) {
// Appcast phase errors.
SUAppcastParseError = 1000,
SUNoUpdateError = 1001,
SUAppcastError = 1002,
SURunningFromDiskImageError = 1003,

// Downlaod phase errors.
SURunningTranslocated = 1004,

// Download phase errors.
SUTemporaryDirectoryError = 2000,

SUDownloadError = 2001,

// Extraction phase errors.
SUUnarchivingError = 3000,
SUSignatureError = 3001,
Expand All @@ -38,7 +46,12 @@ typedef NS_ENUM(OSStatus, SUError) {
SUMissingInstallerToolError = 4003,
SURelaunchError = 4004,
SUInstallationError = 4005,
SUDowngradeError = 4006
SUDowngradeError = 4006,
SUInstallationCancelledError = 4007,

// System phase errors
SUSystemPowerOffError = 5000
};
#pragma clang diagnostic pop

#endif
Loading

0 comments on commit c86f193

Please sign in to comment.