Compare commits

..
Author SHA1 Message Date
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
qnblackcat 1827ece773 v17.19.2-2.1 2022-05-16 17:31:50 +07:00
qnblackcat f9e98fa04d update submodules 2022-05-16 16:52:25 +07:00
qnblackcat 2c5d0545d7 added YTMiniPlayerEnabler by level3tjg 2022-05-16 11:56:29 +07:00
qnblackcat 3c33e6fed0 update Header.h 2022-05-16 11:55:33 +07:00
qnblackcat daa004d027 update Makefile 2022-05-16 11:55:24 +07:00
qnblackcat 556f4dd8cf update submodules 2022-05-16 10:21:16 +07:00
qnblackcat 68855e71bf update description 2022-05-10 20:48:40 +07:00
qnblackcat 8fcf17572d colored things that should be colored :/ 2022-05-10 20:38:25 +07:00
qnblackcat 94c58965c7 update Makefile 2022-05-10 20:10:04 +07:00
qnblackcat 5e7b7717ff remove old codes 2022-05-10 20:09:47 +07:00
Nguyễn Đạt 1a99fa819e Merge pull request #149 from BandarHL/main
Update OLED Dark mode: code clean up, better performance.
2022-05-10 19:39:12 +07:00
BandarHelal 0c8376fc60 Update OLED Dark mode feature
well, instead of hooking every view for YouTube to change the color, you can achieve the same results with less code by hooking the Color palette (YTColorPalette).
2022-05-09 23:39:02 +03:00
10 changed files with 336 additions and 362 deletions
+13 -18
View File
@@ -1,5 +1,15 @@
#import "Tweaks/YouTubeHeader/YTPlayerViewController.h" #import "Tweaks/YouTubeHeader/YTPlayerViewController.h"
@interface YTMainAppControlsOverlayView: UIView
@end
@interface YTPlaylistHeaderViewController : UIViewController
@property (nonatomic, strong, readwrite) UIView *downloadsButton;
@end
@interface ASWAppSwitcherCollectionViewCell: UIView
@end
@interface YTMainAppVideoPlayerOverlayView : UIView @interface YTMainAppVideoPlayerOverlayView : UIView
- (UIViewController *)_viewControllerForAncestor; - (UIViewController *)_viewControllerForAncestor;
@end @end
@@ -7,31 +17,13 @@
@interface YTWatchMiniBarView : UIView @interface YTWatchMiniBarView : UIView
@end @end
@interface YTAsyncCollectionView : UIView
@end
@interface YTPlayerViewController (YTAFS) @interface YTPlayerViewController (YTAFS)
- (void)autoFullscreen; - (void)autoFullscreen;
@end @end
@interface YTTopAlignedView : UIView
@end
@interface YTLightweightQTMButton : UIView
@end
@interface NIAttributedLabel : UIView
@end
@interface YTShareMainView : UIView
@end
@interface ASScrollView : UIView @interface ASScrollView : UIView
@end @end
@interface ASCollectionView : UIView
@end
@interface UIKeyboardLayoutStar : UIView @interface UIKeyboardLayoutStar : UIView
@end @end
@@ -43,3 +35,6 @@
@interface UIPredictionViewController : UIViewController @interface UIPredictionViewController : UIViewController
@end @end
@interface SponsorBlockSettingsController : UITableViewController
@end
+2 -1
View File
@@ -1,6 +1,8 @@
uYouPlus_INJECT_DYLIBS = Tweaks/uYou/Library/MobileSubstrate/DynamicLibraries/uYou.dylib .theos/obj/libcolorpicker.dylib .theos/obj/iSponsorBlock.dylib .theos/obj/YTUHD.dylib .theos/obj/YouPiP.dylib .theos/obj/YouTubeDislikesReturn.dylib .theos/obj/YoutubeSpeed.dylib uYouPlus_INJECT_DYLIBS = Tweaks/uYou/Library/MobileSubstrate/DynamicLibraries/uYou.dylib .theos/obj/libcolorpicker.dylib .theos/obj/iSponsorBlock.dylib .theos/obj/YTUHD.dylib .theos/obj/YouPiP.dylib .theos/obj/YouTubeDislikesReturn.dylib .theos/obj/YoutubeSpeed.dylib
TARGET = iphone:clang:latest:12.0
uYouPlus_USE_FLEX = 0 uYouPlus_USE_FLEX = 0
uYouPlus_USE_FISHHOOK = 0
ARCHS = arm64 ARCHS = arm64
MODULES = jailed MODULES = jailed
FINALPACKAGE = 1 FINALPACKAGE = 1
@@ -12,7 +14,6 @@ BUNDLE_ID = com.google.ios.youtube
uYouPlus_FILES = uYouPlus.xm Settings.xm uYouPlus_FILES = uYouPlus.xm Settings.xm
uYouPlus_IPA = ./tmp/Payload/YouTube.app uYouPlus_IPA = ./tmp/Payload/YouTube.app
### Important: edit the path to your decrypted YouTube IPA!!!
include $(THEOS)/makefiles/common.mk include $(THEOS)/makefiles/common.mk
include $(THEOS_MAKE_PATH)/tweak.mk include $(THEOS_MAKE_PATH)/tweak.mk
+11 -12
View File
@@ -1,6 +1,5 @@
![cydia-1900000830-iphone-0-1628105716 3](https://user-images.githubusercontent.com/52943116/135612614-3d3138cb-2a3d-4ed1-9244-905bab8f5c9f.PNG) ![cydia-1900000830-iphone-0-1628105716 3](https://user-images.githubusercontent.com/52943116/135612614-3d3138cb-2a3d-4ed1-9244-905bab8f5c9f.PNG)
# Table of Contents # Table of Contents
* [Credits](#credits) * [Credits](#credits)
@@ -10,8 +9,7 @@
* [Installation](#installation) * [Installation](#installation)
* [Support the developers!](#support-the-developers) * [Support the developers!](#support-the-developers)
* [FAQ](#faq) * [FAQ](#faq)
* [Building (optional)](#building-optional) * [Building](#building-optional)
# Credits # Credits
@@ -23,7 +21,7 @@
- [PoomSmart](https://twitter.com/poomsmart) - the developer of many tweaks used by uYouPlus, include: [NoYTPremium](https://github.com/PoomSmart/NoYTPremium/), [YouRememberCaption](https://www.ios-repo-updates.com/repository/poomsmart/package/com.ps.youremembercaption/), [YTClassicVideoQuality](https://poomsmart.github.io/repo/depictions/ytclassicvideoquality.html), [YTNoCheckLocalNetwork](https://poomsmart.github.io/repo/depictions/ytnochecklocalnetwork.html), [YTSystemAppearance](https://poomsmart.github.io/repo/depictions/ytsystemappearance.html), [YTAutoFullScreen](https://github.com/PoomSmart/YTAutoFullScreen/), [YTReExplore](https://github.com/PoomSmart/YTReExplore/), [YTUHD](https://poomsmart.github.io/repo/depictions/ytuhd.html), [YouPiP](https://poomsmart.github.io/repo/depictions/youpip.html), and [Return YouTube Dislike](https://github.com/PoomSmart/Return-YouTube-Dislikes) - [PoomSmart](https://twitter.com/poomsmart) - the developer of many tweaks used by uYouPlus, include: [NoYTPremium](https://github.com/PoomSmart/NoYTPremium/), [YouRememberCaption](https://www.ios-repo-updates.com/repository/poomsmart/package/com.ps.youremembercaption/), [YTClassicVideoQuality](https://poomsmart.github.io/repo/depictions/ytclassicvideoquality.html), [YTNoCheckLocalNetwork](https://poomsmart.github.io/repo/depictions/ytnochecklocalnetwork.html), [YTSystemAppearance](https://poomsmart.github.io/repo/depictions/ytsystemappearance.html), [YTAutoFullScreen](https://github.com/PoomSmart/YTAutoFullScreen/), [YTReExplore](https://github.com/PoomSmart/YTReExplore/), [YTUHD](https://poomsmart.github.io/repo/depictions/ytuhd.html), [YouPiP](https://poomsmart.github.io/repo/depictions/youpip.html), and [Return YouTube Dislike](https://github.com/PoomSmart/Return-YouTube-Dislikes)
- [level3tjg](https://twitter.com/level3tjg) - for [YTNoHoverCards](https://github.com/level3tjg/YTNoHoverCards). - [level3tjg](https://twitter.com/level3tjg) - for [YTNoHoverCards](https://github.com/level3tjg/YTNoHoverCards) and [YTMiniplayerEnabler](https://github.com/level3tjg/YTMiniplayerEnabler).
- [Lyvendia](https://github.com/Lyvendia/) for [YTSpeed](https://github.com/Lyvendia/YTSpeed/) - [Lyvendia](https://github.com/Lyvendia/) for [YTSpeed](https://github.com/Lyvendia/YTSpeed/)
@@ -33,7 +31,6 @@
- [theos team](https://github.com/theos/theos) for theos & theos-jailed. - [theos team](https://github.com/theos/theos) for theos & theos-jailed.
# Features # Features
1. **uYou:** uYou has a ton of features that I can't list them all. Visit [here](https://miro92.com/repo/depictions/?p=com.miro.uyou) for more info! 1. **uYou:** uYou has a ton of features that I can't list them all. Visit [here](https://miro92.com/repo/depictions/?p=com.miro.uyou) for more info!
@@ -63,6 +60,8 @@
12. **YTSpeed**: add 2.25, 2.5, 2.75, and 3x playback speed 12. **YTSpeed**: add 2.25, 2.5, 2.75, and 3x playback speed
13. **YTMiniplayerEnabler**: enable Miniplayer for all YouTube videos.
</details> </details>
# Known issues # Known issues
@@ -71,7 +70,6 @@
- Issues that related to **uYouPlus** are [here](https://github.com/qnblackcat/uYouPlus/issues/) - Issues that related to **uYouPlus** are [here](https://github.com/qnblackcat/uYouPlus/issues/)
# Download # Download
- **uYouPlus** (or you can call it uYou+) requires iOS & iPadOS 13.0 or later. The latest version of **uYouPlus** can be found in the [Release tab](https://github.com/qnblackcat/uYouPlus/releases). - **uYouPlus** (or you can call it uYou+) requires iOS & iPadOS 13.0 or later. The latest version of **uYouPlus** can be found in the [Release tab](https://github.com/qnblackcat/uYouPlus/releases).
@@ -80,16 +78,16 @@
- My official AtlStore repo: https://qnblackcat.github.io/AltStore/ - My official AtlStore repo: https://qnblackcat.github.io/AltStore/
- [Open in AltStore (v17.18.4-2.1)](https://tinyurl.com/bdzxtdrx) - It will take a while to install because AltStore needs to download the IPA. - [Open in AltStore (v17.19.2-2.1)](https://tinyurl.com/2s49jpru) - It will take a while to install because AltStore needs to download the IPA.
- Version info: _(last update: May 09)_ - Version info: _(last update: May 16)_
<details> <details>
<summary> ▶︎ Expand</summary> <summary> ▶︎ Expand</summary>
| **Tweaks/App** | **Version** | **Open source** | | **Tweaks/App** | **Version** | **Open source** |
| :------------: | :----------:| :-------------: | | :------------: | :----------:| :-------------: |
| **YouTube** | 17.18.4 | ✖︎ | | **YouTube** | 17.19.2 | ✖︎ |
| [uYou](https://github.com/MiRO92/uYou-for-YouTube) | 2.1 | ✖︎ | | [uYou](https://github.com/MiRO92/uYou-for-YouTube) | 2.1 | ✖︎ |
| [Open in YouTube](https://github.com/CokePokes/YoutubeExtensions/) | 1.2 | ✖︎ | | [Open in YouTube](https://github.com/CokePokes/YoutubeExtensions/) | 1.2 | ✖︎ |
| **Return YouTube Dislike** | 1.6.4 | [✔︎](https://github.com/PoomSmart/Return-YouTube-Dislikes) | | **Return YouTube Dislike** | 1.6.4 | [✔︎](https://github.com/PoomSmart/Return-YouTube-Dislikes) |
@@ -108,6 +106,7 @@
| **YTReExplore** | 1.0.2 | [✔︎](https://github.com/PoomSmart/YTReExplore) | | **YTReExplore** | 1.0.2 | [✔︎](https://github.com/PoomSmart/YTReExplore) |
| **BigYTMiniPlayer** | 1.0-1 | [✔︎](https://github.com/Galactic-Dev/BigYTMiniPlayer) | | **BigYTMiniPlayer** | 1.0-1 | [✔︎](https://github.com/Galactic-Dev/BigYTMiniPlayer) |
| **YTCastConfirm** | 1.0.0 | [✔︎](https://github.com/JamieBerghmans/YTCastConfirm) | | **YTCastConfirm** | 1.0.0 | [✔︎](https://github.com/JamieBerghmans/YTCastConfirm) |
| **YTMiniplayerEnabler** | 0.0.2 | [✔︎](https://github.com/level3tjg/YTMiniplayerEnabler) |
</details> </details>
@@ -117,7 +116,7 @@ See [Installation - Wiki](https://github.com/qnblackcat/uYouPlus/wiki/Installati
# Support the developers # Support the developers
<details> <details>
<summary>MiRO92</summary> <summary>▶︎ MiRO92</summary>
- CashApp: https://cash.app/$MiRO92M - CashApp: https://cash.app/$MiRO92M
@@ -125,14 +124,14 @@ See [Installation - Wiki](https://github.com/qnblackcat/uYouPlus/wiki/Installati
</details> </details>
<details> <details>
<summary>Poomsmart</summary> <summary>▶︎ Poomsmart</summary>
- Paypal: https://poomsmart.github.io/ - Paypal: https://poomsmart.github.io/
</details> </details>
<details> <details>
<summary>Galactic-dev</summary> <summary>▶︎ Galactic-dev</summary>
- Paypal: https://www.paypal.com/paypalme/DBrett684 - Paypal: https://www.paypal.com/paypalme/DBrett684
+24 -4
View File
@@ -18,6 +18,8 @@ extern BOOL bigYTMiniPlayer();
extern BOOL hideCC(); extern BOOL hideCC();
extern BOOL hideAutoplaySwitch(); extern BOOL hideAutoplaySwitch();
extern BOOL castConfirm(); extern BOOL castConfirm();
extern BOOL ytMiniPlayer();
extern BOOL hidePreviousAndNextButton();
// Settings // Settings
%hook YTAppSettingsPresentationData %hook YTAppSettingsPresentationData
@@ -36,7 +38,25 @@ extern BOOL castConfirm();
%new - (void)updateuYouPlusSectionWithEntry:(id)entry { %new - (void)updateuYouPlusSectionWithEntry:(id)entry {
YTSettingsViewController *delegate = [self valueForKey:@"_dataDelegate"]; YTSettingsViewController *delegate = [self valueForKey:@"_dataDelegate"];
YTSettingsSectionItem *castConfirm = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Confirm alert before casting (YTCastConfirm)" titleDescription:@"Show a confirm alert before casting to prevent accidentally hijacking TV."]; 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"];
ytMiniPlayer.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"ytMiniPlayer_enabled"];
return YES;
};
YTSettingsSectionItem *castConfirm = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Confirm alert before casting (YTCastConfirm)" titleDescription:@"Show a confirm alert before casting to prevent accidentally hijacking TV. App restart is required."];
castConfirm.hasSwitch = YES; castConfirm.hasSwitch = YES;
castConfirm.switchVisible = YES; castConfirm.switchVisible = YES;
castConfirm.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"castConfirm_enabled"]; castConfirm.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"castConfirm_enabled"];
@@ -108,7 +128,7 @@ extern BOOL castConfirm();
return YES; return YES;
}; };
YTSettingsSectionItem *oledDarkMode = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"OLED Dark mode (Experimental)" titleDescription:@"WARNING: OLED Dark mode only works when YouTube is in Dark theme. App restart is required (In case OLED dark mode doesn't work: just switch between Light/Dark theme, then restart the app)."]; YTSettingsSectionItem *oledDarkMode = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"OLED Dark mode (Experimental)" titleDescription:@"App restart might be needed after switching between Light/Dark theme to fully apply changes. In case OLED Dark mode doesn't work: just switch between Light/Dark theme, then restart the app."];
oledDarkMode.hasSwitch = YES; oledDarkMode.hasSwitch = YES;
oledDarkMode.switchVisible = YES; oledDarkMode.switchVisible = YES;
oledDarkMode.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oled_enabled"]; oledDarkMode.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oled_enabled"];
@@ -117,7 +137,7 @@ extern BOOL castConfirm();
return YES; return YES;
}; };
YTSettingsSectionItem *oledKeyBoard = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"OLED Keyboard" 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.hasSwitch = YES;
oledKeyBoard.switchVisible = YES; oledKeyBoard.switchVisible = YES;
oledKeyBoard.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oledKeyBoard_enabled"]; oledKeyBoard.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oledKeyBoard_enabled"];
@@ -126,7 +146,7 @@ extern BOOL castConfirm();
return YES; return YES;
}; };
NSMutableArray <YTSettingsSectionItem *> *sectionItems = [NSMutableArray arrayWithArray:@[autoFull, castConfirm, 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]; [delegate setSectionItems:sectionItems forCategory:uYouPlusSection title:@"uYouPlus" titleDescription:nil headerHidden:NO];
} }
+296 -337
View File
@@ -3,7 +3,6 @@
#import <objc/runtime.h> #import <objc/runtime.h>
#import "Header.h" #import "Header.h"
#import "Tweaks/YouTubeHeader/YTVideoQualitySwitchOriginalController.h" #import "Tweaks/YouTubeHeader/YTVideoQualitySwitchOriginalController.h"
#import "Tweaks/YouTubeHeader/YTSettingsSectionItem.h"
#import "Tweaks/YouTubeHeader/YTPlayerViewController.h" #import "Tweaks/YouTubeHeader/YTPlayerViewController.h"
#import "Tweaks/YouTubeHeader/YTWatchController.h" #import "Tweaks/YouTubeHeader/YTWatchController.h"
#import "Tweaks/YouTubeHeader/YTIGuideResponse.h" #import "Tweaks/YouTubeHeader/YTIGuideResponse.h"
@@ -11,6 +10,7 @@
#import "Tweaks/YouTubeHeader/YTIPivotBarSupportedRenderers.h" #import "Tweaks/YouTubeHeader/YTIPivotBarSupportedRenderers.h"
#import "Tweaks/YouTubeHeader/YTIPivotBarRenderer.h" #import "Tweaks/YouTubeHeader/YTIPivotBarRenderer.h"
#import "Tweaks/YouTubeHeader/YTIBrowseRequest.h" #import "Tweaks/YouTubeHeader/YTIBrowseRequest.h"
#import "Tweaks/YouTubeHeader/YTCommonColorPalette.h"
BOOL hideHUD() { BOOL hideHUD() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideHUD_enabled"]; return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideHUD_enabled"];
@@ -21,6 +21,9 @@ BOOL oled() {
BOOL oledKB() { BOOL oledKB() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"oledKeyBoard_enabled"]; return [[NSUserDefaults standardUserDefaults] boolForKey:@"oledKeyBoard_enabled"];
} }
BOOL isDarkMode() {
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1);
}
BOOL autoFullScreen() { BOOL autoFullScreen() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"autofull_enabled"]; return [[NSUserDefaults standardUserDefaults] boolForKey:@"autofull_enabled"];
} }
@@ -39,20 +42,42 @@ BOOL hideCC() {
BOOL hideAutoplaySwitch() { BOOL hideAutoplaySwitch() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideAutoplaySwitch_enabled"]; return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideAutoplaySwitch_enabled"];
} }
BOOL hidePreviousAndNextButton() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hidePreviousAndNextButton_enabled"];
}
BOOL castConfirm() { BOOL castConfirm() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"castConfirm_enabled"]; return [[NSUserDefaults standardUserDefaults] boolForKey:@"castConfirm_enabled"];
} }
BOOL ytMiniPlayer() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"ytMiniPlayer_enabled"];
}
UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0]; // Tweaks
// YTMiniPlayerEnabler: https://github.com/level3tjg/YTMiniplayerEnabler/
%hook YTWatchMiniBarViewController
- (void)updateMiniBarPlayerStateFromRenderer {
if (ytMiniPlayer()) {}
else { return %orig; }
}
%end
// Hide CC / Autoplay switch // Hide CC / Autoplay switch
%hook YTMainAppControlsOverlayView %hook YTMainAppControlsOverlayView
- (void)setClosedCaptionsOrSubtitlesButtonAvailable:(BOOL)arg1 { // hide CC?!
if (hideCC()) { return %orig(NO); }
else { return %orig; }
}
- (void)setAutoplaySwitchButtonRenderer:(id)arg1 {
if (hideAutoplaySwitch()) {}
else { return %orig; }
}
- (void)layoutSubviews { - (void)layoutSubviews {
%orig; if (hidePreviousAndNextButton()) {
if (hideAutoplaySwitch()) MSHookIvar<YTMainAppControlsOverlayView *>(self, "_nextButton").hidden = YES;
MSHookIvar<UIView *>(self, "_autonavSwitch").hidden = YES; MSHookIvar<YTMainAppControlsOverlayView *>(self, "_previousButton").hidden = YES;
if (hideCC()) %orig;
MSHookIvar<UIView *>(self, "_closedCaptionsOrSubtitlesButton").hidden = YES; }
return %orig;
} }
%end %end
@@ -87,41 +112,40 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
%end %end
//YTCastConfirm: https://github.com/JamieBerghmans/YTCastConfirm //YTCastConfirm: https://github.com/JamieBerghmans/YTCastConfirm
%group gYTCastconfirm
%hook MDXPlaybackRouteButtonController %hook MDXPlaybackRouteButtonController
- (void)didPressButton:(id)arg1 { - (void)didPressButton:(id)arg1 {
if (castConfirm()) { UIAlertController* alertController = [%c(UIAlertController) alertControllerWithTitle:@"Casting"
UIAlertController* alertController = [%c(UIAlertController) alertControllerWithTitle:@"Casting" message:@"Are you sure you want to start casting?"
message:@"Are you sure you want to start casting?" preferredStyle:UIAlertControllerStyleAlert];
preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* defaultAction = [%c(UIAlertAction) actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
UIAlertAction* defaultAction = [%c(UIAlertAction) actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { %orig;
%orig; }];
}];
UIAlertAction* noButton = [%c(UIAlertAction) UIAlertAction* noButton = [%c(UIAlertAction)
actionWithTitle:@"Cancel" actionWithTitle:@"Cancel"
style:UIAlertActionStyleDefault style:UIAlertActionStyleDefault
handler: ^(UIAlertAction * action) { handler: ^(UIAlertAction * action) { return; }
return; ];
}];
[alertController addAction:defaultAction]; [alertController addAction:defaultAction];
[alertController addAction:noButton]; [alertController addAction:noButton];
id rootViewController = [%c(UIApplication) sharedApplication].delegate.window.rootViewController; id rootViewController = [%c(UIApplication) sharedApplication].delegate.window.rootViewController;
if ([rootViewController isKindOfClass:[%c(UINavigationController) class]]) { if ([rootViewController isKindOfClass:[%c(UINavigationController) class]]) {
rootViewController = ((UINavigationController *)rootViewController).viewControllers.firstObject; rootViewController = ((UINavigationController *)rootViewController).viewControllers.firstObject;
}
if ([rootViewController isKindOfClass:[%c(UITabBarController) class]]) {
rootViewController = ((UITabBarController *)rootViewController).selectedViewController;
}
if ([rootViewController presentedViewController] != nil) {
rootViewController = [rootViewController presentedViewController];
}
[rootViewController presentViewController:alertController animated:YES completion:nil];
} }
if ([rootViewController isKindOfClass:[%c(UITabBarController) class]]) {
rootViewController = ((UITabBarController *)rootViewController).selectedViewController;
}
if ([rootViewController presentedViewController] != nil) {
rootViewController = [rootViewController presentedViewController];
}
[rootViewController presentViewController:alertController animated:YES completion:nil];
return %orig; return %orig;
} }
%end %end
%end
// Workaround for https://github.com/MiRO92/uYou-for-YouTube/issues/12 // Workaround for https://github.com/MiRO92/uYou-for-YouTube/issues/12
%hook YTAdsInnerTubeContextDecorator %hook YTAdsInnerTubeContextDecorator
@@ -176,333 +200,265 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
- (void)showSurveyWithRenderer:(id)arg1 surveyParentResponder:(id)arg2 {} - (void)showSurveyWithRenderer:(id)arg1 surveyParentResponder:(id)arg2 {}
%end %end
// OLED // Hide the download playlist button of uYou cuz it's broken
// Thanks u/DGh0st for his very well explained comment - https://www.reddit.com/r/jailbreakdevelopers/comments/9uape7/comment/e94sq80/ %hook YTPlaylistHeaderViewController
// Thanks sinfool for his flex patch which brings OLED Dark mode for YouTube - "Color Customizer (YouTube) OLED" - (void)viewDidLoad {
%orig;
self.downloadsButton.hidden = YES;
}
%end
// OLED dark mode by BandarHL
UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
%group gOLED %group gOLED
%hook UIView %hook YTCommonColorPalette
- (void)setBackgroundColor:(id)arg1 { - (UIColor *)brandBackgroundSolid {
if ([self.nextResponder isKindOfClass:%c(YTLinkCell)]) if (self.pageStyle == 1) {
arg1 = oledColor; return oledColor;
if ([self.nextResponder isKindOfClass:%c(YTCommentsHeaderView)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTSearchView)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTSearchBoxView)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTEngagementPanelHeaderView)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTEngagementPanelView)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTPivotBarView)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTHUDMessageView)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTChipCloudCell)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YCHLiveChatTextCell)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YCHLiveChatView)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YCHLiveChatViewerEngagementCell)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTSlideForActionsView)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTPlaylistHeaderView)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTAsyncCollectionView)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTFeedHeaderView)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTMessageCell)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTPlaylistPanelProminentThumbnailVideoCell)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(ASWAppSwitcherCollectionViewCell)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTEditSheetControllerHeader)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTDialogContainerScrollView)])
arg1 = oledColor;
%orig;
}
%end
%hook YTLightweightQTMButton
- (void)setBackgroundColor:(id)arg1 {
if ([self.nextResponder isKindOfClass:%c(YTShareMainView)])
arg1 = oledColor;
%orig;
}
- (void)setCustomTitleColor:(id)arg1 { %orig([UIColor whiteColor]); }
%end
%hook NIAttributedLabel
- (void)setBackgroundColor:(id)arg1 {
if ([self.nextResponder isKindOfClass:%c(UIScrollView)])
arg1 = oledColor;
%orig;
}
%end
%hook UIControl // this sucks I know :/
- (void)setBackgroundColor:(id)arg1 {
if ([self.nextResponder isKindOfClass:%c(YTShareMainView)])
arg1 = oledColor;
%orig;
}
%end
%hook YTAsyncCollectionView
- (void)setBackgroundColor:(id)arg1 {
if([self.nextResponder isKindOfClass:%c(YTRelatedVideosCollectionViewController)]) {
arg1 = [oledColor colorWithAlphaComponent:0.0];
} else if([self.nextResponder isKindOfClass:%c(YTFullscreenMetadataHighlightsCollectionViewController)]) {
arg1 = [oledColor colorWithAlphaComponent:0.0];
} else {
arg1 = oledColor;
} }
%orig; return %orig;
}
- (UIColor *)brandBackgroundPrimary {
if (self.pageStyle == 1) {
return oledColor;
}
return %orig;
}
- (UIColor *)brandBackgroundSecondary {
if (self.pageStyle == 1) {
return oledColor;
}
return %orig;
}
- (UIColor *)staticBrandBlack {
if (self.pageStyle == 1) {
return oledColor;
}
return %orig;
}
- (UIColor *)generalBackgroundA {
if (self.pageStyle == 1) {
return oledColor;
}
return %orig;
}
%end
// Account view controller
%hook YTAccountPanelBodyViewController
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
if (pageStyle == 1) {
return oledColor;
}
return %orig;
}
%end
%hook YTInnerTubeCollectionViewController
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
if (pageStyle == 1) {
return oledColor;
}
return %orig;
}
%end
// Explore
%hook ASScrollView
- (void)didMoveToWindow {
if (isDarkMode()) {
self.backgroundColor = oledColor;
%orig;
}
}
%end
// uYou's page
%hook DownloadedVC
- (UIColor *)ytBackgroundColor {
if (isDarkMode()) {
return oledColor;
}
return %orig;
}
%end
%hook DownloadsPagerVC
- (UIColor *)ytBackgroundColor {
if (isDarkMode()) {
return oledColor;
}
return %orig;
}
%end
%hook DownloadingVC
- (UIColor *)ytBackgroundColor {
if (isDarkMode()) {
return oledColor;
}
return %orig;
}
%end
%hook PlayerVC
- (UIColor *)ytBackgroundColor {
if (isDarkMode()) {
return oledColor;
}
return %orig;
}
%end
// SponsorBlock settings
%hook SponsorBlockSettingsController
- (void)viewDidLoad {
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
%orig;
self.tableView.backgroundColor = oledColor;
} else {
return %orig();
}
}
%end
// uYou & YT player, and downloading view controller
%hook _LNPopupBarContentView
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig([UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.9]);
}
return %orig;
} }
%end %end
%hook YTWatchMiniBarView %hook YTWatchMiniBarView
- (void)setBackgroundColor:(id)arg1 { - (void)setBackgroundColor:(UIColor *)color {
arg1 = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.9]; if (isDarkMode()) {
%orig; return %orig([UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.9]);
}
return %orig;
} }
%end %end
%hook YTPlaylistMiniBarView // Search View
- (void)setBackgroundColor:(id)arg1 {
arg1 = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.9];
%orig;
}
%end
%hook _LNPopupBarContentView // uYou player
- (void)setBackgroundColor:(id)arg1 {
arg1 = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.9];
%orig;
}
%end
%hook YTTopAlignedView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
- (void)didMoveToWindow { // Dune - https://github.com/Skittyblock/Dune/blob/9b1df9790230115b7553cc9dbadf36889018d7f9/Tweak.xm#L70
MSHookIvar<UIView *>(self, "_contentView").backgroundColor = oledColor;
%orig;
}
%end
%hook DownloadedVC
- (id)ytBackgroundColor { return oledColor; }
%end
%hook DownloadsPagerVC
- (id)ytBackgroundColor { return oledColor; }
%end
%hook DownloadingVC
- (id)ytBackgroundColor { return oledColor; }
%end
%hook PlayerVC
- (id)ytBackgroundColor { return oledColor; }
%end
%hook ASScrollView // Explore
- (void)didMoveToWindow {
self.backgroundColor = oledColor;
%orig;
}
%end
%hook ASCollectionView // your videos
- (void)didMoveToWindow {
self.backgroundColor = oledColor;
%orig;
}
%end
%hook YTDialogContainerScrollView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook MDXQueueView // Cast queue
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTChannelProfileEditorView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTChannelSubMenuView //
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTChannelListSubMenuView // sub -
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTCommentView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTCreateCommentAccessoryView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTCreateCommentTextView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
- (void)setTextColor:(id)arg1 { %orig([UIColor whiteColor]); }
%end
%hook YCHLiveChatActionPanelView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTEmojiTextView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTShareTitleView // Share sheet
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTNavigationBar
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
- (void)setBarTintColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTPrivacyTosFooterView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTEngagementPanelHeaderView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTChannelMobileHeaderView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTInlineSignInView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTHeaderView //Stt bar
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTTabTitlesView // Tab bar - mychannel
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTSettingsCell // Settings
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTHorizontalCardListView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTShortsGalleryHeaderView // upload videos heaer (gallery)
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook GOODialogView // 3 dots menu
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTCollectionView //sharesheet
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook ASWAppSwitchingSheetHeaderView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook ASWAppSwitchingSheetFooterView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTCollectionSeparatorView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
- (void)didMoveToWindow {}
%end
%hook YTShareBusyView // sharesheet load
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTPageView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTWatchView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTSearchBarView %hook YTSearchBarView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); } - (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig (oledColor);
}
return %orig;
}
%end %end
%hook YTSearchBoxView %hook YTSearchBoxView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); } - (void)setBackgroundColor:(UIColor *)color {
%end if (isDarkMode()) {
return %orig (oledColor);
%hook YTSearchSuggestionCollectionViewCell }
- (void)updateColors {} return %orig;
%end
%hook UISearchBarBackground
- (void)setBarTintColor:(id)arg1 { %orig(oledColor); }
%end
%hook YTMealBarPromoView // Offline
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); }
%end
////
/*
%hook UICollectionView
- (void)setBackgroundColor:(id)arg1 {
if ([self.nextResponder isKindOfClass:%c(UICollectionViewControllerWrapperView)])
arg1 = oledColor;
%orig;
} }
%end %end
%hook _ASDisplayView // edit your videos // Comment view
- (void)layoutSubviews { %hook YTCreateCommentAccessoryView // community reply comment
if ([self.nextResponder isKindOfClass:%c(ELMView)]) - (void)setBackgroundColor:(UIColor *)color {
self.backgroundColor = oledColor; if (isDarkMode()) {
return %orig (oledColor);
}
return %orig;
} }
%end %end
%hook YTChannelProfileDescriptionEditorView // edit profile Description %hook YTCreateCommentTextView
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); } - (void)setBackgroundColor:(UIColor *)color {
%end if (isDarkMode()) {
return %orig (oledColor);
%hook YTChannelProfileNameEditorView // edit profile Name }
- (void)setBackgroundColor:(id)arg1 { %orig(oledColor); } return %orig;
%end }
- (void)setTextColor:(UIColor *)color { // fix black text in #Shorts video's comment
hook GOOTextField if (isDarkMode()) {
- (void)setBackgroundColor:(id)arg1 { // edit profile Description return %orig ([UIColor whiteColor]);
arg1 = oledColor; }
%orig; return %orig;
} }
%end %end
%hook GOOMultilineTextField// %hook YTFormattedStringLabel // YT is werid...
- (void)setBackgroundColor:(id)arg1 { // edit profile Name - (void)setBackgroundColor:(UIColor *)color {
arg1 = oledColor; if (isDarkMode()) {
%orig; return %orig ([UIColor clearColor]);
}
return %orig;
} }
%end %end
*/
%hook YCHLiveChatActionPanelView // live chat comment
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig (oledColor);
}
return %orig;
}
%end
%hook YTEmojiTextView // live chat comment
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig (oledColor);
}
return %orig;
}
%end
// Separation lines
%hook YTCollectionSeparatorView
- (void)didMoveToWindow {
if (isDarkMode()) {}
else {
return %orig();
}
}
%end
// Open link with...
%hook ASWAppSwitchingSheetHeaderView
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig (oledColor);
}
}
%end
%hook ASWAppSwitchingSheetFooterView
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig (oledColor);
}
}
%end
%hook ASWAppSwitcherCollectionViewCell
- (void)didMoveToWindow {
if (isDarkMode()) {
%orig;
self.subviews[1].backgroundColor = oledColor;
}
}
%end
// this sucks :/
// %hook UIView
// - (void)setBackgroundColor:(UIColor *)color {
// if (isDarkMode()) {
// if ([self.nextResponder isKindOfClass:%c(YTHUDMessageView)]) { color = oledColor; }
// %orig;
// }
// return %orig;
// }
// %end
%end %end
%group gOLEDKB // OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e %group gOLEDKB // OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e
@@ -600,7 +556,7 @@ static void replaceTab(YTIGuideResponse *response) {
%ctor { %ctor {
%init; %init;
if (oled() && ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1)) { if (oled()) {
%init(gOLED); %init(gOLED);
} }
if (oledKB()) { if (oledKB()) {
@@ -612,4 +568,7 @@ static void replaceTab(YTIGuideResponse *response) {
if (bigYTMiniPlayer() && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) { if (bigYTMiniPlayer() && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) {
%init(Main); %init(Main);
} }
if (castConfirm()) {
%init(gYTCastconfirm);
}
} }