Skip to content

Commit

Permalink
Added automatic updates using Sparkle framework
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavo-IM committed Jul 1, 2020
1 parent 9a52f88 commit be7bfde
Show file tree
Hide file tree
Showing 199 changed files with 6,399 additions and 10 deletions.
37 changes: 29 additions & 8 deletions OC Gen-X.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/* Begin PBXBuildFile section */
CF039FA8249DA1C400C3622E /* HfsPlus.efi in Resources */ = {isa = PBXBuildFile; fileRef = CF039FA7249DA1C400C3622E /* HfsPlus.efi */; };
CF2F509924ACD5DC003AAD00 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CF2F509824ACD5DC003AAD00 /* Sparkle.framework */; };
CF2F509B24ACD738003AAD00 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CF2F509824ACD5DC003AAD00 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
CF4B049E249EBD4B00690FB2 /* LucyRTL8125Ethernet.kext in Resources */ = {isa = PBXBuildFile; fileRef = CF4B049D249EBD4B00690FB2 /* LucyRTL8125Ethernet.kext */; };
CF4B04A3249EBD6400690FB2 /* BrcmPatchRAM3.kext in Resources */ = {isa = PBXBuildFile; fileRef = CF4B049F249EBD6400690FB2 /* BrcmPatchRAM3.kext */; };
CF4B04A4249EBD6400690FB2 /* BrcmFirmwareData.kext in Resources */ = {isa = PBXBuildFile; fileRef = CF4B04A0249EBD6400690FB2 /* BrcmFirmwareData.kext */; };
Expand Down Expand Up @@ -55,9 +57,23 @@
D5B5BBF824A7B6CC004E5D7C /* HyperlinkTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5B5BBF724A7B6CC004E5D7C /* HyperlinkTextField.swift */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
CF2F509A24ACD723003AAD00 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
CF2F509B24ACD738003AAD00 /* Sparkle.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
B896CFA1249F24E50061F934 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Main.strings; sourceTree = "<group>"; };
CF039FA7249DA1C400C3622E /* HfsPlus.efi */ = {isa = PBXFileReference; lastKnownFileType = file; path = HfsPlus.efi; sourceTree = "<group>"; };
CF2F509824ACD5DC003AAD00 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = "<group>"; };
CF4B049D249EBD4B00690FB2 /* LucyRTL8125Ethernet.kext */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.kernel-extension"; path = LucyRTL8125Ethernet.kext; sourceTree = "<group>"; };
CF4B049F249EBD6400690FB2 /* BrcmPatchRAM3.kext */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.kernel-extension"; path = BrcmPatchRAM3.kext; sourceTree = "<group>"; };
CF4B04A0249EBD6400690FB2 /* BrcmFirmwareData.kext */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.kernel-extension"; path = BrcmFirmwareData.kext; sourceTree = "<group>"; };
Expand Down Expand Up @@ -113,6 +129,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
CF2F509924ACD5DC003AAD00 /* Sparkle.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -200,6 +217,7 @@
CF59E730241DA2D600A7C5EC /* Info.plist */,
CF59E731241DA2D600A7C5EC /* OC_Gen_X.entitlements */,
CFE8A22F249E662400D72669 /* AppIcon.xcassets */,
CF2F509824ACD5DC003AAD00 /* Sparkle.framework */,
);
path = "OC Gen-X";
sourceTree = "<group>";
Expand Down Expand Up @@ -240,6 +258,7 @@
CF59E720241DA2D500A7C5EC /* Sources */,
CF59E721241DA2D500A7C5EC /* Frameworks */,
CF59E722241DA2D500A7C5EC /* Resources */,
CF2F509A24ACD723003AAD00 /* CopyFiles */,
);
buildRules = (
);
Expand Down Expand Up @@ -490,12 +509,13 @@
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 5DG8PLV54H;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "OC Gen-X/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"$(PROJECT_DIR)/OC\\ Gen-X",
);
MARKETING_VERSION = 1.8;
INFOPLIST_FILE = "OC Gen-X/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
MARKETING_VERSION = 1.9;
PRODUCT_BUNDLE_IDENTIFIER = "com.oc-gen-x.OC-Gen-X";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -513,12 +533,13 @@
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 5DG8PLV54H;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "OC Gen-X/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"$(PROJECT_DIR)/OC\\ Gen-X",
);
MARKETING_VERSION = 1.8;
INFOPLIST_FILE = "OC Gen-X/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
MARKETING_VERSION = 1.9;
PRODUCT_BUNDLE_IDENTIFIER = "com.oc-gen-x.OC-Gen-X";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Binary file not shown.
11 changes: 9 additions & 2 deletions OC Gen-X/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="17132" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17132"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16097"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -24,6 +24,12 @@
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
<menuItem title="Check For Updates" id="5oy-hi-1jP">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="checkForUpdates:" target="y9k-Qv-oTu" id="Cub-SW-Izn"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
<menuItem title="Services" id="NMo-om-nkz">
<modifierMask key="keyEquivalentModifierMask"/>
Expand Down Expand Up @@ -676,6 +682,7 @@
</connections>
</application>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="OC_Gen_X" customModuleProvider="target"/>
<customObject id="y9k-Qv-oTu" customClass="SUUpdater"/>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
Expand Down
8 changes: 8 additions & 0 deletions OC Gen-X/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,13 @@
<true/>
<key>NSSupportsSuddenTermination</key>
<true/>
<key>SUEnableAutomaticChecks</key>
<true/>
<key>SUFeedURL</key>
<string>https://oc-gen-x.herokuapp.com/OC-Gen-X/appcast.xml</string>
<key>SUScheduledCheckInterval</key>
<integer>3600</integer>
<key>SUShowReleaseNotes</key>
<false/>
</dict>
</plist>
1 change: 1 addition & 0 deletions OC Gen-X/Sparkle.framework/Headers
1 change: 1 addition & 0 deletions OC Gen-X/Sparkle.framework/Modules
1 change: 1 addition & 0 deletions OC Gen-X/Sparkle.framework/PrivateHeaders
1 change: 1 addition & 0 deletions OC Gen-X/Sparkle.framework/Resources
1 change: 1 addition & 0 deletions OC Gen-X/Sparkle.framework/Sparkle
43 changes: 43 additions & 0 deletions OC Gen-X/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 OC Gen-X/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
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
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
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
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 OC Gen-X/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
Loading

0 comments on commit be7bfde

Please sign in to comment.