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
qnblackcat 5e9d719882 fix app crash upon launching on some devices 2022-05-17 09:44:54 +07:00
qnblackcat f63cfa8b43 update Makefile 2022-05-17 09:43:12 +07:00
qnblackcat 37b6b1e07e update description 2022-05-17 09:43:01 +07:00
11 changed files with 55 additions and 33 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
+1 -1
View File
@@ -2,7 +2,7 @@ uYouPlus_INJECT_DYLIBS = Tweaks/uYou/Library/MobileSubstrate/DynamicLibraries/uY
TARGET = iphone:clang:latest:12.0
uYouPlus_USE_FLEX = 0
uYouPlus_USE_FISHHOOK = 1
uYouPlus_USE_FISHHOOK = 0
ARCHS = arm64
MODULES = jailed
FINALPACKAGE = 1
+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) |
+13 -3
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,7 +38,16 @@ extern BOOL ytMiniPlayer();
%new - (void)updateuYouPlusSectionWithEntry:(id)entry {
YTSettingsViewController *delegate = [self valueForKey:@"_dataDelegate"];
YTSettingsSectionItem *ytMiniPlayer = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Enable the Miniplayer for all videos" titleDescription:@"App restart is required."];
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;
ytMiniPlayer.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"ytMiniPlayer_enabled"];
@@ -127,7 +137,7 @@ extern BOOL ytMiniPlayer();
return YES;
};
YTSettingsSectionItem *oledKeyBoard = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"OLED Keyboard (Experimental)" titleDescription:@"Might not working properly in some cases . App restart is required."];
YTSettingsSectionItem *oledKeyBoard = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"OLED Keyboard (Experimental)" titleDescription:@"Might not working properly in some cases. App restart is required."];
oledKeyBoard.hasSwitch = YES;
oledKeyBoard.switchVisible = YES;
oledKeyBoard.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oledKeyBoard_enabled"];
@@ -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];
}
+29 -20
View File
@@ -1,10 +1,8 @@
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#import <fishhook.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"
@@ -44,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"];
}
@@ -53,15 +54,12 @@ BOOL ytMiniPlayer() {
// Tweaks
// YTMiniPlayerEnabler: https://github.com/level3tjg/YTMiniplayerEnabler/
static BOOL (*orig_class_addMethod)(Class, SEL, IMP, const char *);
static BOOL hook_class_addMethod(Class cls, SEL name, IMP imp, const char *types) {
if (ytMiniPlayer() && [cls isEqual:%c(YTIMiniplayerRenderer)] && [NSStringFromSelector(name) hasPrefix:@"has"]) {
imp = imp_implementationWithBlock(^BOOL(id self, SEL _cmd) {
return NO;
});
}
return orig_class_addMethod(cls, name, imp, types);
%hook YTWatchMiniBarViewController
- (void)updateMiniBarPlayerStateFromRenderer {
if (ytMiniPlayer()) {}
else { return %orig; }
}
%end
// Hide CC / Autoplay switch
%hook YTMainAppControlsOverlayView
@@ -73,6 +71,14 @@ static BOOL hook_class_addMethod(Class cls, SEL name, IMP imp, const char *types
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
@@ -137,8 +143,8 @@ static BOOL hook_class_addMethod(Class cls, SEL name, IMP imp, const char *types
rootViewController = [rootViewController presentedViewController];
}
[rootViewController presentViewController:alertController animated:YES completion:nil];
}
return %orig;
} else { return %orig; }
}
%end
@@ -203,6 +209,14 @@ static BOOL hook_class_addMethod(Class cls, SEL name, IMP imp, const char *types
}
%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];
@@ -312,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
@@ -412,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
@@ -438,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
@@ -550,7 +560,6 @@ static void replaceTab(YTIGuideResponse *response) {
%end
%ctor {
rebind_symbols((struct rebinding[1]){{"class_addMethod", (void *)hook_class_addMethod, (void **)&orig_class_addMethod}}, 1);
%init;
if (oled()) {
%init(gOLED);