Advertisement
Guest User

EasySpring.mm

a guest
Sep 13th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #import <Preferences/Preferences.h>
  2.  
  3. @interface EasySpringListController: PSListController {
  4. }
  5. @end
  6.  
  7. @implementation EasySpringListController
  8.  
  9. - (void)alertView:(UIAlertView *)alertView
  10.                    clickedButtonAtIndex:(NSInteger)buttonIndex
  11. {
  12.     if (buttonIndex == 0)
  13.     {
  14.       //Do nothing  
  15.     }
  16.     else if (buttonIndex == 1 && alertView.tag == 1)
  17.     {
  18.       system("killall -9 SpringBoard");
  19.     }
  20.     else if (buttonIndex == 1 && alertView.tag == 2)
  21.     {
  22.       system("reboot");
  23.     }
  24.     else if (buttonIndex == 1 && alertView.tag == 3)
  25.     {
  26.       system("killall -SEGV SpringBoard");
  27.     }
  28.     else if (buttonIndex == 1 && alertView.tag == 4)
  29.     {
  30.       system("uicache");
  31.       system("killall -9 SpringBoard");
  32.     }
  33. }
  34.  
  35. - (void)respringDevice
  36. {
  37.     UIAlertView *respringAlert = [[UIAlertView alloc] initWithTitle:@"EasySpring Alert"
  38.     message:@"Would you like to Respring your device?"
  39.     delegate:self
  40.     cancelButtonTitle:@"Cancel"
  41.     otherButtonTitles:@"Respring", nil];
  42.     //respringAlert.tag = 1;
  43.     [respringAlert show];
  44. }
  45.  
  46. - (void)rebootDevice
  47. {
  48.     UIAlertView *rebootAlert = [[UIAlertView alloc] initWithTitle:@"EasySpring Alert"
  49.     message:@"Would you like to Reboot your device?"
  50.     delegate:self
  51.     cancelButtonTitle:@"Cancel"
  52.     otherButtonTitles:@"Reboot", nil];
  53.     //rebootAlert.tag = 2;
  54.     [rebootAlert show];
  55. }
  56.  
  57. - (void)safeMode
  58. {
  59.     UIAlertView *safeAlert = [[UIAlertView alloc] initWithTitle:@"EasySpring Alert"
  60.     message:@"Would you like to enter safemode?"
  61.     delegate:self
  62.     cancelButtonTitle:@"Cancel"
  63.     otherButtonTitles:@"Enter SafeMode", nil];
  64.     //safeAlert.tag = 3;
  65.     [safeAlert show];
  66. }
  67.  
  68. - (void)clearCache
  69. {
  70.     UIAlertView *cacheAlert = [[UIAlertView alloc] initWithTitle:@"EasySpring Alert"
  71.     message:@"Would you like to clear UICache?"
  72.     delegate:self
  73.     cancelButtonTitle:@"Cancel"
  74.     otherButtonTitles:@"Clear UICache", nil];
  75.     //cacheAlert.tag = 4;
  76.     [cacheAlert show];
  77. }
  78.  
  79. - (void)twitterNav
  80. {
  81.         [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.twitter.com/ioschrisharris"]];
  82. }
  83.  
  84. - (void)paypalNav
  85. {
  86.         [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VU58K2NHRLK22"]];
  87. }
  88.  
  89. - (void)redditNav
  90. {
  91.         [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.reddit.com/u/rob311"]];
  92. }
  93.  
  94. - (void)redditNavTwo
  95. {
  96.         [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.reddit.com/u/jontelang"]];
  97. }
  98.  
  99.  
  100. - (id)specifiers {
  101.         if(_specifiers == nil) {
  102.                 _specifiers = [[self loadSpecifiersFromPlistName:@"EasySpring" target:self] retain];
  103.         }
  104.         return _specifiers;
  105. }
  106. @end
  107.  
  108. // vim:ft=objc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement