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
33 [self triggerAutoBugCaptureWithType: type
38 detectedProcess: nil];
42 + (void)triggerAutoBugCaptureWithType:(NSString *)type
43 subType:(NSString *)subType
44 subtypeContext:(NSString *)subtypeContext
45 events:(NSArray *)events
46 payload:(NSDictionary *)payload
47 detectedProcess:(NSString *)process
50 os_log(OS_LOG_DEFAULT, "TriggerABC for %{public}@/%{public}@/%{public}@",
51 type, subType, subtypeContext);
54 if ([SDRDiagnosticReporter class] == nil) {
58 SDRDiagnosticReporter *diagnosticReporter = [[SDRDiagnosticReporter alloc] init];
59 NSMutableDictionary *signature = [diagnosticReporter signatureWithDomain:@"com.apple.security.keychain"
62 subtypeContext:subtypeContext
63 detectedProcess:process?:[[NSProcessInfo processInfo] processName]
64 triggerThresholdValues:nil];
65 if (signature == NULL) {
66 os_log(OS_LOG_DEFAULT, "TriggerABC signature generation failed");
70 (void)[diagnosticReporter snapshotWithSignature:signature
75 reply:^void(NSDictionary *response)
77 os_log(OS_LOG_DEFAULT, "Received response from Diagnostic Reporter - %{public}@/%{public}@/%{public}@: %{public}@",
78 type, subType, subtypeContext, response);