Add anonID to crash reports

CrashReporter Key is actually an anonymous ID for each device/installation where the crash occurred
This commit is contained in:
Andreas Linde 2012-11-27 02:37:37 +01:00
parent 2c4dc33f36
commit f211182f49
3 changed files with 10 additions and 6 deletions

View File

@ -566,7 +566,8 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
if ([report respondsToSelector:@selector(reportInfo)]) { if ([report respondsToSelector:@selector(reportInfo)]) {
crashUUID = report.reportInfo.reportGUID ?: @""; 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) { if ([report.applicationInfo.applicationVersion compare:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]] == NSOrderedSame) {
_crashIdenticalCurrentVersion = YES; _crashIdenticalCurrentVersion = YES;
@ -581,7 +582,6 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
NSString *userid = @""; NSString *userid = @"";
NSString *applicationLog = @""; NSString *applicationLog = @"";
NSString *description = @""; NSString *description = @"";
NSString *installString = bit_appAnonID() ?: @"";
NSString *errorString = nil; NSString *errorString = nil;
NSPropertyListFormat format; NSPropertyListFormat format;

View File

@ -47,7 +47,7 @@
@interface BITCrashReportTextFormatter : NSObject { @interface BITCrashReportTextFormatter : NSObject {
} }
+ (NSString *)stringValueForCrashReport:(PLCrashReport *)report; + (NSString *)stringValueForCrashReport:(PLCrashReport *)report crashReporterKey:(NSString *)crashReporterKey;
+ (NSArray *)arrayOfAppUUIDsForCrashReport:(PLCrashReport *)report; + (NSArray *)arrayOfAppUUIDsForCrashReport:(PLCrashReport *)report;
@end @end

View File

@ -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. * @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]; NSMutableString* text = [NSMutableString string];
boolean_t lp64 = true; // quiesce GCC uninitialized value warning 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) if (report.hasReportInfo && report.reportInfo.reportGUID != nil)
reportGUID = report.reportInfo.reportGUID; reportGUID = report.reportInfo.reportGUID;
} }
NSString *reporterKey = @"[TODO]";
if (crashReporterKey)
reporterKey = crashReporterKey;
NSString *hardwareModel = @"???"; NSString *hardwareModel = @"???";
if (report.hasMachineInfo && report.machineInfo.modelName != nil) if (report.hasMachineInfo && report.machineInfo.modelName != nil)
hardwareModel = report.machineInfo.modelName; hardwareModel = report.machineInfo.modelName;
[text appendFormat: @"Incident Identifier: %@\n", reportGUID]; [text appendFormat: @"Incident Identifier: %@\n", reportGUID];
[text appendFormat: @"CrashReporter Key: [TODO]\n"]; [text appendFormat: @"CrashReporter Key: %@\n", reporterKey];
[text appendFormat: @"Hardware Model: %@\n", hardwareModel]; [text appendFormat: @"Hardware Model: %@\n", hardwareModel];
} }