Skip to content

Commit 63a5b9d

Browse files
YouTube Reborn v4.2.9
1 parent 3451818 commit 63a5b9d

File tree

9 files changed

+590
-537
lines changed

9 files changed

+590
-537
lines changed

AFNetworking/AFURLRequestSerialization.m

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#import "AFURLRequestSerialization.h"
2323

2424
#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV
25-
#import <MobileCoreServices/MobileCoreServices.h>
25+
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
2626
#else
2727
#import <CoreServices/CoreServices.h>
2828
#endif
@@ -609,13 +609,12 @@ - (instancetype)copyWithZone:(NSZone *)zone {
609609
}
610610

611611
static inline NSString * AFContentTypeForPathExtension(NSString *extension) {
612-
NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)extension, NULL);
613-
NSString *contentType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)UTI, kUTTagClassMIMEType);
612+
UTType *uti = [UTType typeWithFilenameExtension:extension];
613+
NSString *contentType = uti.preferredMIMEType;
614614
if (!contentType) {
615615
return @"application/octet-stream";
616-
} else {
617-
return contentType;
618616
}
617+
return contentType;
619618
}
620619

621620
NSUInteger const kAFUploadStream3GSuggestedPacketSize = 1024 * 16;

Controllers/RootOptionsController.m

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ - (void)coloursView;
2323

2424
@implementation RootOptionsController
2525

26-
- (void)loadView {
27-
[super loadView];
26+
- (void)viewDidLoad {
27+
[super viewDidLoad];
2828
[self coloursView];
2929

3030
self.title = @"YouTube Reborn";
@@ -35,9 +35,25 @@ - (void)loadView {
3535
UIBarButtonItem *applyButton = [[UIBarButtonItem alloc] initWithTitle:@"Apply" style:UIBarButtonItemStylePlain target:self action:@selector(apply)];
3636
self.navigationItem.rightBarButtonItem = applyButton;
3737

38-
if (@available(iOS 15.0, *)) {
39-
[self.tableView setSectionHeaderTopPadding:0.0f];
40-
}
38+
UITableViewStyle style;
39+
if (@available(iOS 13, *)) {
40+
style = UITableViewStyleInsetGrouped;
41+
} else {
42+
style = UITableViewStyleGrouped;
43+
}
44+
45+
self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:style];
46+
self.tableView.translatesAutoresizingMaskIntoConstraints = NO;
47+
self.tableView.dataSource = self;
48+
self.tableView.delegate = self;
49+
[self.view addSubview:self.tableView];
50+
51+
[NSLayoutConstraint activateConstraints:@[
52+
[self.tableView.centerXAnchor constraintEqualToAnchor:self.view.centerXAnchor],
53+
[self.tableView.centerYAnchor constraintEqualToAnchor:self.view.centerYAnchor],
54+
[self.tableView.widthAnchor constraintEqualToAnchor:self.view.widthAnchor],
55+
[self.tableView.heightAnchor constraintEqualToAnchor:self.view.heightAnchor]
56+
]];
4157
}
4258

4359
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
@@ -85,42 +101,64 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
85101
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
86102
if (indexPath.row == 0) {
87103
cell.textLabel.text = @"View Downloads";
104+
cell.imageView.image = [UIImage systemImageNamed:@"arrow.down.circle"];
105+
cell.imageView.tintColor = cell.textLabel.textColor;
88106
}
89107
if (indexPath.row == 1) {
90108
cell.textLabel.text = @"View Downloads In Filza";
109+
cell.imageView.image = [UIImage systemImageNamed:@"square.and.arrow.up.on.square"];
110+
cell.imageView.tintColor = cell.textLabel.textColor;
91111
}
92112
}
93113
if (indexPath.section == 1) {
94114
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
95115
if (indexPath.row == 0) {
96116
cell.textLabel.text = @"Video Options";
117+
cell.imageView.image = [UIImage systemImageNamed:@"play.rectangle"];
118+
cell.imageView.tintColor = cell.textLabel.textColor;
97119
}
98120
if (indexPath.row == 1) {
99121
cell.textLabel.text = @"Overlay Options";
122+
cell.imageView.image = [UIImage systemImageNamed:@"square.grid.3x2.fill"];
123+
cell.imageView.tintColor = cell.textLabel.textColor;
100124
}
101125
if (indexPath.row == 2) {
102126
cell.textLabel.text = @"Tab Bar Options";
127+
cell.imageView.image = [UIImage systemImageNamed:@"rectangle.3.offgrid.fill"];
128+
cell.imageView.tintColor = cell.textLabel.textColor;
103129
}
104130
if (indexPath.row == 3) {
105131
cell.textLabel.text = @"Colour Options";
132+
cell.imageView.image = [UIImage systemImageNamed:@"slider.horizontal.3"];
133+
cell.imageView.tintColor = cell.textLabel.textColor;
106134
}
107135
if (indexPath.row == 4) {
108136
cell.textLabel.text = @"Picture In Picture Options";
137+
cell.imageView.image = [UIImage systemImageNamed:@"pip"];
138+
cell.imageView.tintColor = cell.textLabel.textColor;
109139
}
110140
if (indexPath.row == 5) {
111141
cell.textLabel.text = @"Shorts Options";
142+
cell.imageView.image = [UIImage systemImageNamed:@"play.rectangle.on.rectangle.circle.fill"];
143+
cell.imageView.tintColor = cell.textLabel.textColor;
112144
}
113145
if (indexPath.row == 6) {
114146
cell.textLabel.text = @"Other Options";
147+
cell.imageView.image = [UIImage systemImageNamed:@"ellipsis"];
148+
cell.imageView.tintColor = cell.textLabel.textColor;
115149
}
116150
}
117151
if (indexPath.section == 2) {
118152
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
119153
if (indexPath.row == 0) {
120154
cell.textLabel.text = @"Reborn Settings";
155+
cell.imageView.image = [UIImage systemImageNamed:@"switch.2"];
156+
cell.imageView.tintColor = cell.textLabel.textColor;
121157
}
122158
if (indexPath.row == 1) {
123159
cell.textLabel.text = @"Credits";
160+
cell.imageView.image = [UIImage systemImageNamed:@"star.fill"];
161+
cell.imageView.tintColor = cell.textLabel.textColor;
124162
}
125163
}
126164
}
@@ -238,7 +276,7 @@ - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInte
238276
if (section == 2) {
239277
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
240278
NSString *appVersion = infoDictionary[@"CFBundleShortVersionString"];
241-
return [NSString stringWithFormat:@"YouTube: v%@\nYouTube Reborn: v4.2.8\n\n@ Lillie (@LillieH1000) 2022-2024", appVersion];
279+
return [NSString stringWithFormat:@"YouTube: v%@\nYouTube Reborn: v4.2.9\n\n@ Lillie (@LillieH1000) 2022-2025", appVersion];
242280
}
243281
return nil;
244282
}
@@ -272,34 +310,6 @@ - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
272310

