From: Jay Freeman (saurik) Date: Tue, 8 Mar 2011 07:40:48 +0000 (-0800) Subject: Automatically attach cydia.log and `dpkg -l`. X-Git-Tag: v1.1.0%b1~12 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/22485d93d47fb92ef04faca680a1f50e7df41edf?hp=d9fc1d3713a7d40d51ffd8db08b7045fa5a263d1 Automatically attach cydia.log and `dpkg -l`. --- diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index 4bd05b95..61786da9 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -281,6 +281,9 @@ float CYScrollViewDecelerationRateNormal; [self dismissModalViewControllerAnimated:YES]; } +- (void) _setupMail:(MFMailComposeViewController *)controller { +} + - (void) _openMailToURL:(NSURL *)url { if ($MFMailComposeViewController != nil && [$MFMailComposeViewController canSendMail]) { MFMailComposeViewController *controller([[[$MFMailComposeViewController alloc] init] autorelease]); @@ -288,6 +291,8 @@ float CYScrollViewDecelerationRateNormal; [controller setMailToURL:url]; + [self _setupMail:controller]; + [self presentModalViewController:controller animated:YES]; return; } diff --git a/MobileCydia.mm b/MobileCydia.mm index 164d2493..61ffac3f 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4238,6 +4238,13 @@ static _H Diversions_; [window setValue:cydia_ forKey:@"cydia"]; } +- (void) _setupMail:(MFMailComposeViewController *)controller { + [controller addAttachmentData:[NSData dataWithContentsOfFile:@"/tmp/cydia.log"] mimeType:@"text/plain" fileName:@"cydia.log"]; + + system("/usr/bin/dpkg -l >/tmp/dpkgl.log"); + [controller addAttachmentData:[NSData dataWithContentsOfFile:@"/tmp/dpkgl.log"] mimeType:@"text/plain" fileName:@"dpkgl.log"]; +} + - (NSURL *) URLWithURL:(NSURL *)url { return [Diversion divertURL:url]; }