mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-23 04:34:27 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03abfe2739 | ||
|
|
c0d45952a9 | ||
|
|
34179edd6d | ||
|
|
530f3a4a63 | ||
|
|
135d05b8b8 | ||
|
|
c56694382e | ||
|
|
a39023e95b | ||
|
|
282f0ae58e | ||
|
|
c1488b0515 | ||
|
|
27c560b7d5 | ||
|
|
fbb040926e | ||
|
|
548908628f | ||
|
|
d40bdb615a | ||
|
|
f43b9f7f02 | ||
|
|
eafbb2cfad | ||
|
|
5c408f5019 | ||
|
|
9d35c819fd | ||
|
|
ee80a66896 | ||
|
|
187ae4fe57 | ||
|
|
ca4d51561e | ||
|
|
915c2047bf | ||
|
|
f172cd32a8 | ||
|
|
8481035fb9 | ||
|
|
7238c2aeb6 |
No files matched your search
+1
-1
@@ -1,5 +1,5 @@
|
||||
language: objective-c
|
||||
osx_image: xcode8
|
||||
osx_image: xcode8.2
|
||||
before_install:
|
||||
- brew update
|
||||
script: make ci
|
||||
@@ -7,7 +7,6 @@
|
||||
* Made manual check resume pending automatic updates instead of starting a new update (Kornel Lesiński)
|
||||
* Started using `length` value from RSS if HTTP doesn't give one (Zorg)
|
||||
* Hidden automatic updates checkbox for information only updates (Bi11)
|
||||
* Fixed UI update scheduler not prompting for install & relaunch (Zorg)
|
||||
* Added progressbar for DMG and binary delta extraction (Kornel Lesiński)
|
||||
* Fixed showing of download status if we attempt a 2nd download (Zorg)
|
||||
* Refactorings to sync with upcoming 2.0
|
||||
|
||||
@@ -24,6 +24,7 @@ if [ "$ACTION" = "" ] ; then
|
||||
# because missing dSYMs in a release build SHOULD trigger a build failure
|
||||
if [ "$CONFIGURATION" = "Release" ] ; then
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/BinaryDelta.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/generate_appcast.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
fi
|
||||
|
||||
@@ -31,7 +31,7 @@ ci:
|
||||
( rm -rf build && xcodebuild -sdk "macosx10.$$i" -scheme Distribution -configuration Coverage -derivedDataPath build ) || exit 1 ; \
|
||||
fi ; \
|
||||
done
|
||||
for i in {10..11} ; do \
|
||||
for i in {10..12} ; do \
|
||||
if xcrun --sdk "macosx10.$$i" --show-sdk-path 2> /dev/null ; then \
|
||||
( rm -rf build && xcodebuild -sdk "macosx10.$$i" -scheme Distribution -configuration Coverage -derivedDataPath build test ) || exit 1 ; \
|
||||
fi ; \
|
||||
|
||||
+13
-18
@@ -1,9 +1,21 @@
|
||||
# Sparkle [](https://travis-ci.org/sparkle-project/Sparkle) [](https://github.com/Carthage/Carthage) []() <a href="https://www.stackpath.com/?utm_source=sparkle-github&utm_medium=badge&utm_campaign=readme"><img src="https://img.shields.io/badge/sponsored%20by-StackPath-orange.svg" alt="sponsored by: StackPath"></a>
|
||||
|
||||
An easy-to-use software update framework for Cocoa developers.
|
||||
Secure and reliable software update framework for Cocoa developers.
|
||||
|
||||
<img src="Resources/Screenshot.png" width="732" alt="Sparkle shows familiar update window with release notes">
|
||||
|
||||
## Features
|
||||
|
||||
* Seamless. There's no mention of Sparkle; your icons and app name are used.
|
||||
* Secure. Updates are verified using DSA signatures and Apple Code Signing.
|
||||
* Fast. Supports delta updates which only patch files that have changed.
|
||||
* Easy to install. Sparkle requires no code in your app, and only needs static files on a web server.
|
||||
* Supports bundles, preference panes, plugins, and other non-.app software. Can install .pkg files for more complicated products.
|
||||
* Handles permissions, quarantine and automatically asks for authentication if needed.
|
||||
* Uses RSS-based appcasts for release information. Appcasts are a de-facto standard supported by 3rd party update-tracking programs and websites.
|
||||
* Sparkle stays hidden until second launch for better first impressions.
|
||||
* Truly self-updating — the user can choose to automatically download and install all updates in the background.
|
||||
|
||||
## Changes since 1.5b
|
||||
|
||||
* Compatibilty with macOS Sierra.
|
||||
@@ -14,23 +26,6 @@ An easy-to-use software update framework for Cocoa developers.
|
||||
* Upgraded and more reliable binary delta and code signing verification.
|
||||
* Ability to mark updates as critical.
|
||||
* Progress and status notifications for the host app.
|
||||
* Name of finish_installation.app can be configured to match your app's name.
|
||||
|
||||
## Features
|
||||
|
||||
* Seamless integration—there's no mention of Sparkle; your icons and app name are used.
|
||||
* True self-updating—the user can choose to automatically download and install all updates.
|
||||
* Displays a detailed progress window to the user.
|
||||
* Supports authentication for installing in secure locations.
|
||||
* Supports Apple Code Signing and DSA signatures for ultra-secure updates.
|
||||
* Easy to install. Sparkle requires no code in your app, so it's trivial to upgrade or remove the framework.
|
||||
* Uses RSS-based appcasts for release information. Appcasts are supported by 3rd party update-tracking programs and websites.
|
||||
* Displays release notes to the user via WebKit.
|
||||
* Sparkle doesn't bug the user until second launch for better first impressions.
|
||||
* Deep delegate support to make Sparkle work exactly as you need.
|
||||
* Optionally sends system information to the server when checking for updates.
|
||||
* Supports bundles, preference panes, plugins, and other non-.app software. Can install .pkg files for more complicated products.
|
||||
* Supports branches due to minimum OS version requirements.
|
||||
|
||||
## Requirements
|
||||
|
||||
|
||||
@@ -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
+20
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// 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
|
||||
|
||||
// One may wonder for certain targets where AppKit is banned completely, why just not link AppKit instead.
|
||||
// Well, Xcode has thing called auto-linking that I don't trust very much.
|
||||
// Even after trying to disable the setting, I've had targets able to link to AppKit without AppKit being specified in the list of linked libraries.
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a core or daemon-safe module and should NOT import AppKit
|
||||
#endif
|
||||
Vendored
+5
@@ -22,7 +22,12 @@ 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 completionBlock:(void (^)(NSError *_Nullable))err;
|
||||
- (SUAppcast *)copyWithoutDeltaUpdates;
|
||||
|
||||
Vendored
+4
-1
@@ -12,6 +12,9 @@
|
||||
#import "SULocalizations.h"
|
||||
#import "SUErrors.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface NSXMLElement (SUAppcastExtensions)
|
||||
@property (readonly, copy) NSDictionary *attributesAsDictionary;
|
||||
@end
|
||||
@@ -65,7 +68,7 @@
|
||||
|
||||
if (self.httpHeaders) {
|
||||
for (NSString *key in self.httpHeaders) {
|
||||
id value = [self.httpHeaders objectForKey:key];
|
||||
NSString *value = [self.httpHeaders objectForKey:key];
|
||||
[request setValue:value forHTTPHeaderField:key];
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+3
@@ -10,6 +10,9 @@
|
||||
#import "SULog.h"
|
||||
#import "SUConstants.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUAppcastItem ()
|
||||
@property (copy, readwrite) NSString *title;
|
||||
@property (copy, readwrite) NSString *dateString;
|
||||
|
||||
Vendored
+1
-1
@@ -158,7 +158,7 @@
|
||||
[[updater delegate] updater:self.updater didFinishLoadingAppcast:ac];
|
||||
}
|
||||
|
||||
NSDictionary *userInfo = (ac != nil) ? @{ SUUpdaterAppcastNotificationKey: ac } : nil;
|
||||
NSDictionary *userInfo = @{ SUUpdaterAppcastNotificationKey: ac };
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFinishLoadingAppCastNotification object:self.updater userInfo:userInfo];
|
||||
|
||||
SUAppcastItem *item = nil;
|
||||
|
||||
Vendored
+3
@@ -15,6 +15,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <xar/xar.h>
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
static BOOL applyBinaryDeltaToFile(xar_t x, xar_file_t file, NSString *sourceFilePath, NSString *destinationFilePath)
|
||||
{
|
||||
NSString *patchFile = temporaryFilename(@"apply-binary-delta");
|
||||
|
||||
Vendored
+3
@@ -18,6 +18,9 @@
|
||||
#include <sys/stat.h>
|
||||
#include <xar/xar.h>
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
int compareFiles(const FTSENT **a, const FTSENT **b)
|
||||
{
|
||||
return strcoll((*a)->fts_name, (*b)->fts_name);
|
||||
|
||||
Vendored
+3
@@ -21,6 +21,9 @@
|
||||
#include <sys/xattr.h>
|
||||
#include <xar/xar.h>
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
extern int bsdiff(int argc, const char **argv);
|
||||
|
||||
@interface CreateBinaryDeltaOperation : NSOperation
|
||||
|
||||
Vendored
+2
@@ -20,6 +20,8 @@
|
||||
#define VERSION_COMMAND @"version"
|
||||
#define VERSION_ALTERNATE_COMMAND @"--version"
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
static void printUsage(NSString *programName)
|
||||
{
|
||||
fprintf(stderr, "Usage:\n");
|
||||
|
||||
Vendored
+3
@@ -13,6 +13,9 @@
|
||||
#import "SULog.h"
|
||||
#import "SUFileManager.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUBinaryDeltaUnarchiver ()
|
||||
|
||||
@property (nonatomic, copy, readonly) NSString *archivePath;
|
||||
|
||||
Vendored
+3
@@ -8,6 +8,9 @@
|
||||
|
||||
#import "SUBundleIcon.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUBundleIcon
|
||||
|
||||
+ (NSURL *)iconURLForBundle:(NSBundle *)bundle
|
||||
|
||||
Vendored
+3
@@ -11,6 +11,9 @@
|
||||
#import "SUCodeSigningVerifier.h"
|
||||
#import "SULog.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUCodeSigningVerifier
|
||||
|
||||
+ (BOOL)codeSignatureAtBundleURL:(NSURL *)oldBundleURL matchesSignatureAtBundleURL:(NSURL *)newBundleURL error:(NSError *__autoreleasing *)error
|
||||
|
||||
Vendored
+2
@@ -13,6 +13,8 @@
|
||||
#define DEBUG 0
|
||||
#endif
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
// Define some minimum intervals to avoid DoS-like checking attacks
|
||||
const NSTimeInterval SUMinimumUpdateCheckInterval = DEBUG ? 60 : (60 * 60);
|
||||
const NSTimeInterval SUDefaultUpdateCheckInterval = DEBUG ? 60 : (60 * 60 * 24);
|
||||
|
||||
Vendored
+3
@@ -16,6 +16,9 @@
|
||||
#import "SULog.h"
|
||||
#include <CommonCrypto/CommonDigest.h>
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUDSAVerifier {
|
||||
SecKeyRef _secKey;
|
||||
}
|
||||
|
||||
Vendored
+3
@@ -10,6 +10,9 @@
|
||||
#import "SUUnarchiverNotifier.h"
|
||||
#import "SULog.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUDiskImageUnarchiver ()
|
||||
|
||||
@property (nonatomic, copy, readonly) NSString *archivePath;
|
||||
|
||||
Vendored
+3
@@ -15,6 +15,9 @@
|
||||
#include <sys/errno.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
static char SUAppleQuarantineIdentifier[] = "com.apple.quarantine";
|
||||
|
||||
static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) {
|
||||
|
||||
Vendored
+3
@@ -9,6 +9,9 @@
|
||||
#import "SUGuidedPackageInstaller.h"
|
||||
#import "SUFileManager.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUGuidedPackageInstaller ()
|
||||
|
||||
@property (nonatomic, readonly, copy) NSString *packagePath;
|
||||
|
||||
Vendored
+3
@@ -11,6 +11,9 @@
|
||||
#include <sys/mount.h> // For statfs for isRunningOnReadOnlyVolume
|
||||
#import "SULog.h"
|
||||
|
||||
|
||||
#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,
|
||||
// as that may depend on the privileges of the process owner. Or code that depends on
|
||||
|
||||
Vendored
+3
@@ -15,6 +15,9 @@
|
||||
#import "SULog.h"
|
||||
#import "SUErrors.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUInstaller
|
||||
|
||||
+ (BOOL)isAliasFolderAtPath:(NSString *)path
|
||||
|
||||
Vendored
+2
@@ -14,6 +14,8 @@
|
||||
#include "SULog.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Constants:
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
Vendored
+3
@@ -7,6 +7,9 @@
|
||||
|
||||
#import "SUOperatingSystem.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101000
|
||||
@interface NSProcessInfo ()
|
||||
- (NSOperatingSystemVersion)operatingSystemVersion;
|
||||
|
||||
Vendored
+3
@@ -11,6 +11,9 @@
|
||||
#import "SUErrors.h"
|
||||
#import "SULog.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUPackageInstaller ()
|
||||
|
||||
@property (nonatomic, readonly, copy) NSString *packagePath;
|
||||
|
||||
Vendored
+3
@@ -11,6 +11,9 @@
|
||||
#import "SULog.h"
|
||||
#import "SUErrors.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUPipedUnarchiver ()
|
||||
|
||||
@property (nonatomic, copy, readonly) NSString *archivePath;
|
||||
|
||||
Vendored
+3
@@ -14,6 +14,9 @@
|
||||
#import "SULog.h"
|
||||
#import "SUErrors.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUPlainInstaller ()
|
||||
|
||||
@property (nonatomic, readonly) SUHost *host;
|
||||
|
||||
+3
@@ -9,6 +9,9 @@
|
||||
#import "SUVersionComparisonProtocol.h"
|
||||
#import "SUStandardVersionComparator.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUStandardVersionComparator
|
||||
|
||||
- (instancetype)init
|
||||
|
||||
Vendored
+1
-1
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@class SUHost;
|
||||
@interface SUSystemProfiler : NSObject
|
||||
|
||||
+ (NSArray *)systemProfileArrayForHost:(SUHost *)host;
|
||||
+ (NSArray<NSDictionary<NSString *, NSString *> *> *)systemProfileArrayForHost:(SUHost *)host;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Vendored
+7
-5
@@ -9,11 +9,13 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SUSystemProfiler.h"
|
||||
|
||||
#import "SUHost.h"
|
||||
#import "SUOperatingSystem.h"
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
static NSString *const SUSystemProfilerApplicationNameKey = @"appName";
|
||||
static NSString *const SUSystemProfilerApplicationVersionKey = @"appVersion";
|
||||
static NSString *const SUSystemProfilerCPU64bitKey = @"cpu64bit";
|
||||
@@ -28,19 +30,19 @@ static NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
|
||||
@implementation SUSystemProfiler
|
||||
|
||||
+ (NSDictionary *)modelTranslationTable
|
||||
+ (NSDictionary<NSString *, NSString *> *)modelTranslationTable
|
||||
{
|
||||
// Use explicit class to use the correct bundle even when subclassed
|
||||
NSString *path = [[NSBundle bundleForClass:[SUSystemProfiler class]] pathForResource:@"SUModelTranslation" ofType:@"plist"];
|
||||
return [[NSDictionary alloc] initWithContentsOfFile:path];
|
||||
}
|
||||
|
||||
+ (NSArray *)systemProfileArrayForHost:(SUHost *)host
|
||||
+ (NSArray<NSDictionary<NSString *, NSString *> *> *)systemProfileArrayForHost:(SUHost *)host
|
||||
{
|
||||
NSDictionary *modelTranslation = [self modelTranslationTable];
|
||||
NSDictionary<NSString *, NSString *> *modelTranslation = [self modelTranslationTable];
|
||||
|
||||
// Gather profile information and append it to the URL.
|
||||
NSMutableArray *profileArray = [NSMutableArray array];
|
||||
NSMutableArray<NSDictionary<NSString *, NSString *> *> *profileArray = [NSMutableArray array];
|
||||
NSArray *profileDictKeys = @[@"key", @"displayKey", @"value", @"displayValue"];
|
||||
int error = 0;
|
||||
int value = 0;
|
||||
|
||||
Vendored
+3
@@ -11,6 +11,9 @@
|
||||
#import "SUConstants.h"
|
||||
#import "SUFileManager.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUSystemUpdateInfo
|
||||
|
||||
+ (BOOL)systemAllowsAutomaticUpdatesForHost:(SUHost *)host
|
||||
|
||||
Vendored
+3
@@ -12,6 +12,9 @@
|
||||
#import "SUDiskImageUnarchiver.h"
|
||||
#import "SUBinaryDeltaUnarchiver.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUUnarchiver
|
||||
|
||||
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword
|
||||
|
||||
Vendored
+3
@@ -10,6 +10,9 @@
|
||||
#import "SULocalizations.h"
|
||||
#import "SUErrors.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUUnarchiverNotifier ()
|
||||
|
||||
@property (nonatomic, readonly, copy) void (^completionBlock)(NSError * _Nullable);
|
||||
|
||||
Vendored
+3
@@ -8,6 +8,9 @@
|
||||
|
||||
#import "SUUpdatePermissionResponse.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@implementation SUUpdatePermissionResponse
|
||||
|
||||
@synthesize automaticUpdateChecks = _automaticUpdateChecks;
|
||||
|
||||
Vendored
+3
@@ -13,6 +13,9 @@
|
||||
#import "SUHost.h"
|
||||
#import "SULog.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUUpdateValidator ()
|
||||
|
||||
@property (nonatomic, readonly) SUHost *host;
|
||||
|
||||
Vendored
+4
@@ -160,7 +160,11 @@ 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
@@ -210,7 +210,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
||||
}
|
||||
|
||||
if (shouldPrompt) {
|
||||
NSArray *profileInfo = [SUSystemProfiler systemProfileArrayForHost:self.host];
|
||||
NSArray<NSDictionary<NSString *, NSString *> *> *profileInfo = [SUSystemProfiler systemProfileArrayForHost:self.host];
|
||||
// Always say we're sending the system profile here so that the delegate displays the parameters it would send.
|
||||
if ([self.delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)]) {
|
||||
profileInfo = [profileInfo arrayByAddingObjectsFromArray:[self.delegate feedParametersForUpdater:self sendingSystemProfile:YES]];
|
||||
|
||||
Vendored
+4
@@ -64,7 +64,11 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
|
||||
|
||||
\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.
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<description>desc</description>
|
||||
<pubDate>Sat, 26 Jul 2014 15:20:11 +0000</pubDate>
|
||||
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" sparkle:version="2.0" />
|
||||
<sparkle:tags> <sparkle:criticalUpdate /> </sparkle:tags>
|
||||
</item>
|
||||
<!-- The best chosen release -->
|
||||
<item>
|
||||
|
||||
@@ -25,19 +25,23 @@ class SUAppcastTest: XCTestCase {
|
||||
XCTAssertEqual("Version 2.0", items[0].title);
|
||||
XCTAssertEqual("desc", items[0].itemDescription);
|
||||
XCTAssertEqual("Sat, 26 Jul 2014 15:20:11 +0000", items[0].dateString)
|
||||
XCTAssertTrue(items[0].isCriticalUpdate);
|
||||
|
||||
// This is the best release matching our system version
|
||||
XCTAssertEqual("Version 3.0", items[1].title);
|
||||
XCTAssertNil(items[1].itemDescription);
|
||||
XCTAssertNil(items[1].dateString)
|
||||
XCTAssertFalse(items[1].isCriticalUpdate);
|
||||
|
||||
XCTAssertEqual("Version 4.0", items[2].title);
|
||||
XCTAssertNil(items[2].itemDescription);
|
||||
XCTAssertEqual("Sat, 26 Jul 2014 15:20:13 +0000", items[2].dateString)
|
||||
XCTAssertFalse(items[2].isCriticalUpdate);
|
||||
|
||||
XCTAssertEqual("Version 5.0", items[3].title);
|
||||
XCTAssertNil(items[3].itemDescription);
|
||||
XCTAssertNil(items[3].dateString)
|
||||
XCTAssertFalse(items[3].isCriticalUpdate);
|
||||
|
||||
// Test best appcast item & a delta update item
|
||||
var deltaItem: SUAppcastItem? = nil
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
#import "SUFileOperationConstants.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
char * const SUFileOpRemoveQuarantineCommand = "xattr-d-apple-quarantine";
|
||||
char * const SUFileOpCopyCommand = "cp";
|
||||
char * const SUFileOpMoveCommand = "mv";
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
#import "SUFileManager.h"
|
||||
#import "SUFileOperationConstants.h"
|
||||
|
||||
|
||||
#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,
|
||||
// and we don't want to log to a file irresponsibly (especially as root),
|
||||
|
||||
@@ -23,7 +23,7 @@ class DeltaUpdate {
|
||||
class func create(from: ArchiveItem, to: ArchiveItem, archivePath: URL) throws -> DeltaUpdate {
|
||||
var applyDiffError: NSError? = nil;
|
||||
|
||||
if (!createBinaryDelta(from.appPath.path, to.appPath.path, archivePath.path, .beigeMajorVersion, true, &applyDiffError)) {
|
||||
if (!createBinaryDelta(from.appPath.path, to.appPath.path, archivePath.path, .beigeMajorVersion, false, &applyDiffError)) {
|
||||
throw applyDiffError!;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class ArchiveItem: CustomStringConvertible {
|
||||
throw makeError(code: .unarchivingError, "Too many apps in \(unarchivedDir.path) \(apps)");
|
||||
}
|
||||
|
||||
let appPath = items[0];
|
||||
let appPath = apps[0];
|
||||
guard let infoPlist = NSDictionary(contentsOf: appPath.appendingPathComponent("Contents/Info.plist")) else {
|
||||
throw makeError(code: .unarchivingError, "No plist \(appPath.path)");
|
||||
}
|
||||
@@ -98,11 +98,14 @@ class ArchiveItem: CustomStringConvertible {
|
||||
return "\(self.archivePath) \(self.version)"
|
||||
}
|
||||
|
||||
var archiveURL: URL {
|
||||
if let relative = self.feedURL {
|
||||
return URL(string: self.archivePath.lastPathComponent, relativeTo: relative)!
|
||||
var archiveURL: URL? {
|
||||
guard let escapedFilename = self.archivePath.lastPathComponent.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) else {
|
||||
return nil;
|
||||
}
|
||||
return URL(string: self.archivePath.lastPathComponent)!
|
||||
if let relative = self.feedURL {
|
||||
return URL(string: escapedFilename, relativeTo: relative)
|
||||
}
|
||||
return URL(string: escapedFilename)
|
||||
}
|
||||
|
||||
var pubDate : String {
|
||||
|
||||
@@ -47,7 +47,6 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws {
|
||||
XMLNode.Options.nodeLoadExternalEntitiesNever,
|
||||
XMLNode.Options.nodePreserveCDATA,
|
||||
XMLNode.Options.nodePreserveWhitespace,
|
||||
XMLNode.Options.nodePreservePrefixes,
|
||||
];
|
||||
doc = try XMLDocument(contentsOf: appcastDestPath, options: Int(options.rawValue));
|
||||
} catch {
|
||||
@@ -118,8 +117,11 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws {
|
||||
item.addChild(enclosure!);
|
||||
}
|
||||
|
||||
guard let archiveURL = update.archiveURL?.absoluteString else {
|
||||
throw makeError(code: .appcastError, "Bad archive name or feed URL");
|
||||
};
|
||||
var attributes = [
|
||||
XMLNode.attribute(withName: "url", stringValue: update.archiveURL.absoluteString) as! XMLNode,
|
||||
XMLNode.attribute(withName: "url", stringValue: archiveURL) as! XMLNode,
|
||||
XMLNode.attribute(withName: "sparkle:version", uri: sparkleNS, stringValue: update.version) as! XMLNode,
|
||||
XMLNode.attribute(withName: "length", stringValue: String(update.fileSize)) as! XMLNode,
|
||||
XMLNode.attribute(withName: "type", stringValue: update.mimeType) as! XMLNode,
|
||||
@@ -160,5 +162,7 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws {
|
||||
}
|
||||
|
||||
let options = XMLNode.Options.nodeCompactEmptyElement;
|
||||
try doc.xmlData(withOptions:Int(options.rawValue)).write(to: appcastDestPath);
|
||||
let docData = doc.xmlData(withOptions:Int(options.rawValue));
|
||||
let _ = try XMLDocument(data: docData, options:0); // Verify that it was generated correctly, which does not always happen!
|
||||
try docData.write(to: appcastDestPath);
|
||||
}
|
||||
@@ -31,7 +31,7 @@ func unarchive(itemPath:URL, archiveDestDir: URL, callback: @escaping (Error?) -
|
||||
}, progressBlock: nil)
|
||||
} else {
|
||||
_ = try? fileManager.removeItem(at: itemCopy);
|
||||
callback(makeError(code: .unarchivingError, "Can't create a hardlink to \(itemCopy)"));
|
||||
callback(makeError(code: .unarchivingError, "Not a supported archive format: \(itemCopy)"));
|
||||
}
|
||||
} catch {
|
||||
_ = try? fileManager.removeItem(at: tempDir);
|
||||
|
||||
Reference in new issue
Block a user