Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'release/2.1.4'

* release/2.1.4:
  Update PLCrashReporter with UTF bug fix
  Update iOS demo project to build with armv6 and iOS3 deployment target
  Ignore crash reports that do not match the current app version or have no content on the Mac
  Code formatting updates
  Clean crash queue if the HockeyApp server rejected the crash
  fixed a memory leak
  Enable armv6 architecture.
  added support for sending crash reports automatically
  Now this is the last space indentation fix
  Missed one last
  Same for the header file
  And some more missed out
  Again some more 2 space indentation fixes
  • Loading branch information...
commit 17ac1935ed5314d20482bea0ed0379d710f94152 2 parents 69ed542 + f8d80e4
Andreas Linde authored
13  client/Mac/BWQuincyManager.h
@@ -104,6 +104,11 @@ typedef enum CrashReportStatus {
104 104
 
105 105
 @optional
106 106
 
  107
+// Return the description the crashreport should contain, empty by default. The string will automatically be wrapped into <[DATA[ ]]>, so make sure you don't do that in your string.
  108
+-(NSString *) crashReportDescription;
  109
+
  110
+@optional
  111
+
107 112
 // Return the userid the crashreport should contain, empty by default
108 113
 -(NSString *) crashReportUserID;
109 114
 
@@ -127,6 +132,7 @@ typedef enum CrashReportStatus {
127 132
 	NSString			*_submissionURL;
128 133
 	NSString			*_companyName;
129 134
     NSString			*_appIdentifier;
  135
+    BOOL                _autoSubmitCrashReport;
130 136
 
131 137
 	NSString			*_crashFile;
132 138
 	
@@ -146,6 +152,10 @@ typedef enum CrashReportStatus {
146 152
 // delegate is required
147 153
 @property (nonatomic, assign) id <BWQuincyManagerDelegate> delegate;
148 154
 
  155
+// if YES, the crash report will be submitted without asking the user
  156
+// if NO, the user will be asked if the crash report can be submitted (default)
  157
+@property (nonatomic, assign, getter=isAutoSubmitCrashReport) BOOL autoSubmitCrashReport;
  158
+
149 159
 ///////////////////////////////////////////////////////////////////////////////////////////////////
150 160
 // settings
151 161
 
@@ -154,7 +164,8 @@ typedef enum CrashReportStatus {
154 164
 
155 165
 
156 166
 - (void) cancelReport;
157  
-- (void) sendReport:(NSString *)xml;
  167
+- (void) sendReportCrash:(NSString*)crashContent
  168
+             description:(NSString*)description;
158 169
 
159 170
 - (NSString *) applicationName;
160 171
 - (NSString *) applicationVersionString;
138  client/Mac/BWQuincyManager.m
@@ -53,6 +53,7 @@ @implementation BWQuincyManager
53 53
 @synthesize submissionURL = _submissionURL;
54 54
 @synthesize companyName = _companyName;
55 55
 @synthesize appIdentifier = _appIdentifier;
  56
+@synthesize autoSubmitCrashReport = _autoSubmitCrashReport;
56 57
 
57 58
 + (BWQuincyManager *)sharedQuincyManager {
58 59
 	static BWQuincyManager *quincyManager = nil;
@@ -135,16 +136,39 @@ - (void)setAppIdentifier:(NSString *)anAppIdentifier {
135 136
   [self setSubmissionURL:@"https://rink.hockeyapp.net/"];
136 137
 }
137 138
 
  139
+- (void)storeLastCrashDate:(NSDate *) date {
  140
+  [[NSUserDefaults standardUserDefaults] setValue:date forKey:@"CrashReportSender.lastCrashDate"];
  141
+  [[NSUserDefaults standardUserDefaults] synchronize];
  142
+}
  143
+
  144
+- (NSDate *)loadLastCrashDate {
  145
+  NSDate *date = [[NSUserDefaults standardUserDefaults] valueForKey:@"CrashReportSender.lastCrashDate"];
  146
+  return date ?: [NSDate distantPast];
  147
+}
  148
+
  149
+- (void)storeAppVersion:(NSString *) version {
  150
+  [[NSUserDefaults standardUserDefaults] setValue:version forKey:@"CrashReportSender.appVersion"];
  151
+  [[NSUserDefaults standardUserDefaults] synchronize];
  152
+}
  153
+
  154
+- (NSString *)loadAppVersion {
  155
+  NSString *appVersion = [[NSUserDefaults standardUserDefaults] valueForKey:@"CrashReportSender.appVersion"];
  156
+  return appVersion ?: nil;
  157
+}
  158
+
138 159
 #pragma mark -
139 160
 #pragma mark GetCrashData
140 161
 
141 162
 - (BOOL) hasPendingCrashReport {
142 163
 	BOOL returnValue = NO;
143 164
   
144  
-  if (![[NSUserDefaults standardUserDefaults] valueForKey: @"CrashReportSender.lastCrashDate"]) {
145  
-    [[NSUserDefaults standardUserDefaults] setValue: [NSDate date]
146  
-                                             forKey: @"CrashReportSender.lastCrashDate"];
147  
-    return returnValue;
  165
+  NSString *appVersion = [self loadAppVersion];
  166
+  NSDate *lastCrashDate = [self loadLastCrashDate];
  167
+
  168
+  if (!appVersion || ![appVersion isEqualToString:[self applicationVersion]] || [lastCrashDate isEqualToDate:[NSDate distantPast]]) {
  169
+    [self storeAppVersion:[self applicationVersion]];
  170
+    [self storeLastCrashDate:[NSDate date]];
  171
+    return NO;
148 172
   }
149 173
   
150 174
   NSArray* libraryDirectories = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, TRUE);
@@ -164,16 +188,12 @@ - (BOOL) hasPendingCrashReport {
164 188
   if (_crashFile) {
165 189
     NSError* error;
166 190
     
167  
-    NSDate *lastCrashDate = [[NSUserDefaults standardUserDefaults] valueForKey: @"CrashReportSender.lastCrashDate"];
168  
-    
169 191
     NSDate *crashLogModificationDate = [[[NSFileManager defaultManager] attributesOfItemAtPath:_crashFile error:&error] fileModificationDate];
170  
-    
171  
-    if (!lastCrashDate || (lastCrashDate && crashLogModificationDate && ([crashLogModificationDate compare: lastCrashDate] == NSOrderedDescending))) {
  192
+    unsigned long long crashLogFileSize = [[[NSFileManager defaultManager] attributesOfItemAtPath:_crashFile error:&error] fileSize];
  193
+    if ([crashLogModificationDate compare: lastCrashDate] == NSOrderedDescending && crashLogFileSize > 0) {
  194
+      [self storeLastCrashDate:crashLogModificationDate];
172 195
       returnValue = YES;
173 196
     }
174  
-    
175  
-    [[NSUserDefaults standardUserDefaults] setValue: crashLogModificationDate
176  
-                                             forKey: @"CrashReportSender.lastCrashDate"];
177 197
   }
178 198
 	
179 199
 	return returnValue;
@@ -186,9 +206,24 @@ - (void) returnToMainApplication {
186 206
 
187 207
 - (void) startManager {
188 208
   if ([self hasPendingCrashReport]) {
189  
-    
190  
-    _quincyUI = [[BWQuincyUI alloc] init:self crashFile:_crashFile companyName:_companyName applicationName:[self applicationName]];
191  
-    [_quincyUI askCrashReportDetails];
  209
+    if (!self.autoSubmitCrashReport) {
  210
+      _quincyUI = [[BWQuincyUI alloc] init:self crashFile:_crashFile companyName:_companyName applicationName:[self applicationName]];
  211
+      [_quincyUI askCrashReportDetails];
  212
+    } else {
  213
+      NSError* error = nil;
  214
+      NSString *crashLogs = [NSString stringWithContentsOfFile:_crashFile encoding:NSUTF8StringEncoding error:&error];
  215
+      if (!error) {
  216
+        NSString *lastCrash = [[crashLogs componentsSeparatedByString: @"**********\n\n"] lastObject];
  217
+        
  218
+        NSString* description = @"";
  219
+        
  220
+        if (_delegate && [_delegate respondsToSelector:@selector(crashReportDescription)]) {
  221
+          description = [_delegate crashReportDescription];
  222
+        }
  223
+              
  224
+        [self sendReportCrash:lastCrash description:description];
  225
+      }
  226
+    }
192 227
   } else {
193 228
     [self returnToMainApplication];
194 229
   }
@@ -229,11 +264,34 @@ - (void) cancelReport {
229 264
 }
230 265
 
231 266
 
232  
-- (void) sendReport:(NSString *)xml {
233  
-  [self returnToMainApplication];
  267
+- (void) sendReportCrash:(NSString*)crashContent
  268
+             description:(NSString*)notes
  269
+{
  270
+  NSString *userid = @"";
  271
+	NSString *contact = @"";
  272
+		
  273
+	SInt32 versionMajor, versionMinor, versionBugFix;
  274
+	if (Gestalt(gestaltSystemVersionMajor, &versionMajor) != noErr) versionMajor = 0;
  275
+	if (Gestalt(gestaltSystemVersionMinor, &versionMinor) != noErr)  versionMinor= 0;
  276
+	if (Gestalt(gestaltSystemVersionBugFix, &versionBugFix) != noErr) versionBugFix = 0;
  277
+	
  278
+	NSString* xml = [NSString stringWithFormat:@"<crash><applicationname>%s</applicationname><bundleidentifier>%s</bundleidentifier><systemversion>%@</systemversion><senderversion>%@</senderversion><version>%@</version><platform>%@</platform><userid>%@</userid><contact>%@</contact><description><![CDATA[%@]]></description><log><![CDATA[%@]]></log></crash>",
  279
+             [[self applicationName] UTF8String],
  280
+             [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"] UTF8String],
  281
+             [NSString stringWithFormat:@"%i.%i.%i", versionMajor, versionMinor, versionBugFix],
  282
+             [self applicationVersion],
  283
+             [self applicationVersion],
  284
+             [self modelVersion],
  285
+             userid,
  286
+             contact,
  287
+             notes,
  288
+             crashContent
  289
+             ];
  290
+
  291
+    
  292
+    [self returnToMainApplication];
234 293
 	
235  
-  [self _postXML:[NSString stringWithFormat:@"<crashes>%@</crashes>", xml]
236  
-           toURL:[NSURL URLWithString:self.submissionURL]];
  294
+    [self _postXML:[NSString stringWithFormat:@"<crashes>%@</crashes>", xml] toURL:[NSURL URLWithString:self.submissionURL]];
237 295
 }
238 296
 
239 297
 - (void)_postXML:(NSString*)xml toURL:(NSURL*)url {
@@ -460,40 +518,23 @@ - (IBAction) cancelReport:(id)sender {
460 518
 		[_delegate cancelReport];
461 519
 }
462 520
 
  521
+- (void) _sendReportAfterDelay {
  522
+  if ( _delegate != nil && [_delegate respondsToSelector:@selector(sendReport:)]) {
  523
+    NSString *notes = [NSString stringWithFormat:@"Comments:\n%@\n\nConsole:\n%@", [descriptionTextField stringValue], _consoleContent];
  524
+    
  525
+    [_delegate sendReportCrash:_crashLogContent description:notes];
  526
+  }
  527
+}
463 528
 
464 529
 - (IBAction) submitReport:(id)sender {
465 530
 	[submitButton setEnabled:NO];
466 531
 	
467 532
 	[[self window] makeFirstResponder: nil];
468 533
 	
469  
-	NSString *userid = @"";
470  
-	NSString *contact = @"";
471  
-	
472  
-	NSString *notes = [NSString stringWithFormat:@"Comments:\n%@\n\nConsole:\n%@", [descriptionTextField stringValue], _consoleContent];	
473  
-	
474  
-	SInt32 versionMajor, versionMinor, versionBugFix;
475  
-	if (Gestalt(gestaltSystemVersionMajor, &versionMajor) != noErr) versionMajor = 0;
476  
-	if (Gestalt(gestaltSystemVersionMinor, &versionMinor) != noErr)  versionMinor= 0;
477  
-	if (Gestalt(gestaltSystemVersionBugFix, &versionBugFix) != noErr) versionBugFix = 0;
478  
-	
479  
-	_xml = [[NSString stringWithFormat:@"<crash><applicationname>%s</applicationname><bundleidentifier>%s</bundleidentifier><systemversion>%@</systemversion><senderversion>%@</senderversion><version>%@</version><platform>%@</platform><userid>%@</userid><contact>%@</contact><description><![CDATA[%@]]></description><log><![CDATA[%@]]></log></crash>",
480  
-           [[_delegate applicationName] UTF8String],
481  
-           [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"] UTF8String],
482  
-           [NSString stringWithFormat:@"%i.%i.%i", versionMajor, versionMinor, versionBugFix],
483  
-           [_delegate applicationVersion],
484  
-           [_delegate applicationVersion],
485  
-           [_delegate modelVersion],
486  
-           userid,
487  
-           contact,
488  
-           notes,
489  
-           _crashLogContent
490  
-           ] retain];
491  
-	
  534
+    [self performSelector:@selector(_sendReportAfterDelay) withObject:nil afterDelay:0.01];
  535
+    
492 536
 	[self endCrashReporter];
493 537
 	[NSApp stopModal];
494  
-	
495  
-	if ( _delegate != nil && [_delegate respondsToSelector:@selector(sendReport:)])
496  
-    [_delegate performSelector:@selector(sendReport:) withObject:_xml afterDelay:0.01];
497 538
 }
498 539
 
499 540
 
@@ -517,8 +558,7 @@ - (void) askCrashReportDetails {
517 558
 	NSMutableArray* applicationStrings = [NSMutableArray array];
518 559
 	
519 560
 	NSString* searchString = [[_delegate applicationName] stringByAppendingString:@"["];
520  
-	while ( (currentObject = [theEnum nextObject]) )
521  
-	{
  561
+	while ( (currentObject = [theEnum nextObject]) ) {
522 562
 		if ([currentObject rangeOfString:searchString].location != NSNotFound)
523 563
 			[applicationStrings addObject: currentObject];
524 564
 	}
@@ -532,8 +572,7 @@ - (void) askCrashReportDetails {
532 572
 	}
533 573
 	
534 574
   // Now limit the content to CRASHREPORTSENDER_MAX_CONSOLE_SIZE (default: 50kByte)
535  
-  if ([_consoleContent length] > CRASHREPORTSENDER_MAX_CONSOLE_SIZE)
536  
-  {
  575
+  if ([_consoleContent length] > CRASHREPORTSENDER_MAX_CONSOLE_SIZE) {
537 576
     _consoleContent = (NSMutableString *)[_consoleContent substringWithRange:NSMakeRange([_consoleContent length]-CRASHREPORTSENDER_MAX_CONSOLE_SIZE-1, CRASHREPORTSENDER_MAX_CONSOLE_SIZE)]; 
538 577
   }
539 578
   
@@ -574,8 +613,7 @@ - (void)setShowDetails:(BOOL)value {
574 613
 
575 614
 #pragma mark NSTextField Delegate
576 615
 
577  
-- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector
578  
-{
  616
+- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector {
579 617
   BOOL commandHandled = NO;
580 618
   
581 619
   if (commandSelector == @selector(insertNewline:)) {
34  client/iOS/BWQuincyManager.h
@@ -54,31 +54,31 @@ NSString *BWQuincyLocalize(NSString *stringToken);
54 54
 #define BWQuincyNetworkBecomeReachable @"NetworkDidBecomeReachable"
55 55
 
56 56
 typedef enum QuincyKitAlertType {
57  
-	QuincyKitAlertTypeSend = 0,
58  
-	QuincyKitAlertTypeFeedback = 1,
  57
+  QuincyKitAlertTypeSend = 0,
  58
+  QuincyKitAlertTypeFeedback = 1,
59 59
 } CrashAlertType;
60 60
 
61 61
 typedef enum CrashReportStatus {
62 62
   // The status of the crash is queued, need to check later (HockeyApp)
63  
-	CrashReportStatusQueued = -80,
  63
+  CrashReportStatusQueued = -80,
64 64
   
65 65
   // This app version is set to discontinued, no new crash reports accepted by the server
66  
-	CrashReportStatusFailureVersionDiscontinued = -30,
  66
+  CrashReportStatusFailureVersionDiscontinued = -30,
67 67
   
68 68
   // XML: Sender version string contains not allowed characters, only alphanumberical including space and . are allowed
69  
-	CrashReportStatusFailureXMLSenderVersionNotAllowed = -21,
  69
+  CrashReportStatusFailureXMLSenderVersionNotAllowed = -21,
70 70
   
71 71
   // XML: Version string contains not allowed characters, only alphanumberical including space and . are allowed
72  
-	CrashReportStatusFailureXMLVersionNotAllowed = -20,
  72
+  CrashReportStatusFailureXMLVersionNotAllowed = -20,
73 73
   
74 74
   // SQL for adding a symoblicate todo entry in the database failed
75  
-	CrashReportStatusFailureSQLAddSymbolicateTodo = -18,
  75
+  CrashReportStatusFailureSQLAddSymbolicateTodo = -18,
76 76
   
77 77
   // SQL for adding crash log in the database failed
78  
-	CrashReportStatusFailureSQLAddCrashlog = -17,
  78
+  CrashReportStatusFailureSQLAddCrashlog = -17,
79 79
   
80 80
   // SQL for adding a new version in the database failed
81  
-	CrashReportStatusFailureSQLAddVersion = -16,
  81
+  CrashReportStatusFailureSQLAddVersion = -16,
82 82
 	
83 83
   // SQL for checking if the version is already added in the database failed
84 84
   CrashReportStatusFailureSQLCheckVersionExists = -15,
@@ -162,19 +162,19 @@ typedef enum CrashReportStatus {
162 162
   NSString *_feedbackRequestID;
163 163
   float _feedbackDelayInterval;
164 164
   
165  
-	NSMutableString *_contentOfProperty;
166  
-	CrashReportStatus _serverResult;
  165
+  NSMutableString *_contentOfProperty;
  166
+  CrashReportStatus _serverResult;
167 167
   
168  
-	int _analyzerStarted;
169  
-	NSString *_crashesDir;
  168
+  int _analyzerStarted;
  169
+  NSString *_crashesDir;
170 170
 	
171  
-	BOOL _crashIdenticalCurrentVersion;
  171
+  BOOL _crashIdenticalCurrentVersion;
172 172
   BOOL _crashReportActivated;
173 173
   
174  
-	NSMutableArray *_crashFiles;
  174
+  NSMutableArray *_crashFiles;
175 175
 	
176  
-	NSMutableData *_responseData;
177  
-	NSInteger _statusCode;
  176
+  NSMutableData *_responseData;
  177
+  NSInteger _statusCode;
178 178
   
179 179
   NSURLConnection *_urlConnection;
180 180
   
390  client/iOS/BWQuincyManager.m
@@ -92,8 +92,7 @@ @implementation BWQuincyManager
92 92
 @synthesize appIdentifier = _appIdentifier;
93 93
 
94 94
 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000
95  
-+(BWQuincyManager *)sharedQuincyManager
96  
-{   
  95
++(BWQuincyManager *)sharedQuincyManager {
97 96
   static BWQuincyManager *sharedInstance = nil;
98 97
   static dispatch_once_t pred;
99 98
   
@@ -106,23 +105,23 @@ +(BWQuincyManager *)sharedQuincyManager
106 105
 }
107 106
 #else
108 107
 + (BWQuincyManager *)sharedQuincyManager {
109  
-	static BWQuincyManager *quincyManager = nil;
  108
+  static BWQuincyManager *quincyManager = nil;
110 109
 	
111  
-	if (quincyManager == nil) {
112  
-		quincyManager = [[BWQuincyManager alloc] init];
113  
-	}
  110
+  if (quincyManager == nil) {
  111
+    quincyManager = [[BWQuincyManager alloc] init];
  112
+  }
114 113
 	
115  
-	return quincyManager;
  114
+  return quincyManager;
116 115
 }
117 116
 #endif
118 117
 
119 118
 - (id) init {
120 119
   if ((self = [super init])) {
121  
-		_serverResult = CrashReportStatusUnknown;
122  
-		_crashIdenticalCurrentVersion = YES;
123  
-		_crashData = nil;
  120
+    _serverResult = CrashReportStatusUnknown;
  121
+    _crashIdenticalCurrentVersion = YES;
  122
+    _crashData = nil;
124 123
     _urlConnection = nil;
125  
-		_submissionURL = nil;
  124
+    _submissionURL = nil;
126 125
     _responseData = nil;
127 126
     _appIdentifier = nil;
128 127
     _sendingInProgress = NO;
@@ -130,63 +129,63 @@ - (id) init {
130 129
     _didCrashInLastSession = NO;
131 130
     _loggingEnabled = NO;
132 131
     
133  
-		self.delegate = nil;
  132
+    self.delegate = nil;
134 133
     self.feedbackActivated = NO;
135 134
     self.showAlwaysButton = NO;
136 135
     self.autoSubmitCrashReport = NO;
137 136
     self.autoSubmitDeviceUDID = NO;
138 137
     
139  
-		NSString *testValue = [[NSUserDefaults standardUserDefaults] stringForKey:kQuincyKitAnalyzerStarted];
140  
-		if (testValue) {
141  
-			_analyzerStarted = [[NSUserDefaults standardUserDefaults] integerForKey:kQuincyKitAnalyzerStarted];
142  
-		} else {
143  
-			_analyzerStarted = 0;		
144  
-		}
  138
+    NSString *testValue = [[NSUserDefaults standardUserDefaults] stringForKey:kQuincyKitAnalyzerStarted];
  139
+    if (testValue) {
  140
+      _analyzerStarted = [[NSUserDefaults standardUserDefaults] integerForKey:kQuincyKitAnalyzerStarted];
  141
+    } else {
  142
+      _analyzerStarted = 0;		
  143
+    }
145 144
 		
146  
-		testValue = nil;
147  
-		testValue = [[NSUserDefaults standardUserDefaults] stringForKey:kQuincyKitActivated];
148  
-		if (testValue) {
149  
-			_crashReportActivated = [[NSUserDefaults standardUserDefaults] boolForKey:kQuincyKitActivated];
150  
-		} else {
151  
-			_crashReportActivated = YES;
152  
-			[[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithBool:YES] forKey:kQuincyKitActivated];
153  
-		}
  145
+    testValue = nil;
  146
+    testValue = [[NSUserDefaults standardUserDefaults] stringForKey:kQuincyKitActivated];
  147
+    if (testValue) {
  148
+      _crashReportActivated = [[NSUserDefaults standardUserDefaults] boolForKey:kQuincyKitActivated];
  149
+    } else {
  150
+      _crashReportActivated = YES;
  151
+      [[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithBool:YES] forKey:kQuincyKitActivated];
  152
+    }
154 153
     
155  
-		if (_crashReportActivated) {
156  
-			_crashFiles = [[NSMutableArray alloc] init];
157  
-			NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
158  
-			_crashesDir = [[NSString stringWithFormat:@"%@", [[paths objectAtIndex:0] stringByAppendingPathComponent:@"/crashes/"]] retain];
  154
+    if (_crashReportActivated) {
  155
+      _crashFiles = [[NSMutableArray alloc] init];
  156
+      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
  157
+      _crashesDir = [[NSString stringWithFormat:@"%@", [[paths objectAtIndex:0] stringByAppendingPathComponent:@"/crashes/"]] retain];
159 158
 			
160  
-			NSFileManager *fm = [NSFileManager defaultManager];
  159
+      NSFileManager *fm = [NSFileManager defaultManager];
161 160
 			
162  
-			if (![fm fileExistsAtPath:_crashesDir]) {
163  
-				NSDictionary *attributes = [NSDictionary dictionaryWithObject: [NSNumber numberWithUnsignedLong: 0755] forKey: NSFilePosixPermissions];
164  
-				NSError *theError = NULL;
  161
+      if (![fm fileExistsAtPath:_crashesDir]) {
  162
+        NSDictionary *attributes = [NSDictionary dictionaryWithObject: [NSNumber numberWithUnsignedLong: 0755] forKey: NSFilePosixPermissions];
  163
+        NSError *theError = NULL;
165 164
 				
166  
-				[fm createDirectoryAtPath:_crashesDir withIntermediateDirectories: YES attributes: attributes error: &theError];
167  
-			}
  165
+        [fm createDirectoryAtPath:_crashesDir withIntermediateDirectories: YES attributes: attributes error: &theError];
  166
+      }
168 167
       
169  
-			PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter];
170  
-			NSError *error = NULL;
171  
-			
172  
-			// Check if we previously crashed
173  
-			if ([crashReporter hasPendingCrashReport]) {
  168
+      PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter];
  169
+      NSError *error = NULL;
  170
+      
  171
+      // Check if we previously crashed
  172
+      if ([crashReporter hasPendingCrashReport]) {
174 173
         _didCrashInLastSession = YES;
175  
-				[self handleCrashReport];
  174
+        [self handleCrashReport];
176 175
       }
177 176
       
178  
-			// Enable the Crash Reporter
179  
-			if (![crashReporter enableCrashReporterAndReturnError: &error])
180  
-				NSLog(@"WARNING: Could not enable crash reporter: %@", error);
  177
+      // Enable the Crash Reporter
  178
+      if (![crashReporter enableCrashReporterAndReturnError: &error])
  179
+        NSLog(@"WARNING: Could not enable crash reporter: %@", error);
181 180
       
182 181
       [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startManager) name:BWQuincyNetworkBecomeReachable object:nil];
183  
-		}
  182
+    }
184 183
     
185 184
     if (!quincyBundle()) {
186  
-			NSLog(@"WARNING: Quincy.bundle is missing, will send reports automatically!");
  185
+      NSLog(@"WARNING: Quincy.bundle is missing, will send reports automatically!");
187 186
     }
188  
-	}
189  
-	return self;
  187
+  }
  188
+  return self;
190 189
 }
191 190
 
192 191
 
@@ -208,10 +207,10 @@ - (void) dealloc {
208 207
   
209 208
   [_crashData release];
210 209
   
211  
-	[_crashesDir release];
212  
-	[_crashFiles release];
  210
+  [_crashesDir release];
  211
+  [_crashFiles release];
213 212
   
214  
-	[super dealloc];
  213
+  [super dealloc];
215 214
 }
216 215
 
217 216
 
@@ -292,8 +291,8 @@ - (BOOL)hasNonApprovedCrashReports {
292 291
   
293 292
   if (!approvedCrashReports || [approvedCrashReports count] == 0) return YES;
294 293
   
295  
-	for (NSUInteger i=0; i < [_crashFiles count]; i++) {
296  
-		NSString *filename = [_crashFiles objectAtIndex:i];
  294
+  for (NSUInteger i=0; i < [_crashFiles count]; i++) {
  295
+    NSString *filename = [_crashFiles objectAtIndex:i];
297 296
     
298 297
     if (![approvedCrashReports objectForKey:filename]) return YES;
299 298
   }
@@ -330,46 +329,46 @@ - (BOOL)hasPendingCrashReport {
330 329
 
331 330
 
332 331
 - (void) showCrashStatusMessage {
333  
-	UIAlertView *alertView = nil;
  332
+  UIAlertView *alertView = nil;
334 333
 	
335  
-	if (_serverResult >= CrashReportStatusAssigned && 
336  
-      _crashIdenticalCurrentVersion &&
337  
-      quincyBundle()) {
338  
-		// show some feedback to the user about the crash status
339  
-		NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
340  
-		switch (_serverResult) {
341  
-			case CrashReportStatusAssigned:
342  
-				alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BWQuincyLocalize(@"CrashResponseTitle"), appName ]
  334
+  if (_serverResult >= CrashReportStatusAssigned && 
  335
+    _crashIdenticalCurrentVersion &&
  336
+    quincyBundle()) {
  337
+    // show some feedback to the user about the crash status
  338
+    NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
  339
+    switch (_serverResult) {
  340
+      case CrashReportStatusAssigned:
  341
+        alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BWQuincyLocalize(@"CrashResponseTitle"), appName ]
343 342
                                                message: [NSString stringWithFormat:BWQuincyLocalize(@"CrashResponseNextRelease"), appName]
344 343
                                               delegate: self
345 344
                                      cancelButtonTitle: BWQuincyLocalize(@"CrashResponseTitleOK")
346 345
                                      otherButtonTitles: nil];
347  
-				break;
348  
-			case CrashReportStatusSubmitted:
349  
-				alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BWQuincyLocalize(@"CrashResponseTitle"), appName ]
  346
+        break;
  347
+      case CrashReportStatusSubmitted:
  348
+        alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BWQuincyLocalize(@"CrashResponseTitle"), appName ]
350 349
                                                message: [NSString stringWithFormat:BWQuincyLocalize(@"CrashResponseWaitingApple"), appName]
351 350
                                               delegate: self
352 351
                                      cancelButtonTitle: BWQuincyLocalize(@"CrashResponseTitleOK")
353 352
                                      otherButtonTitles: nil];
354  
-				break;
355  
-			case CrashReportStatusAvailable:
356  
-				alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BWQuincyLocalize(@"CrashResponseTitle"), appName ]
  353
+        break;
  354
+      case CrashReportStatusAvailable:
  355
+        alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BWQuincyLocalize(@"CrashResponseTitle"), appName ]
357 356
                                                message: [NSString stringWithFormat:BWQuincyLocalize(@"CrashResponseAvailable"), appName]
358 357
                                               delegate: self
359 358
                                      cancelButtonTitle: BWQuincyLocalize(@"CrashResponseTitleOK")
360 359
                                      otherButtonTitles: nil];
361  
-				break;
362  
-			default:
363  
-				alertView = nil;
364  
-				break;
365  
-		}
  360
+        break;
  361
+      default:
  362
+        alertView = nil;
  363
+        break;
  364
+    }
366 365
 		
367  
-		if (alertView) {
368  
-			[alertView setTag: QuincyKitAlertTypeFeedback];
369  
-			[alertView show];
370  
-			[alertView release];
371  
-		}
372  
-	}
  366
+    if (alertView) {
  367
+      [alertView setTag: QuincyKitAlertTypeFeedback];
  368
+      [alertView show];
  369
+      [alertView release];
  370
+    }
  371
+  }
373 372
 }
374 373
 
375 374
 
@@ -410,40 +409,40 @@ - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)
410 409
 #pragma mark NSXMLParser
411 410
 
412 411
 - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict {
413  
-	if (qName) {
414  
-		elementName = qName;
415  
-	}
  412
+  if (qName) {
  413
+    elementName = qName;
  414
+  }
416 415
 	
417  
-	if ([elementName isEqualToString:@"result"]) {
418  
-		_contentOfProperty = [NSMutableString string];
  416
+  if ([elementName isEqualToString:@"result"]) {
  417
+    _contentOfProperty = [NSMutableString string];
419 418
   }
420 419
 }
421 420
 
422 421
 - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
423  
-	if (qName) {
424  
-		elementName = qName;
425  
-	}
  422
+  if (qName) {
  423
+    elementName = qName;
  424
+  }
426 425
 	
427 426
   // open source implementation
428  
-	if ([elementName isEqualToString: @"result"]) {
429  
-		if ([_contentOfProperty intValue] > _serverResult) {
430  
-			_serverResult = (CrashReportStatus)[_contentOfProperty intValue];
431  
-		} else {
  427
+  if ([elementName isEqualToString: @"result"]) {
  428
+    if ([_contentOfProperty intValue] > _serverResult) {
  429
+      _serverResult = (CrashReportStatus)[_contentOfProperty intValue];
  430
+    } else {
432 431
       CrashReportStatus errorcode = (CrashReportStatus)[_contentOfProperty intValue];
433  
-			NSLog(@"CrashReporter ended in error code: %i", errorcode);
434  
-		}
435  
-	}
  432
+      NSLog(@"CrashReporter ended in error code: %i", errorcode);
  433
+    }
  434
+  }
436 435
 }
437 436
 
438 437
 
439 438
 - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
440  
-	if (_contentOfProperty) {
441  
-		// If the current element is one whose content we care about, append 'string'
442  
-		// to the property that holds the content of the current element.
443  
-		if (string != nil) {
444  
-			[_contentOfProperty appendString:string];
445  
-		}
446  
-	}
  439
+  if (_contentOfProperty) {
  440
+    // If the current element is one whose content we care about, append 'string'
  441
+    // to the property that holds the content of the current element.
  442
+    if (string != nil) {
  443
+      [_contentOfProperty appendString:string];
  444
+    }
  445
+  }
447 446
 }
448 447
 
449 448
 #pragma mark -
@@ -451,13 +450,13 @@ - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
451 450
 
452 451
 
453 452
 - (NSString *)_getDevicePlatform {
454  
-	size_t size = 0;
455  
-	sysctlbyname("hw.machine", NULL, &size, NULL, 0);
456  
-	char *answer = (char*)malloc(size);
457  
-	sysctlbyname("hw.machine", answer, &size, NULL, 0);
458  
-	NSString *platform = [NSString stringWithCString:answer encoding: NSUTF8StringEncoding];
459  
-	free(answer);
460  
-	return platform;
  453
+  size_t size = 0;
  454
+  sysctlbyname("hw.machine", NULL, &size, NULL, 0);
  455
+  char *answer = (char*)malloc(size);
  456
+  sysctlbyname("hw.machine", answer, &size, NULL, 0);
  457
+  NSString *platform = [NSString stringWithCString:answer encoding: NSUTF8StringEncoding];
  458
+  free(answer);
  459
+  return platform;
461 460
 }
462 461
 
463 462
 - (NSString *)deviceIdentifier {
@@ -473,52 +472,52 @@ - (void)_performSendingCrashReports {
473 472
   NSMutableDictionary *approvedCrashReports = [NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults] dictionaryForKey: kApprovedCrashReports]];
474 473
   
475 474
   NSFileManager *fm = [NSFileManager defaultManager];
476  
-	NSError *error = NULL;
  475
+  NSError *error = NULL;
477 476
 	
478  
-	NSString *userid = @"";
479  
-	NSString *contact = @"";
480  
-	NSString *description = @"";
  477
+  NSString *userid = @"";
  478
+  NSString *contact = @"";
  479
+  NSString *description = @"";
481 480
   
482 481
   if (self.autoSubmitDeviceUDID && [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]) {
483 482
     userid = [self deviceIdentifier];
484 483
   } else if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReportUserID)]) {
485  
-		userid = [self.delegate crashReportUserID] ?: @"";
486  
-	}
  484
+    userid = [self.delegate crashReportUserID] ?: @"";
  485
+  }
487 486
 	
488  
-	if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReportContact)]) {
489  
-		contact = [self.delegate crashReportContact] ?: @"";
490  
-	}
  487
+  if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReportContact)]) {
  488
+    contact = [self.delegate crashReportContact] ?: @"";
  489
+  }
491 490
 	
492  
-	if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReportDescription)]) {
493  
-		description = [self.delegate crashReportDescription] ?: @"";
494  
-	}
  491
+  if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReportDescription)]) {
  492
+    description = [self.delegate crashReportDescription] ?: @"";
  493
+  }
495 494
 	
