Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron25mt committed Jul 7, 2015
1 parent 8206bf1 commit f476f83
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 0 deletions.
1 change: 1 addition & 0 deletions DeleteAllMessages8.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ Filter = { Bundles = ( "com.apple.springboard", "com.apple.MobileSMS" ); }; }
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
include theos/makefiles/common.mk

TWEAK_NAME = DeleteAllMessages8
DeleteAllMessages8_FILES = Tweak.xm
DeleteAllMessages8_FRAMEWORKS = UIKit CoreGraphics Foundation ChatKit
DeleteAllMessages8_PRIVATE_FRAMEWORKS = ChatKit

export ARCHS = armv7 arm64

include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
install.exec "killall -9 SpringBoard"
38 changes: 38 additions & 0 deletions Tweak.xm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#import <ChatKit/ChatKit.h>

%hook CKConversationListController
-(void)setEditing:(BOOL)arg1 animated:(BOOL)arg2 {
%orig;
if(arg1) {
UIBarButtonItem* deleteAll = [[UIBarButtonItem alloc] initWithTitle:@"Delete All" style:UIBarButtonItemStyleDone target:self action:@selector(alert:)];
self.navigationItem.rightBarButtonItem = deleteAll;
[deleteAll release];
} else {
UIBarButtonItem* compose = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:self action:@selector(composeButtonClicked:)];
self.navigationItem.rightBarButtonItem = compose;
[compose release];
}
}

%new
-(void)alert:(id)sender {
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Are you sure?" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Yes", nil];
[alert show];
[alert release];
}

%new
-(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
if(buttonIndex == 1) {
CKConversationList* list = MSHookIvar<CKConversationList*>(self, "_conversationList");
UITableView* messages = MSHookIvar<UITableView*>(self, "_table");
NSUInteger msgCount = [(NSArray*)[list conversations] count];
while(msgCount > 0) {
[list deleteConversation:[list conversations][0]];
msgCount--;
}
[messages reloadData];
}
[self setEditing:NO animated:NO];
}
%end
Binary file added com.robottom.deleteallmessages8.deb
Binary file not shown.
9 changes: 9 additions & 0 deletions control
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: com.robottom.deleteallmessages8
Name: DeleteAllMessages8
Depends: firmware (>= 8.0), mobilesubstrate
Version: 1.0
Architecture: iphoneos-arm
Description: Delete all messages in Messages.app with the press of a button!
Maintainer: Aaron Thomas <[email protected]>
Author: Aaron Thomas <[email protected]>
Section: Tweaks

0 comments on commit f476f83

Please sign in to comment.