From 19f382cf49a6067ae961938f1280cb0283dc94d0 Mon Sep 17 00:00:00 2001 From: Jared Sinclair Date: Tue, 16 Dec 2014 13:32:48 -0500 Subject: [PATCH 1/7] Silence warnings. --- BugshotKit/BugshotKit.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BugshotKit/BugshotKit.m b/BugshotKit/BugshotKit.m index b819aab..253bb4b 100755 --- a/BugshotKit/BugshotKit.m +++ b/BugshotKit/BugshotKit.m @@ -521,7 +521,7 @@ - (BOOL)updateFromASL aslresponse r = asl_search(NULL, q); BOOL foundNewEntries = NO; - while ( (m = aslresponse_next(r)) ) { + while ( (m = asl_next(r)) ) { if (myPID != atol(asl_get(m, ASL_KEY_PID))) continue; // dupe checking @@ -537,7 +537,7 @@ - (BOOL)updateFromASL [self addLogMessage:[NSString stringWithUTF8String:msg] timestamp:msgTime]; } - aslresponse_free(r); + asl_release(r); asl_free(q); return foundNewEntries; From 538948dcbe8f8951c04c6d5233391adfc862a6e8 Mon Sep 17 00:00:00 2001 From: Jared Sinclair Date: Tue, 16 Dec 2014 15:06:11 -0500 Subject: [PATCH 2/7] Silence warning. --- BugshotKit/BugshotKit.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BugshotKit/BugshotKit.m b/BugshotKit/BugshotKit.m index 253bb4b..7a1c4fd 100755 --- a/BugshotKit/BugshotKit.m +++ b/BugshotKit/BugshotKit.m @@ -594,8 +594,7 @@ + (BOOL)isProbablyAppStoreBuild { #if TARGET_IPHONE_SIMULATOR return NO; -#endif - +#else // Adapted from https://github.com/blindsightcorp/BSMobileProvision NSString *binaryMobileProvision = [NSString stringWithContentsOfFile:[NSBundle.mainBundle pathForResource:@"embedded" ofType:@"mobileprovision"] encoding:NSISOLatin1StringEncoding error:NULL]; @@ -618,6 +617,7 @@ + (BOOL)isProbablyAppStoreBuild if (mobileProvision[@"ProvisionedDevices"] && ((NSDictionary *)mobileProvision[@"ProvisionedDevices"]).count) return NO; // development or ad-hoc return YES; // expected development/enterprise/ad-hoc entitlements not found +#endif } From ffb35e37631836a1c39096b9a261fcf4ecb6bc82 Mon Sep 17 00:00:00 2001 From: Jared Sinclair Date: Mon, 2 Feb 2015 17:10:45 -0500 Subject: [PATCH 3/7] Fix crash on iOS 7. --- BugshotKit/BugshotKit.m | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/BugshotKit/BugshotKit.m b/BugshotKit/BugshotKit.m index 7a1c4fd..de65f8b 100755 --- a/BugshotKit/BugshotKit.m +++ b/BugshotKit/BugshotKit.m @@ -509,6 +509,14 @@ - (void)addLogMessage:(NSString *)message timestamp:(NSTimeInterval)timestamp } } +// Because aslresponse_next is now deprecated. +asl_object_t SystemSafeASLNext(asl_object_t r) { + if ([UIDevice currentDevice].systemVersion.floatValue >= 8.0f) { + return asl_next(r); + } + return aslresponse_next(r); +} + // assumed to always be in logQueue - (BOOL)updateFromASL { @@ -521,7 +529,7 @@ - (BOOL)updateFromASL aslresponse r = asl_search(NULL, q); BOOL foundNewEntries = NO; - while ( (m = asl_next(r)) ) { + while ( (m = SystemSafeASLNext(r)) ) { if (myPID != atol(asl_get(m, ASL_KEY_PID))) continue; // dupe checking @@ -537,7 +545,11 @@ - (BOOL)updateFromASL [self addLogMessage:[NSString stringWithUTF8String:msg] timestamp:msgTime]; } - asl_release(r); + if ([UIDevice currentDevice].systemVersion.floatValue >= 8.0f) { + asl_release(r); + } else { + aslresponse_free(r); + } asl_free(q); return foundNewEntries; From 9fa5b735110450d4b2e5368ea0976b952429dc2c Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 25 May 2015 15:00:19 -0700 Subject: [PATCH 4/7] Silence deprecation warnings for aslresponse_blah --- BugshotKit/BugshotKit.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/BugshotKit/BugshotKit.m b/BugshotKit/BugshotKit.m index de65f8b..1637eae 100755 --- a/BugshotKit/BugshotKit.m +++ b/BugshotKit/BugshotKit.m @@ -514,7 +514,14 @@ asl_object_t SystemSafeASLNext(asl_object_t r) { if ([UIDevice currentDevice].systemVersion.floatValue >= 8.0f) { return asl_next(r); } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // The deprecation attribute incorrectly states that the replacement method, asl_next() + // is available in __IPHONE_7_0; asl_next() first appears in __IPHONE_8_0. + // This would require both a compile and runtime check to properly implement the new method + // while the minimum deployment target for this project remains iOS 7.0. return aslresponse_next(r); +#pragma clang diagnostic pop } // assumed to always be in logQueue @@ -548,7 +555,14 @@ - (BOOL)updateFromASL if ([UIDevice currentDevice].systemVersion.floatValue >= 8.0f) { asl_release(r); } else { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // The deprecation attribute incorrectly states that the replacement method, asl_release() + // is available in __IPHONE_7_0; asl_release() first appears in __IPHONE_8_0. + // This would require both a compile and runtime check to properly implement the new method + // while the minimum deployment target for this project remains iOS 7.0. aslresponse_free(r); +#pragma clang diagnostic pop } asl_free(q); From 088d0ccfc03b4ec194482b2a607d4766ccfe071c Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 25 May 2015 16:53:44 -0700 Subject: [PATCH 5/7] Fix dismissAninmated typo --- BugshotKit/BSKWindow.m | 2 +- BugshotKit/BugshotKit.h | 2 +- BugshotKit/BugshotKit.m | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/BugshotKit/BSKWindow.m b/BugshotKit/BSKWindow.m index 44b20b5..7403844 100755 --- a/BugshotKit/BSKWindow.m +++ b/BugshotKit/BSKWindow.m @@ -31,7 +31,7 @@ - (void)dealloc - (void)applicationWillEnterForeground:(NSNotification *)n { - [BugshotKit dismissAninmated:NO completion:NULL]; + [BugshotKit dismissAnimated:NO completion:NULL]; } - (void)applicationDidBecomeActive:(NSNotification *)n diff --git a/BugshotKit/BugshotKit.h b/BugshotKit/BugshotKit.h index bb03a6e..34a835b 100755 --- a/BugshotKit/BugshotKit.h +++ b/BugshotKit/BugshotKit.h @@ -34,7 +34,7 @@ typedef enum : NSUInteger { /* You can also always show it manually */ + (void)show; -+ (void)dismissAninmated:(BOOL)animated completion:(void(^)())completion; ++ (void)dismissAnimated:(BOOL)animated completion:(void(^)())completion; + (instancetype)sharedManager; - (void)clearLog; diff --git a/BugshotKit/BugshotKit.m b/BugshotKit/BugshotKit.m index 1637eae..ee486cd 100755 --- a/BugshotKit/BugshotKit.m +++ b/BugshotKit/BugshotKit.m @@ -427,8 +427,7 @@ - (void)handleOpenGesture:(UIGestureRecognizer *)sender [presentingViewController presentViewController:nc animated:YES completion:NULL]; } -+ (void)dismissAninmated:(BOOL)animated completion:(void(^)())completion -{ ++ (void)dismissAnimated:(BOOL)animated completion:(void(^)())completion { UIViewController *presentingVC = BugshotKit.sharedManager.presentedNavigationController.presentingViewController; if (presentingVC) { [presentingVC dismissViewControllerAnimated:animated completion:completion]; From 3b448b43db49c2dd7e7b87ea51ba55b72e1fc346 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 25 May 2015 21:31:04 -0700 Subject: [PATCH 6/7] Tint navigation controller title text --- BugshotKit/BugshotKit.m | 1 + 1 file changed, 1 insertion(+) diff --git a/BugshotKit/BugshotKit.m b/BugshotKit/BugshotKit.m index ee486cd..a82e170 100755 --- a/BugshotKit/BugshotKit.m +++ b/BugshotKit/BugshotKit.m @@ -424,6 +424,7 @@ - (void)handleOpenGesture:(UIGestureRecognizer *)sender BSKNavigationController *nc = [[BSKNavigationController alloc] initWithRootViewController:mvc lockedToRotation:self.window.rootViewController.interfaceOrientation]; self.presentedNavigationController = nc; nc.navigationBar.tintColor = BugshotKit.sharedManager.annotationFillColor; + nc.navigationBar.titleTextAttributes = @{ NSForegroundColorAttributeName:BugshotKit.sharedManager.annotationFillColor }; [presentingViewController presentViewController:nc animated:YES completion:NULL]; } From 97a13eccf1908905dc3959cc33886c71d556615b Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 25 May 2015 21:25:03 -0700 Subject: [PATCH 7/7] Fix snapshot image orientation for iOS 8+ --- BugshotKit/BugshotKit.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BugshotKit/BugshotKit.m b/BugshotKit/BugshotKit.m index a82e170..a1213cc 100755 --- a/BugshotKit/BugshotKit.m +++ b/BugshotKit/BugshotKit.m @@ -408,7 +408,7 @@ - (void)handleOpenGesture:(UIGestureRecognizer *)sender self.snapshotImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); - if (interfaceOrientation != UIInterfaceOrientationPortrait) { + if ([UIDevice currentDevice].systemVersion.floatValue < 8.0f && interfaceOrientation != UIInterfaceOrientationPortrait) { self.snapshotImage = [[UIImage alloc] initWithCGImage:self.snapshotImage.CGImage scale:UIScreen.mainScreen.scale orientation:( interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown ? UIImageOrientationDown : ( interfaceOrientation == UIInterfaceOrientationLandscapeLeft ? UIImageOrientationRight : UIImageOrientationLeft