mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-26 04:57:54 +00:00
Merge pull request #1252 from ksuther/ui-separation-and-xpc
Silence Xcode 10 "Messaging unqualified id" warnings by specifying types (XPC branch)
This commit is contained in:
28 files changed
+68
-80
No files matched your search
@@ -376,7 +376,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
return;
|
||||
}
|
||||
|
||||
if (![archiveAttributes[NSFileType] isEqualToString:NSFileTypeRegular]) {
|
||||
if (![(NSString *)archiveAttributes[NSFileType] isEqualToString:NSFileTypeRegular]) {
|
||||
SULog(SULogLevelError, @"Error: Received bad archive file type: %@", archiveAttributes[NSFileType]);
|
||||
[self cleanupAndExitWithStatus:EXIT_FAILURE];
|
||||
return;
|
||||
|
||||
@@ -243,7 +243,7 @@ BOOL modifyPermissions(NSString *path, mode_t desiredPermissions)
|
||||
return NO;
|
||||
}
|
||||
mode_t newMode = ([permissions unsignedShortValue] & ~PERMISSION_FLAGS) | desiredPermissions;
|
||||
int (*changeModeFunc)(const char *, mode_t) = [[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeSymbolicLink] ? lchmod : chmod;
|
||||
int (*changeModeFunc)(const char *, mode_t) = [(NSString *)[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeSymbolicLink] ? lchmod : chmod;
|
||||
if (changeModeFunc([path fileSystemRepresentation], newMode) != 0) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ static NSString *temporaryPatchFile(NSString *patchFile)
|
||||
|
||||
static BOOL shouldSkipDeltaCompression(NSDictionary *originalInfo, NSDictionary *newInfo)
|
||||
{
|
||||
unsigned long long fileSize = [newInfo[INFO_SIZE_KEY] unsignedLongLongValue];
|
||||
unsigned long long fileSize = [(NSNumber *)newInfo[INFO_SIZE_KEY] unsignedLongLongValue];
|
||||
if (fileSize < MIN_FILE_SIZE_FOR_CREATING_DELTA) {
|
||||
return YES;
|
||||
}
|
||||
@@ -165,11 +165,11 @@ static BOOL shouldSkipDeltaCompression(NSDictionary *originalInfo, NSDictionary
|
||||
return YES;
|
||||
}
|
||||
|
||||
if ([originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
|
||||
if ([(NSNumber *)originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [(NSNumber *)newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
if ([originalInfo[INFO_HASH_KEY] isEqual:newInfo[INFO_HASH_KEY]]) {
|
||||
if ([(NSData *)originalInfo[INFO_HASH_KEY] isEqual:(NSData *)newInfo[INFO_HASH_KEY]]) {
|
||||
// this is possible if just the permissions have changed
|
||||
return YES;
|
||||
}
|
||||
@@ -183,7 +183,7 @@ static BOOL shouldDeleteThenExtract(NSDictionary *originalInfo, NSDictionary *ne
|
||||
return NO;
|
||||
}
|
||||
|
||||
if ([originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
|
||||
if ([(NSNumber *)originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [(NSNumber *)newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
@@ -196,11 +196,11 @@ static BOOL shouldSkipExtracting(NSDictionary *originalInfo, NSDictionary *newIn
|
||||
return NO;
|
||||
}
|
||||
|
||||
if ([originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
|
||||
if ([(NSNumber *)originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [(NSNumber *)newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (![originalInfo[INFO_HASH_KEY] isEqual:newInfo[INFO_HASH_KEY]]) {
|
||||
if (![(NSData *)originalInfo[INFO_HASH_KEY] isEqual:(NSData *)newInfo[INFO_HASH_KEY]]) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -213,11 +213,11 @@ static BOOL shouldChangePermissions(NSDictionary *originalInfo, NSDictionary *ne
|
||||
return NO;
|
||||
}
|
||||
|
||||
if ([originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
|
||||
if ([(NSNumber *)originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [(NSNumber *)newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
if ([originalInfo[INFO_PERMISSIONS_KEY] unsignedShortValue] == [newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]) {
|
||||
if ([(NSNumber *)originalInfo[INFO_PERMISSIONS_KEY] unsignedShortValue] == [(NSNumber *)newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
// We should also not allow files with code signed extended attributes since Apple doesn't recommend inserting these
|
||||
// inside an application, and since we don't preserve extended attribitutes anyway
|
||||
|
||||
mode_t permissions = [info[INFO_PERMISSIONS_KEY] unsignedShortValue];
|
||||
mode_t permissions = [(NSNumber *)info[INFO_PERMISSIONS_KEY] unsignedShortValue];
|
||||
if (!IS_VALID_PERMISSIONS(permissions)) {
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n");
|
||||
@@ -408,7 +408,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
} else {
|
||||
newTreeState[key] = info;
|
||||
|
||||
if (oldInfo && [oldInfo[INFO_TYPE_KEY] unsignedShortValue] == FTS_D && [info[INFO_TYPE_KEY] unsignedShortValue] != FTS_D) {
|
||||
if (oldInfo && [(NSNumber *)oldInfo[INFO_TYPE_KEY] unsignedShortValue] == FTS_D && [(NSNumber *)info[INFO_TYPE_KEY] unsignedShortValue] != FTS_D) {
|
||||
NSArray *parentPathComponents = key.pathComponents;
|
||||
|
||||
for (NSString *childPath in originalTreeState) {
|
||||
@@ -480,7 +480,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
for (NSString *key in keys) {
|
||||
id value = [newTreeState valueForKey:key];
|
||||
|
||||
if ([value isEqual:[NSNull null]]) {
|
||||
if ([(NSObject *)value isEqual:[NSNull null]]) {
|
||||
xar_file_t newFile = xar_add_frombuffer(x, 0, [key fileSystemRepresentation], (char *)"", 1);
|
||||
assert(newFile);
|
||||
xar_prop_set(newFile, DELETE_KEY, "true");
|
||||
@@ -498,10 +498,10 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
if (shouldChangePermissions(originalInfo, newInfo)) {
|
||||
xar_file_t newFile = xar_add_frombuffer(x, 0, [key fileSystemRepresentation], (char *)"", 1);
|
||||
assert(newFile);
|
||||
xar_prop_set(newFile, MODIFY_PERMISSIONS_KEY, [[NSString stringWithFormat:@"%u", [newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]] UTF8String]);
|
||||
xar_prop_set(newFile, MODIFY_PERMISSIONS_KEY, [[NSString stringWithFormat:@"%u", [(NSNumber *)newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]] UTF8String]);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n👮 %s %s (0%o -> 0%o)", VERBOSE_MODIFIED, [key fileSystemRepresentation], [originalInfo[INFO_PERMISSIONS_KEY] unsignedShortValue], [newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]);
|
||||
fprintf(stderr, "\n👮 %s %s (0%o -> 0%o)", VERBOSE_MODIFIED, [key fileSystemRepresentation], [(NSNumber *)originalInfo[INFO_PERMISSIONS_KEY] unsignedShortValue], [(NSNumber *)newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
SUDSAVerifier *verifier = [[self alloc] initWithPublicKeyData:[pkeyString dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
SUDSAVerifier *verifier = [(SUDSAVerifier *)[self alloc] initWithPublicKeyData:[pkeyString dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
|
||||
if (!verifier) {
|
||||
return NO;
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
// Get the file size.
|
||||
NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:self.archivePath error:nil];
|
||||
NSUInteger expectedLength = [[attributes objectForKey:NSFileSize] unsignedIntegerValue];
|
||||
NSUInteger expectedLength = [(NSNumber *)[attributes objectForKey:NSFileSize] unsignedIntegerValue];
|
||||
if (expectedLength > 0) {
|
||||
NSFileHandle *archiveInput = [NSFileHandle fileHandleForReadingAtPath:self.archivePath];
|
||||
|
||||
|
||||
@@ -6,3 +6,4 @@ ASSETCATALOG_COMPILER_APPICON_NAME = $(SPARKLE_ICON_NAME)
|
||||
LD_RUNPATH_SEARCH_PATHS = @executable_path/../Frameworks
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.sparkle-project.SparkleTestApp
|
||||
CODE_SIGN_ENTITLEMENTS = TestApplication/Sparkle-Test-App.entitlements
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10
|
||||
@@ -91,7 +91,7 @@ static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection K
|
||||
|
||||
- (void)handleMessageWithIdentifier:(int32_t)identifier data:(NSData *)data
|
||||
{
|
||||
[self.connection.remoteObjectProxy handleMessageWithIdentifier:identifier data:data];
|
||||
[(id<SUInstallerCommunicationProtocol>)self.connection.remoteObjectProxy handleMessageWithIdentifier:identifier data:data];
|
||||
}
|
||||
|
||||
// This method can be called by us or from a remote
|
||||
|
||||
@@ -57,24 +57,24 @@
|
||||
self.invalidationBlock = invalidationHandler;
|
||||
|
||||
__weak SUXPCInstallerConnection *weakSelf = self;
|
||||
[self.connection.remoteObjectProxy setInvalidationHandler:^{
|
||||
[(id<SUInstallerConnectionProtocol>)self.connection.remoteObjectProxy setInvalidationHandler:^{
|
||||
[weakSelf invokeInvalidation];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setServiceName:(NSString *)serviceName hostPath:(NSString *)hostPath installationType:(NSString *)installationType
|
||||
{
|
||||
[self.connection.remoteObjectProxy setServiceName:serviceName hostPath:hostPath installationType:installationType];
|
||||
[(id<SUInstallerConnectionProtocol>)self.connection.remoteObjectProxy setServiceName:serviceName hostPath:hostPath installationType:installationType];
|
||||
}
|
||||
|
||||
- (void)handleMessageWithIdentifier:(int32_t)identifier data:(NSData *)data
|
||||
{
|
||||
[self.connection.remoteObjectProxy handleMessageWithIdentifier:identifier data:data];
|
||||
[(id<SUInstallerConnectionProtocol>)self.connection.remoteObjectProxy handleMessageWithIdentifier:identifier data:data];
|
||||
}
|
||||
|
||||
- (void)invalidate
|
||||
{
|
||||
[self.connection.remoteObjectProxy invalidate];
|
||||
[(id<SUInstallerConnectionProtocol>)self.connection.remoteObjectProxy invalidate];
|
||||
[self.connection invalidate];
|
||||
self.connection = nil;
|
||||
}
|
||||
|
||||
@@ -55,12 +55,12 @@
|
||||
|
||||
- (void)probeStatusInfoWithReply:(void (^)(NSData * _Nullable installationInfoData))reply
|
||||
{
|
||||
[self.connection.remoteObjectProxy probeStatusInfoWithReply:reply];
|
||||
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusInfoWithReply:reply];
|
||||
}
|
||||
|
||||
- (void)probeStatusConnectivityWithReply:(void (^)(void))reply
|
||||
{
|
||||
[self.connection.remoteObjectProxy probeStatusConnectivityWithReply:reply];
|
||||
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusConnectivityWithReply:reply];
|
||||
}
|
||||
|
||||
// This method can be called by us or from a remote
|
||||
|
||||
@@ -50,29 +50,29 @@
|
||||
self.invalidationBlock = invalidationHandler;
|
||||
|
||||
__weak SUXPCInstallerStatus *weakSelf = self;
|
||||
[self.connection.remoteObjectProxy setInvalidationHandler:^{
|
||||
[(id<SUInstallerStatusProtocol>)self.connection.remoteObjectProxy setInvalidationHandler:^{
|
||||
[weakSelf invokeInvalidation];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setServiceName:(NSString *)serviceName
|
||||
{
|
||||
[self.connection.remoteObjectProxy setServiceName:serviceName];
|
||||
[(id<SUInstallerStatusProtocol>)self.connection.remoteObjectProxy setServiceName:serviceName];
|
||||
}
|
||||
|
||||
- (void)probeStatusInfoWithReply:(void (^)(NSData * _Nullable installationInfoData))reply
|
||||
{
|
||||
[self.connection.remoteObjectProxy probeStatusInfoWithReply:reply];
|
||||
[(id<SUInstallerStatusProtocol>)self.connection.remoteObjectProxy probeStatusInfoWithReply:reply];
|
||||
}
|
||||
|
||||
- (void)probeStatusConnectivityWithReply:(void (^)(void))reply
|
||||
{
|
||||
[self.connection.remoteObjectProxy probeStatusConnectivityWithReply:reply];
|
||||
[(id<SUInstallerStatusProtocol>)self.connection.remoteObjectProxy probeStatusConnectivityWithReply:reply];
|
||||
}
|
||||
|
||||
- (void)invalidate
|
||||
{
|
||||
[self.connection.remoteObjectProxy invalidate];
|
||||
[(id<SUInstallerStatusProtocol>)self.connection.remoteObjectProxy invalidate];
|
||||
[self.connection invalidate];
|
||||
self.connection = nil;
|
||||
}
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ New Sparkle classes are now prefixed with `SPU` rather than `SU`. Older classes
|
||||
## Requirements
|
||||
|
||||
* Runtime: **macOS 10.9** or greater for 64bit, **macOS 10.10** or greater for 32bit (this has been bumped up!)
|
||||
* Build: At least Xcode 6. Xcode 7 or greater recommended.
|
||||
* Build: Xcode 7 or greater required.
|
||||
* HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/))
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -135,7 +135,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3;
|
||||
[self.statusInfo startListener];
|
||||
|
||||
[self.connection resume];
|
||||
[self.connection.remoteObjectProxy connectionDidInitiateWithReply:^{
|
||||
[(id<SUInstallerAgentInitiationProtocol>)self.connection.remoteObjectProxy connectionDidInitiateWithReply:^{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
self.connected = YES;
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -50,7 +50,7 @@ static NSString *SPUURLRequestNetworkServiceTypeKey = @"SPUURLRequestNetworkServ
|
||||
|
||||
+ (instancetype)URLRequestWithRequest:(NSURLRequest *)request
|
||||
{
|
||||
return [[[self class] alloc] initWithURL:request.URL cachePolicy:request.cachePolicy timeoutInterval:request.timeoutInterval httpHeaderFields:request.allHTTPHeaderFields networkServiceType:request.networkServiceType];
|
||||
return [(SPUURLRequest *)[[self class] alloc] initWithURL:request.URL cachePolicy:request.cachePolicy timeoutInterval:request.timeoutInterval httpHeaderFields:request.allHTTPHeaderFields networkServiceType:request.networkServiceType];
|
||||
}
|
||||
|
||||
+ (BOOL)supportsSecureCoding
|
||||
|
||||
Vendored
+2
-2
@@ -727,7 +727,7 @@ static NSString *escapeURLComponent(NSString *str) {
|
||||
const NSTimeInterval oneWeek = 60 * 60 * 24 * 7;
|
||||
sendingSystemProfile &= (-[lastSubmitDate timeIntervalSinceNow] >= oneWeek);
|
||||
|
||||
NSArray *parameters = @[];
|
||||
NSArray<NSDictionary<NSString *, NSString *> *> *parameters = @[];
|
||||
if ([self.delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)]) {
|
||||
NSArray *feedParameters = [self.delegate feedParametersForUpdater:self sendingSystemProfile:sendingSystemProfile];
|
||||
if (feedParameters != nil) {
|
||||
@@ -743,7 +743,7 @@ static NSString *escapeURLComponent(NSString *str) {
|
||||
|
||||
// Build up the parameterized URL.
|
||||
NSMutableArray *parameterStrings = [NSMutableArray array];
|
||||
for (NSDictionary *currentProfileInfo in parameters) {
|
||||
for (NSDictionary<NSString *, NSString *> *currentProfileInfo in parameters) {
|
||||
[parameterStrings addObject:[NSString stringWithFormat:@"%@=%@", escapeURLComponent([[currentProfileInfo objectForKey:@"key"] description]), escapeURLComponent([[currentProfileInfo objectForKey:@"value"] description])]];
|
||||
}
|
||||
|
||||
|
||||
Vendored
-5
@@ -22,12 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
SU_EXPORT @interface SUAppcast : NSObject<NSURLDownloadDelegate>
|
||||
|
||||
@property (copy, nullable) NSString *userAgentString;
|
||||
|
||||
#if __has_feature(objc_generics)
|
||||
@property (copy, nullable) NSDictionary<NSString *, NSString *> *httpHeaders;
|
||||
#else
|
||||
@property (copy, nullable) NSDictionary *httpHeaders;
|
||||
#endif
|
||||
|
||||
- (void)fetchAppcastFromURL:(NSURL *)url inBackground:(BOOL)bg completionBlock:(void (^)(NSError *_Nullable))err;
|
||||
- (SUAppcast *)copyWithoutDeltaUpdates;
|
||||
|
||||
Vendored
+16
-16
@@ -60,8 +60,8 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT
|
||||
|
||||
if (self != nil) {
|
||||
_deltaUpdates = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [SUAppcastItem class]]] forKey:SUAppcastItemDeltaUpdatesKey];
|
||||
_displayVersionString = [[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemDisplayVersionStringKey] copy];
|
||||
_DSASignature = [[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemDSASignatureKey] copy];
|
||||
_displayVersionString = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemDisplayVersionStringKey] copy];
|
||||
_DSASignature = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemDSASignatureKey] copy];
|
||||
_fileURL = [decoder decodeObjectOfClass:[NSURL class] forKey:SUAppcastItemFileURLKey];
|
||||
_infoURL = [decoder decodeObjectOfClass:[NSURL class] forKey:SUAppcastItemInfoURLKey];
|
||||
|
||||
@@ -72,12 +72,12 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT
|
||||
return nil;
|
||||
}
|
||||
|
||||
_itemDescription = [[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemDescriptionKey] copy];
|
||||
_maximumSystemVersion = [[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemMaximumSystemVersionKey] copy];
|
||||
_minimumSystemVersion = [[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemMinimumSystemVersionKey] copy];
|
||||
_itemDescription = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemDescriptionKey] copy];
|
||||
_maximumSystemVersion = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemMaximumSystemVersionKey] copy];
|
||||
_minimumSystemVersion = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemMinimumSystemVersionKey] copy];
|
||||
_releaseNotesURL = [decoder decodeObjectOfClass:[NSURL class] forKey:SUAppcastItemReleaseNotesURLKey];
|
||||
_title = [[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemTitleKey] copy];
|
||||
_versionString = [[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemVersionStringKey] copy];
|
||||
_title = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemTitleKey] copy];
|
||||
_versionString = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemVersionStringKey] copy];
|
||||
_propertiesDictionary = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [NSString class], [NSDate class], [NSArray class]]] forKey:SUAppcastItemPropertiesKey];
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT
|
||||
|
||||
- (BOOL)isCriticalUpdate
|
||||
{
|
||||
return [[self.propertiesDictionary objectForKey:SUAppcastElementTags] containsObject:SUAppcastElementCriticalUpdate];
|
||||
return [(NSArray *)[self.propertiesDictionary objectForKey:SUAppcastElementTags] containsObject:SUAppcastElementCriticalUpdate];
|
||||
}
|
||||
|
||||
- (BOOL)isMacOsUpdate
|
||||
@@ -191,7 +191,7 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT
|
||||
|
||||
// Separate the url by underscores and take the last component, as that'll be closest to the end,
|
||||
// then we remove the extension. Hopefully, this will be the version.
|
||||
NSArray *fileComponents = [[enclosure objectForKey:SURSSAttributeURL] componentsSeparatedByString:@"_"];
|
||||
NSArray<NSString *> *fileComponents = [(NSString *)[enclosure objectForKey:SURSSAttributeURL] componentsSeparatedByString:@"_"];
|
||||
if ([fileComponents count] > 1) {
|
||||
newVersion = [[fileComponents lastObject] stringByDeletingPathExtension];
|
||||
}
|
||||
@@ -205,9 +205,9 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT
|
||||
}
|
||||
|
||||
_propertiesDictionary = [[NSDictionary alloc] initWithDictionary:dict];
|
||||
_title = [[dict objectForKey:SURSSElementTitle] copy];
|
||||
_dateString = [[dict objectForKey:SURSSElementPubDate] copy];
|
||||
_itemDescription = [[dict objectForKey:SURSSElementDescription] copy];
|
||||
_title = [(NSString *)[dict objectForKey:SURSSElementTitle] copy];
|
||||
_dateString = [(NSString *)[dict objectForKey:SURSSElementPubDate] copy];
|
||||
_itemDescription = [(NSString *)[dict objectForKey:SURSSElementDescription] copy];
|
||||
|
||||
NSString *theInfoURL = [dict objectForKey:SURSSElementLink];
|
||||
if (theInfoURL) {
|
||||
@@ -250,12 +250,12 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT
|
||||
_fileURL = [NSURL URLWithString:fileURLString];
|
||||
}
|
||||
if (enclosure) {
|
||||
_DSASignature = [[enclosure objectForKey:SUAppcastAttributeDSASignature] copy];
|
||||
_DSASignature = [(NSString *)[enclosure objectForKey:SUAppcastAttributeDSASignature] copy];
|
||||
}
|
||||
|
||||
_versionString = [newVersion copy];
|
||||
_minimumSystemVersion = [[dict objectForKey:SUAppcastElementMinimumSystemVersion] copy];
|
||||
_maximumSystemVersion = [[dict objectForKey:SUAppcastElementMaximumSystemVersion] copy];
|
||||
_versionString = [(NSString *)newVersion copy];
|
||||
_minimumSystemVersion = [(NSString *)[dict objectForKey:SUAppcastElementMinimumSystemVersion] copy];
|
||||
_maximumSystemVersion = [(NSString *)[dict objectForKey:SUAppcastElementMaximumSystemVersion] copy];
|
||||
|
||||
NSString *shortVersionString = [enclosure objectForKey:SUAppcastAttributeShortVersionString];
|
||||
if (nil == shortVersionString) {
|
||||
|
||||
Vendored
+1
-1
@@ -84,7 +84,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) {
|
||||
}
|
||||
|
||||
if (isDirectory != NULL) {
|
||||
*isDirectory = [[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeDirectory];
|
||||
*isDirectory = [(NSString *)[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeDirectory];
|
||||
}
|
||||
|
||||
return YES;
|
||||
|
||||
Vendored
+1
-1
@@ -178,7 +178,7 @@
|
||||
|
||||
- (BOOL)boolForInfoDictionaryKey:(NSString *)key
|
||||
{
|
||||
return [[self objectForInfoDictionaryKey:key] boolValue];
|
||||
return [(NSNumber *)[self objectForInfoDictionaryKey:key] boolValue];
|
||||
}
|
||||
|
||||
- (id)objectForUserDefaultsKey:(NSString *)defaultName
|
||||
|
||||
Vendored
+1
-1
@@ -32,7 +32,7 @@
|
||||
NSURL *url = [coreServices URLByAppendingPathComponent:@"SystemVersion.plist"];
|
||||
assert(url != nil);
|
||||
NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfURL:url];
|
||||
NSArray *components = [ [dictionary objectForKey: @"ProductVersion"] componentsSeparatedByString:@"."];
|
||||
NSArray<NSString *> *components = [ (NSString *)[dictionary objectForKey: @"ProductVersion"] componentsSeparatedByString:@"."];
|
||||
version.majorVersion = components.count > 0 ? [ [components objectAtIndex:0] integerValue] : 0;
|
||||
version.minorVersion = components.count > 1 ? [ [components objectAtIndex:1] integerValue] : 0;
|
||||
version.patchVersion = components.count > 2 ? [ [components objectAtIndex:2] integerValue] : 0;
|
||||
|
||||
Vendored
+1
-1
@@ -136,7 +136,7 @@ static NSString *const SUStatusControllerTouchBarIndentifier = @"" SPARKLE_BUNDL
|
||||
|
||||
- (NSTouchBar *)makeTouchBar
|
||||
{
|
||||
NSTouchBar *touchBar = [[NSClassFromString(@"NSTouchBar") alloc] init];
|
||||
NSTouchBar *touchBar = [(NSTouchBar *)[NSClassFromString(@"NSTouchBar") alloc] init];
|
||||
touchBar.defaultItemIdentifiers = @[ SUStatusControllerTouchBarIndentifier,];
|
||||
touchBar.principalItemIdentifier = SUStatusControllerTouchBarIndentifier;
|
||||
touchBar.delegate = self;
|
||||
|
||||
Vendored
+2
-2
@@ -386,7 +386,7 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
return finalString;
|
||||
}
|
||||
|
||||
- (void)webView:(WebView *)sender didFinishLoadForFrame:frame
|
||||
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
|
||||
{
|
||||
if ([frame parentFrame] == nil) {
|
||||
[self stopReleaseNotesSpinner];
|
||||
@@ -452,7 +452,7 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
|
||||
- (NSTouchBar *)makeTouchBar
|
||||
{
|
||||
NSTouchBar *touchBar = [[NSClassFromString(@"NSTouchBar") alloc] init];
|
||||
NSTouchBar *touchBar = [(NSTouchBar *)[NSClassFromString(@"NSTouchBar") alloc] init];
|
||||
touchBar.defaultItemIdentifiers = @[SUUpdateAlertTouchBarIndentifier,];
|
||||
touchBar.principalItemIdentifier = SUUpdateAlertTouchBarIndentifier;
|
||||
touchBar.delegate = self;
|
||||
|
||||
Vendored
+1
-1
@@ -18,7 +18,7 @@
|
||||
+ (void)promptWithHost:(SUHost *)host request:(SPUUpdatePermissionRequest *)request reply:(void (^)(SUUpdatePermissionResponse *))reply;
|
||||
|
||||
- (IBAction)toggleMoreInfo:(id)sender;
|
||||
- (IBAction)finishPrompt:(id)sender;
|
||||
- (IBAction)finishPrompt:(NSButton *)sender;
|
||||
@end
|
||||
|
||||
#endif
|
||||
Vendored
+4
-4
@@ -76,7 +76,7 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE
|
||||
}
|
||||
|
||||
if (![NSApp modalWindow]) { // do not prompt if there is is another modal window on screen
|
||||
SUUpdatePermissionPrompt *prompt = [[[self class] alloc] initPromptWithHost:host request:request reply:reply];
|
||||
SUUpdatePermissionPrompt *prompt = [(SUUpdatePermissionPrompt *)[[self class] alloc] initPromptWithHost:host request:request reply:reply];
|
||||
NSWindow *window = [prompt window];
|
||||
if (window) {
|
||||
[NSApp runModalForWindow:window];
|
||||
@@ -86,7 +86,7 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE
|
||||
|
||||
- (BOOL)shouldAskAboutProfile
|
||||
{
|
||||
return [[self.host objectForInfoDictionaryKey:SUEnableSystemProfilingKey] boolValue];
|
||||
return [(NSNumber *)[self.host objectForInfoDictionaryKey:SUEnableSystemProfilingKey] boolValue];
|
||||
}
|
||||
|
||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [self.host bundlePath]]; }
|
||||
@@ -160,7 +160,7 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE
|
||||
[self.moreInfoView setHidden:!self.isShowingMoreInfo];
|
||||
}
|
||||
|
||||
- (IBAction)finishPrompt:(id)sender
|
||||
- (IBAction)finishPrompt:(NSButton *)sender
|
||||
{
|
||||
SUUpdatePermissionResponse *response = [[SUUpdatePermissionResponse alloc] initWithAutomaticUpdateChecks:([sender tag] == 1) sendSystemProfile:self.shouldSendProfile];
|
||||
self.reply(response);
|
||||
@@ -171,7 +171,7 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE
|
||||
|
||||
- (NSTouchBar *)makeTouchBar
|
||||
{
|
||||
NSTouchBar *touchBar = [[NSClassFromString(@"NSTouchBar") alloc] init];
|
||||
NSTouchBar *touchBar = [(NSTouchBar *)[NSClassFromString(@"NSTouchBar") alloc] init];
|
||||
touchBar.defaultItemIdentifiers = @[SUUpdatePermissionPromptTouchBarIndentifier,];
|
||||
touchBar.principalItemIdentifier = SUUpdatePermissionPromptTouchBarIndentifier;
|
||||
touchBar.delegate = self;
|
||||
|
||||
Vendored
-4
@@ -162,11 +162,7 @@ SU_EXPORT @interface SUUpdater : NSObject
|
||||
|
||||
The keys of this dictionary are HTTP header fields (NSString) and values are corresponding values (NSString)
|
||||
*/
|
||||
#if __has_feature(objc_generics)
|
||||
@property (copy) NSDictionary<NSString *, NSString *> *httpHeaders;
|
||||
#else
|
||||
@property (copy) NSDictionary *httpHeaders;
|
||||
#endif
|
||||
|
||||
/*!
|
||||
A property indicating whether or not the user's system profile information is sent when checking for updates.
|
||||
|
||||
Vendored
+1
-1
@@ -51,7 +51,7 @@ static NSMutableDictionary *sharedUpdaters = nil;
|
||||
if (bundle == nil) bundle = [NSBundle mainBundle];
|
||||
id updater = [sharedUpdaters objectForKey:[NSValue valueWithNonretainedObject:bundle]];
|
||||
if (updater == nil) {
|
||||
updater = [[[self class] alloc] initForBundle:bundle];
|
||||
updater = [(SUUpdater *)[[self class] alloc] initForBundle:bundle];
|
||||
}
|
||||
return updater;
|
||||
}
|
||||
|
||||
Vendored
-4
@@ -65,11 +65,7 @@ __deprecated_msg("See SPUUpdaterDelegate instead")
|
||||
|
||||
\return An array of dictionaries with keys: "key", "value", "displayKey", "displayValue", the latter two being specifically for display to the user.
|
||||
*/
|
||||
#if __has_feature(objc_generics)
|
||||
- (NSArray<NSDictionary<NSString *, NSString *> *> *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
|
||||
#else
|
||||
- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
|
||||
#endif
|
||||
|
||||
/*!
|
||||
Returns a custom appcast URL.
|
||||
|
||||
@@ -31,7 +31,7 @@ static NSString * const UPDATED_VERSION = @"2.0";
|
||||
NSBundle *mainBundle = [NSBundle mainBundle];
|
||||
|
||||
// Check if we are already up to date
|
||||
if ([[mainBundle objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey] isEqualToString:UPDATED_VERSION]) {
|
||||
if ([(NSString *)[mainBundle objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey] isEqualToString:UPDATED_VERSION]) {
|
||||
NSAlert *alreadyUpdatedAlert = [[NSAlert alloc] init];
|
||||
alreadyUpdatedAlert.messageText = @"Update succeeded!";
|
||||
alreadyUpdatedAlert.informativeText = @"This is the updated version of Sparkle Test App.\n\nDelete and rebuild the app to test updates again.";
|
||||
@@ -117,7 +117,7 @@ static NSString * const UPDATED_VERSION = @"2.0";
|
||||
NSString *zipName = @"Sparkle_Test_App.zip";
|
||||
NSTask *dittoTask = [[NSTask alloc] init];
|
||||
dittoTask.launchPath = @"/usr/bin/ditto";
|
||||
dittoTask.arguments = @[@"-c", @"-k", @"--sequesterRsrc", @"--keepParent", destinationBundleURL.lastPathComponent, zipName];
|
||||
dittoTask.arguments = @[@"-c", @"-k", @"--sequesterRsrc", @"--keepParent", (NSString *)destinationBundleURL.lastPathComponent, zipName];
|
||||
dittoTask.currentDirectoryPath = serverDirectoryPath;
|
||||
[dittoTask launch];
|
||||
[dittoTask waitUntilExit];
|
||||
@@ -138,7 +138,7 @@ static NSString * const UPDATED_VERSION = @"2.0";
|
||||
signUpdateTask.launchPath = signUpdatePath;
|
||||
|
||||
NSURL *archiveURL = [serverDirectoryURL URLByAppendingPathComponent:zipName];
|
||||
signUpdateTask.arguments = @[archiveURL.path, privateKeyPath];
|
||||
signUpdateTask.arguments = @[(NSString *)archiveURL.path, privateKeyPath];
|
||||
|
||||
NSPipe *outputPipe = [NSPipe pipe];
|
||||
signUpdateTask.standardOutput = outputPipe;
|
||||
@@ -221,7 +221,7 @@ static NSString * const UPDATED_VERSION = @"2.0";
|
||||
codeSignConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(TestAppHelperProtocol)];
|
||||
[codeSignConnection resume];
|
||||
|
||||
[codeSignConnection.remoteObjectProxy codeSignApplicationAtPath:applicationPath reply:^(BOOL success) {
|
||||
[(id<TestAppHelperProtocol>)codeSignConnection.remoteObjectProxy codeSignApplicationAtPath:applicationPath reply:^(BOOL success) {
|
||||
assert(success);
|
||||
[codeSignConnection invalidate];
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
NSString *requestLine = lines.count >= 3 ? [lines objectAtIndex:0] : nil;
|
||||
NSArray *parts = requestLine ? [requestLine componentsSeparatedByString:@" "] : nil;
|
||||
// Only process GET requests for existing files
|
||||
if ([[parts objectAtIndex:0] isEqualToString:@"GET"]) {
|
||||
if ([(NSString *)[parts objectAtIndex:0] isEqualToString:@"GET"]) {
|
||||
// Use NSURL to strip out query parameters
|
||||
NSString *path = [NSURL URLWithString:[parts objectAtIndex:1] relativeToURL:nil].path;
|
||||
NSString *filePath = [self.workingDirectory stringByAppendingString:path];
|
||||
|
||||
Reference in new issue
Block a user