diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index 14d235141a..ff351ff53e 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -566,7 +566,8 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus"; if ([report respondsToSelector:@selector(reportInfo)]) { crashUUID = report.reportInfo.reportGUID ?: @""; } - NSString *crashLogString = [BITCrashReportTextFormatter stringValueForCrashReport:report]; + NSString *installString = bit_appAnonID() ?: @""; + NSString *crashLogString = [BITCrashReportTextFormatter stringValueForCrashReport:report crashReporterKey:installString]; if ([report.applicationInfo.applicationVersion compare:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]] == NSOrderedSame) { _crashIdenticalCurrentVersion = YES; @@ -581,7 +582,6 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus"; NSString *userid = @""; NSString *applicationLog = @""; NSString *description = @""; - NSString *installString = bit_appAnonID() ?: @""; NSString *errorString = nil; NSPropertyListFormat format; diff --git a/Classes/BITCrashReportTextFormatter.h b/Classes/BITCrashReportTextFormatter.h index ebaf38bb47..4ff2743cd8 100644 --- a/Classes/BITCrashReportTextFormatter.h +++ b/Classes/BITCrashReportTextFormatter.h @@ -47,7 +47,7 @@ @interface BITCrashReportTextFormatter : NSObject { } -+ (NSString *)stringValueForCrashReport:(PLCrashReport *)report; ++ (NSString *)stringValueForCrashReport:(PLCrashReport *)report crashReporterKey:(NSString *)crashReporterKey; + (NSArray *)arrayOfAppUUIDsForCrashReport:(PLCrashReport *)report; @end diff --git a/Classes/BITCrashReportTextFormatter.m b/Classes/BITCrashReportTextFormatter.m index fa41655329..bf86d2fa09 100644 --- a/Classes/BITCrashReportTextFormatter.m +++ b/Classes/BITCrashReportTextFormatter.m @@ -76,7 +76,7 @@ static NSInteger binaryImageSort(id binary1, id binary2, void *context) { * * @return Returns the formatted result on success, or nil if an error occurs. */ -+ (NSString *)stringValueForCrashReport:(PLCrashReport *)report { ++ (NSString *)stringValueForCrashReport:(PLCrashReport *)report crashReporterKey:(NSString *)crashReporterKey { NSMutableString* text = [NSMutableString string]; boolean_t lp64 = true; // quiesce GCC uninitialized value warning @@ -178,13 +178,17 @@ static NSInteger binaryImageSort(id binary1, id binary2, void *context) { if (report.hasReportInfo && report.reportInfo.reportGUID != nil) reportGUID = report.reportInfo.reportGUID; } - + + NSString *reporterKey = @"[TODO]"; + if (crashReporterKey) + reporterKey = crashReporterKey; + NSString *hardwareModel = @"???"; if (report.hasMachineInfo && report.machineInfo.modelName != nil) hardwareModel = report.machineInfo.modelName; [text appendFormat: @"Incident Identifier: %@\n", reportGUID]; - [text appendFormat: @"CrashReporter Key: [TODO]\n"]; + [text appendFormat: @"CrashReporter Key: %@\n", reporterKey]; [text appendFormat: @"Hardware Model: %@\n", hardwareModel]; }