273311
- (void)viewWillAppear:(BOOL)animated {
274312
[super viewWillAppear:animated];
275-
self.view.layer.cornerRadius = 10.0;
276-
self.view.layer.masksToBounds = YES;
277-
}
278-
279-
- (void)viewDidLoad {
280-
[super viewDidLoad];
281-
[self setBorderPropertiesForView:self.tableView];
282-
[self setBorderPropertiesForView:self.view];
283-
self.tableView.contentInset = UIEdgeInsetsMake(10.0, 0.0, 0.0, 0.0);
284-
self.tableView.layer.borderWidth = 1.0;
285-
self.tableView.layer.borderColor = [UIColor blackColor].CGColor;
286-
self.tableView.layer.cornerRadius = 10.0;
287-
self.tableView.layer.masksToBounds = true;
288-
self.view.layer.borderWidth = 1.0;
289-
self.view.layer.borderColor = [UIColor blackColor].CGColor;
290-
UITableView *tableView = self.tableView;
291-
tableView.contentInset = UIEdgeInsetsMake(10.0, 0.0, 0.0, 0.0);
292-
tableView.layer.maskedCorners = kCALayerMinXMinYCorner;
293-
self.view.layer.borderWidth = 1.0;
294-
self.view.layer.borderColor = [UIColor blackColor].CGColor;
295-
self.view.layer.cornerRadius = 10.0;
296-
self.view.layer.masksToBounds = true;
297-
self.view.layer.maskedCorners = kCALayerMaxXMinYCorner | kCALayerMinXMinYCorner;
298-
}
299-
300-
- (void)setBorderPropertiesForView:(UIView *)view {
301-
view.layer.borderWidth = 1.0;
302-
view.layer.borderColor = [UIColor blackColor].CGColor;
303313
}
304314

305315
@end

Controllers/YouTubeUtils.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#import <Foundation/Foundation.h>
2+
3+
@interface YouTubeUtils : NSObject
4+
5+
+ (BOOL)validatePlayerResponse:(NSDictionary *)response;
6+
+ (NSURL *)highestQualityThumbnailURLFromArray:(NSArray *)thumbnails;
7+
+ (NSDictionary *)bestVideoInfoFromFormats:(NSArray *)formats;
8+
+ (NSDictionary *)bestAudioInfoFromFormats:(NSArray *)formats;
9+
10+
@end

