forked from piercingimpulse/verduraiOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tweak.xm
52 lines (38 loc) · 1.5 KB
/
Tweak.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <UIKit/NSString+UIKitAdditions.h>
#import <UIKit/UIWebView.h>
#import <dlfcn.h>
#import "Tweak.h"
#import <Cephei/HBPreferences.h>
HBPreferences *preferences;
%group gSearchNewWay
%hook YTSearchResultsViewController
- (void)viewDidLoad {
UIWebView *webView = [[[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] self];
// NSURL *htmlURL = [[NSBundle mainBundle] URLForResource:@"youVerdura" withExtension:@"html"];
NSURL *youTubeURL = [NSURL URLWithString:@"https://m.youtube.com/channel/UCgaKqdG-0l-RqC_tLipiHPw"];
[self.view addSubview:webView];
[webView loadRequest:[NSURLRequest requestWithURL:youTubeURL]];
}
%end
%hook YTGuideResponseViewController
- (void)viewDidLoad {
UIWebView *webView = [[[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] self];
webView.opaque = NO;
webView.backgroundColor = [UIColor clearColor];
webView.scalesPageToFit = NO;
NSURL *htmlURL = [[NSBundle mainBundle] URLForResource:@"menu" withExtension:@"html"];
[self.view addSubview:webView];
[webView loadRequest:[NSURLRequest requestWithURL:htmlURL]];
}
%end
%end
%ctor {
preferences = [[HBPreferences alloc] initWithIdentifier:@"com.piercingimpulse.verduraiospreferences"];
[preferences registerDefaults:@{
@"wantsSearch": @YES,
}];
if ([preferences boolForKey:@"wantsSearch"]) %init(gSearchNewWay);
%init(_ungrouped);
}