11#import " FGARootListController.h"
22
3+ #import < Preferences/PSSpecifier.h>
4+
35#import < roothide.h>
46#import < spawn.h>
57
@@ -9,41 +11,61 @@ - (NSArray *)specifiers {
911 if (!_specifiers) {
1012 _specifiers = [self loadSpecifiersFromPlistName: @" Root" target: self ];
1113 }
12-
14+
1315 return _specifiers;
1416}
1517
1618- (void )respring {
1719 pid_t pid;
18- const char * args[] = {" killall" , " -9" , " SpringBoard" , " backboardd" , NULL };
19- posix_spawn (&pid, jbroot (" /usr/bin/killall" ), NULL , NULL , (char * const *)args, NULL );
20+ const char * args[] = {" killall" , " -9" , " SpringBoard" , " backboardd" , NULL };
21+ posix_spawn (&pid, jbroot (" /usr/bin/killall" ), NULL , NULL , (char * const *)args, NULL );
2022}
2123
2224- (void )twitter {
2325 UIApplication *app = [UIApplication sharedApplication ];
2426 if ([app canOpenURL: [NSURL URLWithString: @" twitter://fga" ]]) {
25- [app openURL: [NSURL URLWithString: @" twitter://user?screen_name=fga" ] options: @{} completionHandler: nil ];
27+ [app openURL: [NSURL URLWithString: @" twitter://user?screen_name=fga" ] options: @{} completionHandler: nil ];
2628 } else if ([app canOpenURL: [NSURL URLWithString: @" tweetbot://fga/user_profile/fga" ]]) {
27- [app openURL: [NSURL URLWithString: @" tweetbot://fga/user_profile/fga" ] options: @{} completionHandler: nil ];
29+ [app openURL: [NSURL URLWithString: @" tweetbot://fga/user_profile/fga" ] options: @{} completionHandler: nil ];
2830 } else if ([app canOpenURL: [NSURL URLWithString: @" https://twitter.com/fga" ]]) {
29- [app openURL: [NSURL URLWithString: @" https://twitter.com/fga" ] options: @{} completionHandler: nil ];
31+ [app openURL: [NSURL URLWithString: @" https://twitter.com/fga" ] options: @{} completionHandler: nil ];
3032 }
3133}
3234
3335- (void )github {
34- [self openURL: [NSURL URLWithString: @" https://github.com/finngaida" ]];
36+ [self openURL: [NSURL URLWithString: @" https://github.com/finngaida" ]];
3537}
3638
3739- (void )mail {
38- [self openURL: [NSURL URLWithString: @" mailto:f@fga.pw?subject=DayNightSwitch%20F eature%20Request" ]];
40+ [self openURL: [NSURL URLWithString: @" mailto:f@fga.pw?subject=DayNightSwitch%20F eature%20Request" ]];
3941}
4042
4143- (void )paypal {
42- [self openURL: [NSURL URLWithString: @" https://paypal.me/fga" ]];
44+ [self openURL: [NSURL URLWithString: @" https://paypal.me/fga" ]];
45+ }
46+
47+ - (void )support {
48+ [self openURL: [NSURL URLWithString: @" https://havoc.app/search/82Flex" ]];
4349}
4450
45- -(void )openURL : (NSURL *)url {
46- [[UIApplication sharedApplication ] openURL: url options: @{} completionHandler: nil ];
51+ - (void )openURL : (NSURL *)url {
52+ [[UIApplication sharedApplication ] openURL: url options: @{} completionHandler: nil ];
53+ }
54+
55+ - (UITableViewCell *)tableView : (UITableView *)tableView cellForRowAtIndexPath : (NSIndexPath *)indexPath {
56+ if (indexPath.section == 0 ) {
57+ PSSpecifier *specifier = [self specifierAtIndexPath: indexPath];
58+ NSString *key = [specifier propertyForKey: @" cell" ];
59+ if ([key isEqualToString: @" PSButtonCell" ]) {
60+ UITableViewCell *cell = [super tableView: tableView cellForRowAtIndexPath: indexPath];
61+ NSNumber *isDestructiveValue = [specifier propertyForKey: @" isDestructive" ];
62+ BOOL isDestructive = [isDestructiveValue boolValue ];
63+ cell.textLabel .textColor = isDestructive ? [UIColor systemRedColor ] : [UIColor systemBlueColor ];
64+ cell.textLabel .highlightedTextColor = isDestructive ? [UIColor systemRedColor ] : [UIColor systemBlueColor ];
65+ return cell;
66+ }
67+ }
68+ return [super tableView: tableView cellForRowAtIndexPath: indexPath];
4769}
4870
4971@end
0 commit comments