Compare commits

..
Author SHA1 Message Date
qnblackcat fb0e5073ae temporary fix for issue #54 2022-05-24 01:13:41 +07:00
qnblackcat f9e05fee77 update submodules 2022-05-24 01:12:42 +07:00
qnblackcat ec7eec660b fix YTCastconfirm, code clean up 2022-05-21 12:51:11 +07:00
qnblackcat 2e6c19c060 update description 2022-05-21 12:50:50 +07:00
qnblackcat bb3b8ed310 v17.19.3-2.1 2022-05-20 21:44:58 +07:00
qnblackcat b94a5cc967 hide Previous/Next button 2022-05-20 21:38:33 +07:00
qnblackcat 8b50a3c1b7 more? 2022-05-20 21:29:30 +07:00
qnblackcat 025dc4d2cb update submodules 2022-05-20 20:58:46 +07:00
qnblackcat 9860fdb4e8 v17.19.2-2.1-F3 2022-05-17 10:07:23 +07:00
10 changed files with 47 additions and 20 deletions
+3
View File
@@ -1,5 +1,8 @@
#import "Tweaks/YouTubeHeader/YTPlayerViewController.h"
@interface YTMainAppControlsOverlayView: UIView
@end
@interface YTPlaylistHeaderViewController : UIViewController
@property (nonatomic, strong, readwrite) UIView *downloadsButton;
@end
+3 -3
View File
@@ -78,16 +78,16 @@
- My official AtlStore repo: https://qnblackcat.github.io/AltStore/
- [Open in AltStore (v17.19.2-2.1)](https://tinyurl.com/2p9e76h2) - It will take a while to install because AltStore needs to download the IPA.
- [Open in AltStore (v17.19.3-2.1)](https://tinyurl.com/5n8c64zv) - It will take a while to install because AltStore needs to download the IPA.
- Version info: _(last update: May 16)_
- Version info: _(last update: May 20)_
<details>
<summary> ▶︎ Expand</summary>
| **Tweaks/App** | **Version** | **Open source** |
| :------------: | :----------:| :-------------: |
| **YouTube** | 17.19.2 | ✖︎ |
| **YouTube** | 17.19.3 | ✖︎ |
| [uYou](https://github.com/MiRO92/uYou-for-YouTube) | 2.1 | ✖︎ |
| [Open in YouTube](https://github.com/CokePokes/YoutubeExtensions/) | 1.2 | ✖︎ |
| **Return YouTube Dislike** | 1.6.4 | [✔︎](https://github.com/PoomSmart/Return-YouTube-Dislikes) |
+11 -1
View File
@@ -19,6 +19,7 @@ extern BOOL hideCC();
extern BOOL hideAutoplaySwitch();
extern BOOL castConfirm();
extern BOOL ytMiniPlayer();
extern BOOL hidePreviousAndNextButton();
// Settings
%hook YTAppSettingsPresentationData
@@ -37,6 +38,15 @@ extern BOOL ytMiniPlayer();
%new - (void)updateuYouPlusSectionWithEntry:(id)entry {
YTSettingsViewController *delegate = [self valueForKey:@"_dataDelegate"];
YTSettingsSectionItem *hidePreviousAndNextButton = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Hide Previous and Next button" titleDescription:@""];
hidePreviousAndNextButton.hasSwitch = YES;
hidePreviousAndNextButton.switchVisible = YES;
hidePreviousAndNextButton.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hidePreviousAndNextButton_enabled"];
hidePreviousAndNextButton.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hidePreviousAndNextButton_enabled"];
return YES;
};
YTSettingsSectionItem *ytMiniPlayer = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Enable the Miniplayer for all YouTube videos" titleDescription:@""];
ytMiniPlayer.hasSwitch = YES;
ytMiniPlayer.switchVisible = YES;
@@ -136,7 +146,7 @@ extern BOOL ytMiniPlayer();
return YES;
};
NSMutableArray <YTSettingsSectionItem *> *sectionItems = [NSMutableArray arrayWithArray:@[autoFull, castConfirm, ytMiniPlayer, hideAutoplaySwitch, hideCC, hideHUD, hoverCardItem, bigYTMiniPlayer, oledKeyBoard, oledDarkMode,reExplore]];
NSMutableArray <YTSettingsSectionItem *> *sectionItems = [NSMutableArray arrayWithArray:@[autoFull, castConfirm, ytMiniPlayer, hideAutoplaySwitch, hideCC, hideHUD, hidePreviousAndNextButton, hoverCardItem, bigYTMiniPlayer, oledKeyBoard, oledDarkMode,reExplore]];
[delegate setSectionItems:sectionItems forCategory:uYouPlusSection title:@"uYouPlus" titleDescription:nil headerHidden:NO];
}
+24 -10
View File
@@ -3,7 +3,6 @@
#import <objc/runtime.h>
#import "Header.h"
#import "Tweaks/YouTubeHeader/YTVideoQualitySwitchOriginalController.h"
#import "Tweaks/YouTubeHeader/YTSettingsSectionItem.h"
#import "Tweaks/YouTubeHeader/YTPlayerViewController.h"
#import "Tweaks/YouTubeHeader/YTWatchController.h"
#import "Tweaks/YouTubeHeader/YTIGuideResponse.h"
@@ -43,6 +42,9 @@ BOOL hideCC() {
BOOL hideAutoplaySwitch() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideAutoplaySwitch_enabled"];
}
BOOL hidePreviousAndNextButton() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hidePreviousAndNextButton_enabled"];
}
BOOL castConfirm() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"castConfirm_enabled"];
}
@@ -69,6 +71,14 @@ BOOL ytMiniPlayer() {
if (hideAutoplaySwitch()) {}
else { return %orig; }
}
- (void)layoutSubviews {
if (hidePreviousAndNextButton()) {
MSHookIvar<YTMainAppControlsOverlayView *>(self, "_nextButton").hidden = YES;
MSHookIvar<YTMainAppControlsOverlayView *>(self, "_previousButton").hidden = YES;
%orig;
}
return %orig;
}
%end
// Hide HUD Messages
@@ -133,8 +143,8 @@ BOOL ytMiniPlayer() {
rootViewController = [rootViewController presentedViewController];
}
[rootViewController presentViewController:alertController animated:YES completion:nil];
}
return %orig;
} else { return %orig; }
}
%end
@@ -199,6 +209,14 @@ BOOL ytMiniPlayer() {
}
%end
// Workaround for issue #54
%hook YTMainAppVideoPlayerOverlayViewController
- (void)updateRelatedVideos {
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"relatedVideosAtTheEndOfYTVideos"] == NO) {}
else { return %orig; }
}
%end
// OLED dark mode by BandarHL
UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
@@ -308,9 +326,7 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
%orig;
self.tableView.backgroundColor = oledColor;
} else {
return %orig();
}
} else { return %orig; }
}
%end
@@ -408,9 +424,7 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
%hook YTCollectionSeparatorView
- (void)didMoveToWindow {
if (isDarkMode()) {}
else {
return %orig();
}
else { return %orig; }
}
%end
@@ -434,8 +448,8 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
%hook ASWAppSwitcherCollectionViewCell
- (void)didMoveToWindow {
if (isDarkMode()) {
%orig;
self.subviews[1].backgroundColor = oledColor;
%orig;
}
}
%end