-
Notifications
You must be signed in to change notification settings - Fork 36
/
Settings.xm
36 lines (33 loc) · 1.4 KB
/
Settings.xm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#import "Settings.h"
extern "C" NSUserDefaults *tweakDefaults;
%hook _TtC6Twitch25AppSettingsViewController
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == [self tableView:tableView numberOfRowsInSection:indexPath.section] - 1)
return [self.navigationController
pushViewController:
[[objc_getClass("TWAdBlockSettingsViewController") alloc]
initWithTableViewStyle:2
themeManager:[objc_getClass("_TtC12TwitchCoreUI21TWDefaultThemeManager")
defaultThemeManager]]
animated:YES];
%orig;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return %orig + 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == [self tableView:tableView numberOfRowsInSection:indexPath.section] - 1) {
_TtC6Twitch22SettingsDisclosureCell *cell =
[[objc_getClass("_TtC6Twitch22SettingsDisclosureCell") alloc]
initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:@"Twitch.SettingsDisclosureCell"];
cell.textLabel.text = @"TwitchAdBlock";
return cell;
}
return %orig;
}
%end
%ctor {
if (![NSProcessInfo.processInfo.processName isEqualToString:@"mediaserverd"]) %init;
}