496 495
   NSMutableString *crashes = nil;
497 496
   _crashIdenticalCurrentVersion = NO;
498 497
   
499  
-	for (NSUInteger i=0; i < [_crashFiles count]; i++) {
500  
-		NSString *filename = [_crashesDir stringByAppendingPathComponent:[_crashFiles objectAtIndex:i]];
501  
-		NSData *crashData = [NSData dataWithContentsOfFile:filename];
  498
+  for (NSUInteger i=0; i < [_crashFiles count]; i++) {
  499
+    NSString *filename = [_crashesDir stringByAppendingPathComponent:[_crashFiles objectAtIndex:i]];
  500
+    NSData *crashData = [NSData dataWithContentsOfFile:filename];
502 501
 		
503  
-		if ([crashData length] > 0) {
504  
-			PLCrashReport *report = [[[PLCrashReport alloc] initWithData:crashData error:&error] autorelease];
  502
+    if ([crashData length] > 0) {
  503
+      PLCrashReport *report = [[[PLCrashReport alloc] initWithData:crashData error:&error] autorelease];
505 504
 			
506 505
       if (report == nil) {
507 506
         NSLog(@"Could not parse crash report");
508 507
         continue;
509 508
       }
510 509
       
511  
-			NSString *crashLogString = [PLCrashReportTextFormatter stringValueForCrashReport:report withTextFormat:PLCrashReportTextFormatiOS];
  510
+      NSString *crashLogString = [PLCrashReportTextFormatter stringValueForCrashReport:report withTextFormat:PLCrashReportTextFormatiOS];
512 511
       
513  
-			if ([report.applicationInfo.applicationVersion compare:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]] == NSOrderedSame) {
514  
-				_crashIdenticalCurrentVersion = YES;
515  
-			}
  512
+      if ([report.applicationInfo.applicationVersion compare:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]] == NSOrderedSame) {
  513
+        _crashIdenticalCurrentVersion = YES;
  514
+      }
516 515
 			
517 516
       if (crashes == nil) {
518 517
         crashes = [NSMutableString string];
519 518
       }
520 519
       
521  
-			[crashes appendFormat:@"<crash><applicationname>%s</applicationname><bundleidentifier>%@</bundleidentifier><systemversion>%@</systemversion><platform>%@</platform><senderversion>%@</senderversion><version>%@</version><log><![CDATA[%@]]></log><userid>%@</userid><contact>%@</contact><description><![CDATA[%@]]></description></crash>",
  520
+      [crashes appendFormat:@"<crash><applicationname>%s</applicationname><bundleidentifier>%@</bundleidentifier><systemversion>%@</systemversion><platform>%@</platform><senderversion>%@</senderversion><version>%@</version><log><![CDATA[%@]]></log><userid>%@</userid><contact>%@</contact><description><![CDATA[%@]]></description></crash>",
522 521
        [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleExecutable"] UTF8String],
523 522
        report.applicationInfo.applicationIdentifier,
524 523
        report.systemInfo.operatingSystemVersion,
@@ -528,16 +527,16 @@ - (void)_performSendingCrashReports {
528 527
        [crashLogString stringByReplacingOccurrencesOfString:@"]]>" withString:@"]]" @"]]><![CDATA[" @">" options:NSLiteralSearch range:NSMakeRange(0,crashLogString.length)],
529 528
        userid,
530 529
        contact,
531  
-			 [description stringByReplacingOccurrencesOfString:@"]]>" withString:@"]]" @"]]><![CDATA[" @">" options:NSLiteralSearch range:NSMakeRange(0,description.length)]];
  530
+       [description stringByReplacingOccurrencesOfString:@"]]>" withString:@"]]" @"]]><![CDATA[" @">" options:NSLiteralSearch range:NSMakeRange(0,description.length)]];
532 531
       
533 532
       
534 533
       // store this crash report as user approved, so if it fails it will retry automatically
535 534
       [approvedCrashReports setObject:[NSNumber numberWithBool:YES] forKey:[_crashFiles objectAtIndex:i]];
536  
-		} else {
  535
+    } else {
537 536
       // we cannot do anything with this report, so delete it
538 537
       [fm removeItemAtPath:filename error:&error];
539 538
     }
540  
-	}
  539
+  }
541 540
 	
542 541
   [[NSUserDefaults standardUserDefaults] setObject:approvedCrashReports forKey:kApprovedCrashReports];
543 542
   [[NSUserDefaults standardUserDefaults] synchronize];
@@ -572,58 +571,60 @@ - (void)_sendCrashReports {
572 571
 - (void)_checkForFeedbackStatus {
573 572
   NSMutableURLRequest *request = nil;
574 573
   
575  
-  request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@api/2/apps/%@/crashes/%@",
576  
-                                                                      self.submissionURL,
577  
-                                                                      [self.appIdentifier stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
578  
-                                                                      _feedbackRequestID
579  
-                                                                      ]
580  
-                                                 ]];
  574
+  request = [NSMutableURLRequest requestWithURL:
  575
+    [NSURL URLWithString:[NSString stringWithFormat:@"%@api/2/apps/%@/crashes/%@",
  576
+                          self.submissionURL,
  577
+                          [self.appIdentifier stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
  578
+                          _feedbackRequestID
  579
+                          ]
  580
+     ]];
581 581
   
582  
-	[request setCachePolicy: NSURLRequestReloadIgnoringLocalCacheData];
583  
-	[request setValue:@"Quincy/iOS" forHTTPHeaderField:@"User-Agent"];
  582
+  [request setCachePolicy: NSURLRequestReloadIgnoringLocalCacheData];
  583
+  [request setValue:@"Quincy/iOS" forHTTPHeaderField:@"User-Agent"];
584 584
   [request setValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"];
585  
-	[request setTimeoutInterval: 15];
586  
-	[request setHTTPMethod:@"GET"];
  585
+  [request setTimeoutInterval: 15];
  586
+  [request setHTTPMethod:@"GET"];
587 587
   
588  
-	_serverResult = CrashReportStatusUnknown;
589  
-	_statusCode = 200;
  588
+  _serverResult = CrashReportStatusUnknown;
  589
+  _statusCode = 200;
590 590
 	
591  
-	// Release when done in the delegate method
592  
-	_responseData = [[NSMutableData alloc] init];
  591
+  // Release when done in the delegate method
  592
+  _responseData = [[NSMutableData alloc] init];
593 593
 	
594  
-	if (self.delegate != nil && [self.delegate respondsToSelector:@selector(connectionOpened)]) {
595  
-		[self.delegate connectionOpened];
596  
-	}
  594
+  if (self.delegate != nil && [self.delegate respondsToSelector:@selector(connectionOpened)]) {
  595
+    [self.delegate connectionOpened];
  596
+  }
597 597
 	
598  
-	_urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];    
  598
+  _urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];    
599 599
   
600 600
   BWQuincyLog(@"Requesting feedback status.");
601 601
 }
