]> git.saurik.com Git - cydia.git/commitdiff
Automatically attach cydia.log and `dpkg -l`.
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 8 Mar 2011 07:40:48 +0000 (23:40 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Tue, 8 Mar 2011 09:51:00 +0000 (01:51 -0800)
CyteKit/WebViewController.mm
MobileCydia.mm

index 4bd05b950cc4ad9e3620400b402db915ea7b15b9..61786da995512f1d97c1f2c47c144c65f0a7f91c 100644 (file)
@@ -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;
     }
index 164d24932d8f618b3e5309e7dd693095f26fe159..61ffac3f5d8e097b6d89990982b18ce1a1336300 100644 (file)
@@ -4238,6 +4238,13 @@ static _H<NSMutableSet> 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];
 }