Controllers/YouTubeUtils.m

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#import "YouTubeUtils.h"
2+
3+
@implementation YouTubeUtils
4+
5+
+ (BOOL)validatePlayerResponse:(NSDictionary *)response {
6+
return response && response[@"streamingData"] && response[@"videoDetails"];
7+
}
8+
9+
+ (NSURL *)highestQualityThumbnailURLFromArray:(NSArray *)thumbnails {
10+
if (!thumbnails.count) return nil;
11+
return [NSURL URLWithString:thumbnails.lastObject[@"url"]];
12+
}
13+
14+
+ (NSDictionary *)bestVideoInfoFromFormats:(NSArray *)formats {
15+
NSMutableDictionary *videoURLs = [NSMutableDictionary dictionary];
16+
NSArray *resolutions = @[@"2160", @"1440", @"1080", @"720", @"480", @"360", @"240"];
17+
NSArray *qualityLabels = @[@"hd2160", @"hd1440", @"hd1080", @"hd720", @"480p", @"360p", @"240p"];
18+
19+
for (NSUInteger i = 0; i < resolutions.count; i++) {
20+
NSString *resolution = resolutions[i];
21+
NSString *quality = qualityLabels[i];
22+
23+
for (NSDictionary *format in formats) {
24+
NSString *mimeType = format[@"mimeType"];
25+
NSString *height = [format[@"height"] stringValue];
26+
NSString *formatQuality = format[@"quality"];
27+
NSString *qualityLabel = format[@"qualityLabel"];
28+
NSString *urlString = format[@"url"];
29+
30+
if ([mimeType containsString:@"video/mp4"] &&
31+
((height && [height isEqualToString:resolution]) ||
32+
(formatQuality && [formatQuality isEqualToString:quality]) ||
33+
(qualityLabel && [qualityLabel isEqualToString:qualityLabel]))) {
34+
videoURLs[[resolutions[i] stringByAppendingString:@"p"]] = [NSURL URLWithString:urlString];
35+
break;
36+
}
37+
}
38+
}
39+
return videoURLs;
40+
}
41+
42+
+ (NSDictionary *)bestAudioInfoFromFormats:(NSArray *)formats {
43+
NSMutableDictionary *audioInfo = [NSMutableDictionary dictionary];
44+
NSArray *qualities = @[@"AUDIO_QUALITY_HIGH", @"AUDIO_QUALITY_MEDIUM", @"AUDIO_QUALITY_LOW"];
45+
46+
for (NSString *quality in qualities) {
47+
for (NSDictionary *format in formats) {
48+
NSString *mimeType = format[@"mimeType"];
49+
NSString *audioQuality = format[@"audioQuality"];
50+
NSString *urlString = format[@"url"];
51+
52+
if ([mimeType containsString:@"audio/mp4"] &&
53+
audioQuality && [audioQuality isEqualToString:quality] &&
54+
(!audioInfo[@"url"] ||
55+
[qualities indexOfObject:audioInfo[@"quality"]] > [qualities indexOfObject:quality])) {
56+
audioInfo[@"quality"] = quality;
57+
audioInfo[@"url"] = [NSURL URLWithString:urlString];
58+
}
59+
}
60+
if (audioInfo[@"url"]) break;
61+
}
62+
return audioInfo;
63+
}
64+
65+
@end

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
TARGET = iphone:clang:16.5:14.0
2-
export SDK_PATH = $(THEOS)/sdks/iPhoneOS16.5.sdk/
1+
TARGET = iphone:clang:17.5:14.0
2+
export SDK_PATH = $(THEOS)/sdks/iPhoneOS17.5.sdk/
33
export SYSROOT = $(SDK_PATH)
44
YouTubeReborn_USE_FLEX = 0
55
YouTubeReborn_USE_FISHHOOK = 0

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
## YouTube Reborn: Best Customizer for iOS YouTube App
22

3-
Revitalize your YouTube experience with YouTube Reborn—a tweak developed by LillieH1000. Compatible with non-jailbroken and jailbroken iOS and iPadOS devices, this tweak works seamlessly on iOS/iPadOS 15.0-17.5.1 while supporting the latest version of YouTube.
3+
Revitalize your YouTube experience with YouTube Reborn—a tweak developed by LillieH1000. Compatible with non-jailbroken and jailbroken iOS and iPadOS devices, this tweak works seamlessly on iOS/iPadOS 15.0-18.5 while supporting the latest version of YouTube.
44

55
-----
66

77
### Download YouTube Reborn
88

9-
Get ready to have a better YouTube experience! Download the Deb file from the [latest release](https://github.com/arichorn/YouTube-Reborn/releases/latest/) on GitHub.
9+
Get ready to have a better YouTube experience! Download the Deb file from the [latest release](https://github.com/arichornlover/YouTube-Reborn/releases/latest/) on GitHub.
1010

1111
-----
1212

0 commit comments

Comments
 (0)