602 602
 
603 603
 - (void)_postXML:(NSString*)xml toURL:(NSURL*)url {
604  
-	NSMutableURLRequest *request = nil;
  604
+  NSMutableURLRequest *request = nil;
605 605
   NSString *boundary = @"----FOO";
606 606
   
607 607
   if (self.appIdentifier) {
608  
-    request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@api/2/apps/%@/crashes",
609  
-                                                                        self.submissionURL,
610  
-                                                                        [self.appIdentifier stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
611  
-                                                                        ]
612  
-                                                   ]];
  608
+    request = [NSMutableURLRequest requestWithURL:
  609
+      [NSURL URLWithString:[NSString stringWithFormat:@"%@api/2/apps/%@/crashes",
  610
+                            self.submissionURL,
  611
+                            [self.appIdentifier stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
  612
+                            ]
  613
+       ]];
613 614
   } else {
614 615
     request = [NSMutableURLRequest requestWithURL:url];
615 616
   }
616 617
   
617  
-	[request setCachePolicy: NSURLRequestReloadIgnoringLocalCacheData];
618  
-	[request setValue:@"Quincy/iOS" forHTTPHeaderField:@"User-Agent"];
  618
+  [request setCachePolicy: NSURLRequestReloadIgnoringLocalCacheData];
  619
