11 #import <SymptomDiagnosticReporter/SDRDiagnosticReporter.h>
14 void SecABCTrigger(CFStringRef type,
16 CFStringRef subtypeContext,
17 CFDictionaryRef payload)
19 [SecABC triggerAutoBugCaptureWithType:(__bridge NSString *)type
20 subType:(__bridge NSString *)subtype
21 subtypeContext:(__bridge NSString *)subtypeContext
23 payload:(__bridge NSDictionary *)payload
28 @implementation SecABC
30 + (void)triggerAutoBugCaptureWithType:(NSString *)type
31 subType:(NSString *)subType
32 subtypeContext:(NSString *)subtypeContext
33 events:(NSArray *)events
34 payload:(NSDictionary *)payload
35 detectedProcess:(NSString *)process
38 os_log(OS_LOG_DEFAULT, "TriggerABC for %{public}@/%{public}@/%{public}@",
39 type, subType, subtypeContext);
42 if ([SDRDiagnosticReporter class] == nil) {
46 SDRDiagnosticReporter *diagnosticReporter = [[SDRDiagnosticReporter alloc] init];
47 NSMutableDictionary *signature = [diagnosticReporter signatureWithDomain:@"com.apple.security.keychain"
50 subtypeContext:subtypeContext
51 detectedProcess:process?:[[NSProcessInfo processInfo] processName]
52 triggerThresholdValues:nil];
53 if (signature == NULL) {
54 os_log(OS_LOG_DEFAULT, "TriggerABC signature generation failed");
58 (void)[diagnosticReporter snapshotWithSignature:signature
63 reply:^void(NSDictionary *response)
65 os_log(OS_LOG_DEFAULT, "Received response from Diagnostic Reporter - %{public}@/%{public}@/%{public}@: %{public}@",
66 type, subType, subtypeContext, response);