From dc631f4d7e43aa377fe09f44e0701152df6e94ae Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Sun, 4 Dec 2011 13:56:27 +0100 Subject: [PATCH] If quincy.bundle is missing in the app, show a warning via NSLog and send crash reports without showing any dialogs, since it would crash otherwise --- Classes/BWQuincyManager.m | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Classes/BWQuincyManager.m b/Classes/BWQuincyManager.m index c847871190..75a07a902f 100644 --- a/Classes/BWQuincyManager.m +++ b/Classes/BWQuincyManager.m @@ -179,6 +179,10 @@ NSString *BWQuincyLocalize(NSString *stringToken) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startManager) name:BWQuincyNetworkBecomeReachable object:nil]; } + + if (!quincyBundle()) { + NSLog(@"WARNING: Quincy.bundle is missing in the app bundle!"); + } } return self; } @@ -251,7 +255,10 @@ NSString *BWQuincyLocalize(NSString *stringToken) { - (void)startManager { if (!_sendingInProgress && [self hasPendingCrashReport]) { _sendingInProgress = YES; - if (!self.autoSubmitCrashReport && [self hasNonApprovedCrashReports]) { + if (!quincyBundle()) { + NSLog(@"Quincy.bundle is missing, sending report automatically!"); + [self _sendCrashReports]; + } else if (!self.autoSubmitCrashReport && [self hasNonApprovedCrashReports]) { if (self.delegate != nil && [self.delegate respondsToSelector:@selector(willShowSubmitCrashReportAlert)]) { [self.delegate willShowSubmitCrashReportAlert]; @@ -323,7 +330,8 @@ NSString *BWQuincyLocalize(NSString *stringToken) { UIAlertView *alertView = nil; if (_serverResult >= CrashReportStatusAssigned && - _crashIdenticalCurrentVersion) { + _crashIdenticalCurrentVersion && + quincyBundle()) { // show some feedback to the user about the crash status NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; switch (_serverResult) { @@ -458,8 +466,8 @@ NSString *BWQuincyLocalize(NSString *stringToken) { NSString *userid = @""; NSString *contact = @""; NSString *description = @""; - - if (self.autoSubmitDeviceUDID) { + + if (self.autoSubmitDeviceUDID && [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]) { userid = [self deviceIdentifier]; } else if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReportUserID)]) { userid = [self.delegate crashReportUserID] ?: @"";