+  [request setValue:@"Quincy/iOS" forHTTPHeaderField:@"User-Agent"];
619 620
   [request setValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"];
620  
-	[request setTimeoutInterval: 15];
621  
-	[request setHTTPMethod:@"POST"];
622  
-	NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary];
623  
-	[request setValue:contentType forHTTPHeaderField:@"Content-type"];
  621
+  [request setTimeoutInterval: 15];
  622
+  [request setHTTPMethod:@"POST"];
  623
+  NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary];
  624
+  [request setValue:contentType forHTTPHeaderField:@"Content-type"];
624 625
 	
625  
-	NSMutableData *postBody =  [NSMutableData data];
626  
-	[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
  626
+  NSMutableData *postBody =  [NSMutableData data];
  627
+  [postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
627 628
   if (self.appIdentifier) {
628 629
     [postBody appendData:[@"Content-Disposition: form-data; name=\"xml\"; filename=\"crash.xml\"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
629 630
     [postBody appendData:[[NSString stringWithFormat:@"Content-Type: text/xml\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
@@ -635,17 +636,17 @@ - (void)_postXML:(NSString*)xml toURL:(NSURL*)url {
635 636
   
636 637
   [request setHTTPBody:postBody];
637 638
 	
638  
-	_serverResult = CrashReportStatusUnknown;
639  
-	_statusCode = 200;
  639
+  _serverResult = CrashReportStatusUnknown;
  640
+  _statusCode = 200;
640 641
 	
641  
-	//Release when done in the delegate method
642  
-	_responseData = [[NSMutableData alloc] init];
  642
+  //Release when done in the delegate method
  643
+  _responseData = [[NSMutableData alloc] init];
643 644
 	
644  
-	if (self.delegate != nil && [self.delegate respondsToSelector:@selector(connectionOpened)]) {
645  
-		[self.delegate connectionOpened];
646  
-	}
  645
+  if (self.delegate != nil && [self.delegate respondsToSelector:@selector(connectionOpened)]) {
  646
+    [self.delegate connectionOpened];
  647
+  }
647 648
 	
648  
-	_urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
  649
+  _urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
649 650
   
650 651
   if (!_urlConnection) {
651 652
     BWQuincyLog(@"Sending crash reports could not start!");
@@ -658,13 +659,13 @@ - (void)_postXML:(NSString*)xml toURL:(NSURL*)url {
658 659
 #pragma mark NSURLConnection Delegate
659 660
 
660 661
 - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
661  
-	if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
662  
-		_statusCode = [(NSHTTPURLResponse *)response statusCode];
663  
-	}
  662
+  if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
  663
+    _statusCode = [(NSHTTPURLResponse *)response statusCode];
  664
+  }
664 665
 }
665 666
 
666 667
 - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
667  
-	[_responseData appendData:data];
  668
+  [_responseData appendData:data];
668 669
 }
669 670
 
670 671
 - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
@@ -729,6 +730,9 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
729 730
         [self showCrashStatusMessage];
730 731
       }
731 732
     }
  733
+  } else if (_statusCode == 400 && self.appIdentifier) {
  734
+    [self _cleanCrashReports];
  735
+    BWQuincyLog(@"ERROR: The server rejected receiving crash reports for this app version!");
732 736
   } else {
733 737
     if (_responseData == nil || [_responseData length] == 0) {
734 738
       BWQuincyLog(@"ERROR: Sending failed with an empty response!");
@@ -754,15 +758,15 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
754 758
 // Called to handle a pending crash report.
755 759
 //
756 760
 - (void) handleCrashReport {
757  
-	PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter];
758  
-	NSError *error = NULL;
  761
+  PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter];
  762
+  NSError *error = NULL;
759 763
 	
760 764
   // check if the next call ran successfully the last time
761  
-	if (_analyzerStarted == 0) {
762  
-		// mark the start of the routine
763  
-		_analyzerStarted = 1;
764  
-		[[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithInt:_analyzerStarted] forKey:kQuincyKitAnalyzerStarted];
765  
-		[[NSUserDefaults standardUserDefaults] synchronize];
  765
+  if (_analyzerStarted == 0) {
  766
+    // mark the start of the routine
  767
+    _analyzerStarted = 1;
  768
+    [[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithInt:_analyzerStarted] forKey:kQuincyKitAnalyzerStarted];
  769
+    [[NSUserDefaults standardUserDefaults] synchronize];
766 770
     
767 771
     // Try loading the crash report
768 772
     _crashData = [[NSData alloc] initWithData:[crashReporter loadPendingCrashReportDataAndReturnError: &error]];
@@ -773,17 +777,17 @@ - (void) handleCrashReport {
773 777
       NSLog(@"Could not load crash report: %@", error);
774 778
     } else {
775 779
       [_crashData writeToFile:[_crashesDir stringByAppendingPathComponent: cacheFilename] atomically:YES];
776  
-		}
777  
-	}
  780
+    }
  781
+  }
778 782
 	
779  
-	// Purge the report
780  
-	// mark the end of the routine
781  
-	_analyzerStarted = 0;
782  
-	[[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithInt:_analyzerStarted] forKey:kQuincyKitAnalyzerStarted];
  783
+  // Purge the report
  784
+  // mark the end of the routine
  785
+  _analyzerStarted = 0;
  786
+  [[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithInt:_analyzerStarted] forKey:kQuincyKitAnalyzerStarted];
783 787
   [[NSUserDefaults standardUserDefaults] synchronize];
784 788
   
785  
-	[crashReporter purgePendingCrashReport];
786  
-	return;
  789
+  [crashReporter purgePendingCrashReport];
  790
+  return;
787 791
 }
788 792
 
789 793
 
BIN  client/iOS/CrashReporter.framework/Versions/A/CrashReporter
Binary file not shown
14  client/iOS/CrashReporter.framework/Versions/A/Resources/Info.plist
@@ -3,7 +3,7 @@
3 3
 <plist version="1.0">
4 4
 <dict>
5 5
 	<key>BuildMachineOSBuild</key>
6  
-	<string>10K549</string>
  6
+	<string>11D50</string>
7 7
 	<key>CFBundleDevelopmentRegion</key>
8 8
 	<string>English</string>
9 9
 	<key>CFBundleExecutable</key>
@@ -21,18 +21,18 @@
21 21
 	<key>CFBundleVersion</key>
22 22
 	<string>1.0</string>
23 23
 	<key>DTCompiler</key>
24  
-	<string></string>
  24
+	<string>com.apple.compilers.llvmgcc42</string>
25 25
 	<key>DTPlatformBuild</key>
26  
-	<string>4A2002a</string>
  26
+	<string>4D502</string>
27 27
 	<key>DTPlatformVersion</key>
28 28
 	<string>GM</string>
29 29
 	<key>DTSDKBuild</key>
30  
-	<string>4A2002a</string>
  30
+	<string>11C63</string>
31 31
 	<key>DTSDKName</key>
32  
-	<string>macosx10.6</string>
  32
+	<string>macosx10.7</string>
33 33
 	<key>DTXcode</key>
34  
-	<string>0402</string>
  34
+	<string>0421</string>
35 35
 	<key>DTXcodeBuild</key>
36  
-	<string>4A2002a</string>
  36
+	<string>4D502</string>
37 37
 </dict>
38 38
 </plist>
10  client/iOS/QuincyLib/QuincyLib.xcodeproj/project.pbxproj
@@ -142,7 +142,10 @@
142 142
 			isa = XCBuildConfiguration;
143 143
 			buildSettings = {
144 144
 				ALWAYS_SEARCH_USER_PATHS = NO;
145  
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
  145
+				ARCHS = (
  146
+					armv7,
  147
+					armv6,
  148
+				);
146 149
 				COPY_PHASE_STRIP = NO;
147 150
 				GCC_C_LANGUAGE_STANDARD = gnu99;
148 151
 				GCC_DYNAMIC_NO_PIC = NO;
@@ -166,7 +169,10 @@
166 169
 			isa = XCBuildConfiguration;
167 170
 			buildSettings = {
168 171
 				ALWAYS_SEARCH_USER_PATHS = NO;
169  
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
  172
+				ARCHS = (
  173
+					armv7,
  174
+					armv6,
  175
+				);
170 176
 				COPY_PHASE_STRIP = YES;
171 177
 				GCC_C_LANGUAGE_STANDARD = gnu99;
172 178
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
12  demo/iOS/QuincyDemo.xcodeproj/project.pbxproj
@@ -223,6 +223,10 @@
223 223
 			isa = XCBuildConfiguration;
224 224
 			buildSettings = {
225 225
 				ALWAYS_SEARCH_USER_PATHS = NO;
  226
+				ARCHS = (
  227
+					armv6,
  228
+					armv7,
  229
+				);
226 230
 				COPY_PHASE_STRIP = NO;
227 231
 				FRAMEWORK_SEARCH_PATHS = (
228 232
 					"$(inherited)",
@@ -236,7 +240,7 @@
236 240
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
237 241
 				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
238 242
 				INFOPLIST_FILE = Info.plist;
239  
-				IPHONEOS_DEPLOYMENT_TARGET = 4.3;
  243
+				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
240 244
 				PRODUCT_NAME = QuincyDemo;
241 245
 				TARGETED_DEVICE_FAMILY = "1,2";
242 246
 			};
@@ -246,6 +250,10 @@
246 250
 			isa = XCBuildConfiguration;
247 251
 			buildSettings = {
248 252
 				ALWAYS_SEARCH_USER_PATHS = NO;
  253
+				ARCHS = (
  254
+					armv6,
  255
+					armv7,
  256
+				);
249 257
 				COPY_PHASE_STRIP = YES;
250 258
 				FRAMEWORK_SEARCH_PATHS = (
251 259
 					"$(inherited)",
@@ -257,7 +265,7 @@
257 265
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
258 266
 				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
259 267
 				INFOPLIST_FILE = Info.plist;
260  
-				IPHONEOS_DEPLOYMENT_TARGET = 4.3;
  268
+				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
261 269
 				PRODUCT_NAME = QuincyDemo;
262 270
 				TARGETED_DEVICE_FAMILY = "1,2";
263 271
 			};

0 notes on commit 17ac193

Please sign in to comment.
Something went wrong with that request. Please try again.