From 64f02ad6b8bf71b6a0866a592de9639e6f92cd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Wed, 18 May 2016 15:30:40 +0200 Subject: [PATCH 1/2] Restore compatibility with OS X 10.7 `NSURLIsExcludedFromBackupKey` is only available from 10.8 upwards so we need to check before using it --- Classes/Helper/BITHockeyHelper.m | 4 ++++ Classes/Telemetry/BITPersistence.m | 17 ++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Classes/Helper/BITHockeyHelper.m b/Classes/Helper/BITHockeyHelper.m index b844efac..1ed96380 100644 --- a/Classes/Helper/BITHockeyHelper.m +++ b/Classes/Helper/BITHockeyHelper.m @@ -74,6 +74,10 @@ NSComparisonResult bit_versionCompare(NSString *stringA, NSString *stringB) { #pragma mark Exclude from backup fix void bit_fixBackupAttributeForURL(NSURL *directoryURL) { + if (&NSURLIsExcludedFromBackupKey == NULL) { + BITHockeyLog(@"WARNING: &NSURLIsExcludedBackupKey is NULL, returning"); + return; + } BOOL shouldExcludeAppSupportDirFromBackup = [[NSUserDefaults standardUserDefaults] boolForKey:kBITExcludeApplicationSupportFromBackup]; if (shouldExcludeAppSupportDirFromBackup) { diff --git a/Classes/Telemetry/BITPersistence.m b/Classes/Telemetry/BITPersistence.m index e2f77386..2dd5b788 100644 --- a/Classes/Telemetry/BITPersistence.m +++ b/Classes/Telemetry/BITPersistence.m @@ -229,13 +229,16 @@ - (void)createDirectoryStructureIfNeeded { return; } - //Exclude HockeySDK folder from backup - if (![appURL setResourceValue:@YES - forKey:NSURLIsExcludedFromBackupKey - error:&error]) { - BITHockeyLog(@"Error excluding %@ from backup %@", appURL.lastPathComponent, error.localizedDescription); - } else { - BITHockeyLog(@"Exclude %@ from backup", appURL); + // Make sure NSURLIsExcludedFromBackupKey is available + if (&NSURLIsExcludedFromBackupKey != NULL) { + //Exclude HockeySDK folder from backup + if (![appURL setResourceValue:@YES + forKey:NSURLIsExcludedFromBackupKey + error:&error]) { + BITHockeyLog(@"ERROR: Error excluding %@ from backup %@", appURL.lastPathComponent, error.localizedDescription); + } else { + BITHockeyLog(@"INFO: Exclude %@ from backup", appURL); + } } _directorySetupComplete = YES; From 3d7aae3e9c5f3297423bfad75117345323a8666c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Wed, 18 May 2016 15:55:03 +0200 Subject: [PATCH 2/2] Update version and build number to 4.0.2 --- HockeySDK-Mac.podspec | 2 +- README.md | 6 +++--- Support/buildnumber.xcconfig | 4 ++-- docs/Changelog-template.md | 4 ++++ docs/Guide-Installation-Setup-template.md | 6 +++--- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/HockeySDK-Mac.podspec b/HockeySDK-Mac.podspec index 0f9443dc..a1174c48 100644 --- a/HockeySDK-Mac.podspec +++ b/HockeySDK-Mac.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'HockeySDK-Mac' - s.version = '4.0.1' + s.version = '4.0.2' s.summary = 'Collect live crash reports, get feedback from your users, distribute your betas, and get usage data.' s.description = <<-DESC diff --git a/README.md b/README.md index a6d2192c..fa4fa831 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ [![Build Status](https://travis-ci.org/bitstadium/HockeySDK-iOS.svg?branch=develop)](https://travis-ci.org/bitstadium/HockeySDK-Mac) -## Version 4.0.1 +## Version 4.0.2 -- [Changelog](http://www.hockeyapp.net/help/sdk/mac/4.0.1/docs/docs/Changelog.html) +- [Changelog](http://www.hockeyapp.net/help/sdk/mac/4.0.2/docs/docs/Changelog.html) **NOTE:** With the release of HockeySDK 4.0.0-alpha.1 a bug was introduced which lead to the exclusion of the Application Support folder from iCloud and iTunes backups. @@ -359,7 +359,7 @@ To check if data is send properly to HockeyApp and also see some additional SDK ## 4. Documentation -Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/mac/4.0.1/index.html). +Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/mac/4.0.2/index.html). ## 5.Troubleshooting diff --git a/Support/buildnumber.xcconfig b/Support/buildnumber.xcconfig index ffdb1e61..56e79cbe 100644 --- a/Support/buildnumber.xcconfig +++ b/Support/buildnumber.xcconfig @@ -1,5 +1,5 @@ #include "HockeySDK.xcconfig" -BUILD_NUMBER = 47 -VERSION_STRING = 4.0.1 +BUILD_NUMBER = 48 +VERSION_STRING = 4.0.2 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) BITHOCKEY_VERSION="@\""$(VERSION_STRING)"\"" BITHOCKEY_BUILD="@\""$(BUILD_NUMBER)"\"" BITHOCKEY_C_VERSION="\""$(VERSION_STRING)"\"" BITHOCKEY_C_BUILD="\""$(BUILD_NUMBER)"\"" $(XCODEBUILD_GCC_PREPROCESSOR_DEFINITIONS) diff --git a/docs/Changelog-template.md b/docs/Changelog-template.md index 2c2a6193..518e6712 100644 --- a/docs/Changelog-template.md +++ b/docs/Changelog-template.md @@ -1,3 +1,7 @@ +## Version 4.0.2 + +- [BUGFIX] Restore compatibility with OS X 10.7 by not accessing `NSURLIsExcludedFromBackupKey` if not available + ## Version 4.0.1 - [BUGFIX] Fixes an issue where the whole app's Application Support directory (sandboxed apps) / user’s Application Support directory (non-sandboxed apps) was accidentally excluded from backups. diff --git a/docs/Guide-Installation-Setup-template.md b/docs/Guide-Installation-Setup-template.md index 61907ef7..0d68b37e 100644 --- a/docs/Guide-Installation-Setup-template.md +++ b/docs/Guide-Installation-Setup-template.md @@ -1,6 +1,6 @@ -## Version 4.0.1 +## Version 4.0.2 -- [Changelog](http://www.hockeyapp.net/help/sdk/mac/4.0.1/docs/docs/Changelog.html) +- [Changelog](http://www.hockeyapp.net/help/sdk/mac/4.0.2/docs/docs/Changelog.html) **NOTE:** With the release of HockeySDK 4.0.0-alpha.1 a bug was introduced which lead to the exclusion of the Application Support folder from iCloud and iTunes backups. @@ -345,7 +345,7 @@ To check if data is send properly to HockeyApp and also see some additional SDK ## 4. Documentation -Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/mac/4.0.1/index.html). +Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/mac/4.0.2/index.html). ## 5.Troubleshooting