
ObjectiveC
#include "XXXRootListController.h"
#import <spawn.h>
@implementation XXXRootListController
- (NSArray *)specifiers {
if (!_specifiers) {
_specifiers = [[self loadSpecifiersFromPlistName:@"Root" target:self] retain];
}
return _specifiers;
}
-(void)credits {
UIAlertView *alert1 = [[UIAlertView alloc]initWithTitle:@"Credits" message:@"Test by Rowl" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert1 show];
}
- (void)resp
{
pid_t pid;
int status;
const char* args[] = {"killall", "-9", "backboardd", NULL};
posix_spawn(&pid, "/usr/bin/killall", NULL, NULL, (char* const*)args, NULL);
waitpid(pid, &status, WEXITED);
}
- (void)twitter {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://twitter.com/Rowl_JB"]];
}
@synthesize respringButton;
- (instancetype)init {
self = [super init];
if (self) {
HBAppearanceSettings *appearanceSettings = [[HBAppearanceSettings alloc] init];
appearanceSettings.tintColor = [UIColor colorWithRed:0.1f green:0.1f blue:0.1f alpha:1];
appearanceSettings.tableViewCellSeparatorColor = [UIColor colorWithWhite:0 alpha:0];
self.hb_appearanceSettings = appearanceSettings;
self.respringButton = [[UIBarButtonItem alloc] initWithTitle:@"Respring"
style:UIBarButtonItemStylePlain
target:self
action:@selector(respring:)];
self.respringButton.tintColor = [UIColor redColor];
self.navigationItem.rightBarButtonItem = self.respringButton;
}
return self;
}
- (void)respring:(id)sender {
NSTask *t = [[[NSTask alloc] init] autorelease];
[t setLaunchPath:@"/usr/bin/killall"];
[t setArguments:[NSArray arrayWithObjects:@"backboardd", nil]];
[t launch];
}
@end