Skip to content

Commit

Permalink
Auto Updates
Browse files Browse the repository at this point in the history
ZetaWatch now auto updates using sparkle framework.
  • Loading branch information
cbreak-black committed Sep 21, 2019
1 parent c9cc48c commit aec4c73
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Archive
DerivedData
xcuserdata
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "ThirdParty/Sparkle"]
path = ThirdParty/Sparkle
url = ../Sparkle.git
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ executes actions on behalf of the user, such as mounting, unmounting or loading
the newest Mac OS X.


Self Updating
-------------

The self-updating uses [SparkleFramework]. Since the newest released sparkle does not yet
support hardened runtime, it needs to be compiled manually. Building the "Distribution"
target in the Sparkle submodule in release mode is sufficient.
The sparkle submodule contains a version that is slimmed down by removing most languages,
which saves space. Since ZetaWatch is not localized, this is not a problem.
To create a working fork, adjust the public key and update url in the Info.plist file.


License
=======

Expand All @@ -105,3 +116,5 @@ details.
[`SMJobBless`]: https://developer.apple.com/documentation/servicemanagement/1431078-smjobbless?language=objc
[Notarization]: https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution?language=objc
[ZFSImage]: https://raw.githubusercontent.com/cbreak-black/ZetaWatch/master/doc/ZetaWatch.jpg
[SparkleFramework]: https://sparkle-project.org/
[SparkleGithub]: https://github.com/sparkle-project/Sparkle
1 change: 1 addition & 0 deletions ThirdParty/Sparkle
Submodule Sparkle added at 57125d
2 changes: 1 addition & 1 deletion ZetaAuthorizationHelper/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleName</key>
<string>ZetaAuthorizationHelper</string>
<key>CFBundleVersion</key>
<string>26</string>
<string>27</string>
<key>SMAuthorizedClients</key>
<array>
<string>anchor apple generic and identifier "net.the-color-black.ZetaWatch" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = "8THUW5GT6P")</string>
Expand Down
16 changes: 16 additions & 0 deletions ZetaWatch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
7018765E20E7DA9900BA39B8 /* libzpool.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7018765A20E7DA8100BA39B8 /* libzpool.1.dylib */; };
703811A12312A2CB002C760A /* ZetaNotificationCenter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 703811A02312A2CB002C760A /* ZetaNotificationCenter.mm */; };
703811A42312C833002C760A /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 703811A32312C833002C760A /* ServiceManagement.framework */; };
70552BC62336AFD8002C760A /* Sparkle.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 70552BC42336AEB2002C760A /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
70552BC82336B196002C760A /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70552BC42336AEB2002C760A /* Sparkle.framework */; };
70703F3722AD7633002C760A /* DiskArbitration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70703F3622AD7633002C760A /* DiskArbitration.framework */; };
70703F3922AD7A17002C760A /* IDDiskArbitrationUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70703F3822AD7A16002C760A /* IDDiskArbitrationUtils.cpp */; };
709C1CAD1C354F8B00929DAE /* ZetaPoolWatcher.mm in Sources */ = {isa = PBXBuildFile; fileRef = 709C1CAC1C354F8B00929DAE /* ZetaPoolWatcher.mm */; };
Expand Down Expand Up @@ -98,6 +100,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
70552BC62336AFD8002C760A /* Sparkle.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -131,6 +134,7 @@
703811A02312A2CB002C760A /* ZetaNotificationCenter.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ZetaNotificationCenter.mm; sourceTree = "<group>"; };
703811A22312A2E6002C760A /* ZetaNotificationCenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZetaNotificationCenter.h; sourceTree = "<group>"; };
703811A32312C833002C760A /* ServiceManagement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ServiceManagement.framework; path = System/Library/Frameworks/ServiceManagement.framework; sourceTree = SDKROOT; };
70552BC42336AEB2002C760A /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = ThirdParty/Sparkle/DerivedData/Sparkle/Build/Products/Release/Sparkle.framework; sourceTree = "<group>"; };
70703F3622AD7633002C760A /* DiskArbitration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DiskArbitration.framework; path = System/Library/Frameworks/DiskArbitration.framework; sourceTree = SDKROOT; };
70703F3822AD7A16002C760A /* IDDiskArbitrationUtils.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = IDDiskArbitrationUtils.cpp; path = InvariantDisks/IDDiskArbitrationUtils.cpp; sourceTree = "<group>"; };
7072697B22EDB2BE002C760A /* ZetaCPPUtils.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ZetaCPPUtils.hpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -192,6 +196,7 @@
7018764C20E7B57600BA39B8 /* libnvpair.1.dylib in Frameworks */,
7018764D20E7B57700BA39B8 /* libzfs_core.1.dylib in Frameworks */,
7018764E20E7B57900BA39B8 /* libzfs.2.dylib in Frameworks */,
70552BC82336B196002C760A /* Sparkle.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -336,6 +341,7 @@
70DB77B11FFAD8E300BA39B8 /* Frameworks */ = {
isa = PBXGroup;
children = (
70552BC42336AEB2002C760A /* Sparkle.framework */,
703811A32312C833002C760A /* ServiceManagement.framework */,
70703F3622AD7633002C760A /* DiskArbitration.framework */,
);
Expand Down Expand Up @@ -758,6 +764,11 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
"$(PROJECT_DIR)/ThirdParty/Sparkle/DerivedData/Sparkle/Build/Products/Release/",
);
INFOPLIST_FILE = ZetaWatch/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "net.the-color-black.ZetaWatch";
Expand All @@ -770,6 +781,11 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
"$(PROJECT_DIR)/ThirdParty/Sparkle/DerivedData/Sparkle/Build/Products/Release/",
);
INFOPLIST_FILE = ZetaWatch/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "net.the-color-black.ZetaWatch";
Expand Down
14 changes: 14 additions & 0 deletions ZetaWatch/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@
<binding destination="oMO-Og-s5N" name="value" keyPath="values.autoUnlock" id="sSC-4i-zjn"/>
</connections>
</menuItem>
<menuItem title="Auto Update" id="PuO-P5-LRP">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<binding destination="oMO-Og-s5N" name="value" keyPath="values.SUEnableAutomaticChecks" id="7wB-4r-eBc"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="k2v-Lw-Y2t"/>
<menuItem title="Check for Updates now..." id="e40-VT-eEj">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="checkForUpdates:" target="7Va-uZ-m1K" id="yj1-Ju-zDX"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
Expand Down Expand Up @@ -946,6 +959,7 @@ Gw
</constraints>
<point key="canvasLocation" x="144" y="581"/>
</customView>
<customObject id="7Va-uZ-m1K" customClass="SUUpdater"/>
</objects>
<resources>
<image name="NSApplicationIcon" width="128" height="128"/>
Expand Down
8 changes: 6 additions & 2 deletions ZetaWatch/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>26</string>
<string>27</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>26</string>
<string>27</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSBackgroundOnly</key>
Expand All @@ -43,5 +43,9 @@
<key>net.the-color-black.ZetaAuthorizationHelper</key>
<string>anchor apple generic and identifier "net.the-color-black.ZetaAuthorizationHelper" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = "8THUW5GT6P")</string>
</dict>
<key>SUFeedURL</key>
<string>https://zetawatch.the-color-black.net/download/appcast.xml</string>
<key>SUPublicEDKey</key>
<string>Ed/JNtoVf4G8CX7qffgoFFHmb4303SFsmJ3yh2vAhyc=</string>
</dict>
</plist>

0 comments on commit aec4c73

Please sign in to comment.