Compare commits

...
Author SHA1 Message Date
qnblackcat ff5167af99 v17.16.4-2.1 2022-04-26 00:56:42 +07:00
qnblackcat 62b0168cff update submodules 2022-04-25 17:25:36 +07:00
qnblackcat 5d87e7ee1c update description 2022-04-25 17:03:00 +07:00
qnblackcat 6330c15d2e update submodule 2022-04-25 16:29:01 +07:00
qnblackcat de4f2f7373 clean up code 2022-04-24 22:23:05 +07:00
qnblackcat 67aba1f2ad added YTCastConfirm (JamieBerghmans), hide CC, Autoplay... 2022-04-24 22:22:08 +07:00
qnblackcat d89b146e3d v17.15.2-2.1 2022-04-22 20:21:04 +07:00
qnblackcat 0e2a4049c2 update submodules 2022-04-21 22:10:27 +07:00
qnblackcat 94b62ba4d3 update description 2022-04-21 22:08:08 +07:00
Nguyễn Đạt a3165878aa darker? 2022-04-21 11:08:48 +07:00
qnblackcat 702406f87f fix crash on iPad cz i'm suck 2022-04-19 21:36:21 +07:00
qnblackcat 32bd36c423 bug fix 2022-04-19 17:57:52 +07:00
qnblackcat 82d7c39fdb v17.15.1-2.1 2022-04-19 09:23:50 +07:00
8 changed files with 334 additions and 135 deletions
+27
View File
@@ -0,0 +1,27 @@
#import "Tweaks/YouTubeHeader/YTPlayerViewController.h"
@interface YTMainAppVideoPlayerOverlayView : UIView
-(UIViewController *)_viewControllerForAncestor;
@end
@interface YTWatchMiniBarView : UIView
@end
@interface YTAsyncCollectionView : UIView
@end
@interface YTPlayerViewController (YTAFS)
- (void)autoFullscreen;
@end
//@interface ASCollectionView : UIView
//@end
@interface YTLightweightQTMButton : UIView
@end
@interface YTELMView : UIView
@end
@interface NIAttributedLabel : UIView
@end
+2 -2
View File
@@ -10,8 +10,8 @@ TWEAK_NAME = uYouPlus
DISPLAY_NAME = YouTube
BUNDLE_ID = com.google.ios.youtube
uYouPlus_FILES = uYouPlus.xm
uYouPlus_IPA = /path/to/decrypted/YouTube/IPA
uYouPlus_FILES = uYouPlus.xm Settings.xm
uYouPlus_IPA = /path/to/your/decrypted/YouTube/IPA
### Important: edit the path to your decrypted YouTube IPA!!!
include $(THEOS)/makefiles/common.mk
+24 -23
View File
@@ -17,18 +17,18 @@
- [MiRO92](https://twitter.com/miro92) for [uYou](https://github.com/MiRO92/uYou-for-YouTube).
- [Galactic-Dev](https://github.com/Galactic-Dev) and [Luewii](https://github.com/Luewii) for [iSponsorBlock](https://github.com/Galactic-Dev/iSponsorBlock).
- [Galactic-Dev](https://github.com/Galactic-Dev) and [Luewii](https://github.com/Luewii) for [iSponsorBlock](https://github.com/Galactic-Dev/iSponsorBlock) and [BigYTMiniPlayer](https://github.com/Galactic-Dev/BigYTMiniPlayer).
- [HASHBANG Productions](https://github.com/hbang) for [Alderis Color Picker](https://github.com/hbang/Alderis) - a dependency of iSponsorBlock.
- [PoomSmart](https://twitter.com/poomsmart) - the developer of many tweaks used by uYouPlus, include: [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), [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: [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).
- [Al4ise](https://github.com/Al4ise) for [Azule](https://github.com/Al4ise/Azule), a tool used to inject jailbreak tweaks into jailed iOS apps.
- [Lyvendia](https://github.com/Lyvendia/) for [YTSpeed](https://github.com/Lyvendia/YTSpeed/)
- [Al4ise](https://github.com/Al4ise) for [Azule](https://github.com/Al4ise/Azule), a tool used to inject jailbreak tweaks into jailed iOS apps.
- [theos team](https://github.com/theos/theos) for theos & theos-jailed.
@@ -43,19 +43,21 @@
4. **YTUHD:** unlock VP9 codec and in effect, enables video quality of 2K and 4K. You can enable/disable YTUHD in YouTube Settings - Video quality preferences.
<details>
<summary>And more...!</summary>
<summary>And many more...!</summary>
5. **YTClassicVideoQuality:** since YouTube v16.xx, you need one more step to change the video quality. YTClassicVideoQuality brings back the old video quality selector, which is a lot better than the new one.
5. **YTAutoFullScreen:** autoplay videos at full screen.
6. **YTNoHoverCards:** offer an option to enable/disable the annoying suggested videos show up at the end of the videos.
6. **YTClassicVideoQuality:** since YouTube v16.xx, you need one more step to change the video quality. YTClassicVideoQuality brings back the old video quality selector, which is a lot better than the new one.
7. **YTSystemAppearance**: sync the YouTube theme (dark/light) with the system theme.
7. **YTNoHoverCards:** offer an option to enable/disable the annoying suggested videos show up at the end of the videos.
8. **YTNoCheckLocalNetwork**: block the Local Network permission popup.
8. **YTSystemAppearance**: sync the YouTube theme (dark/light) with the system theme.
9. **YouRememberCaption**: make YouTube remember your video caption setting (if not already).
9. **YTNoCheckLocalNetwork**: block the Local Network permission popup.
10. **YTSpeed**: add 2.25, 2.5, 2.75, and 3x playback speed
10. **YouRememberCaption**: make YouTube remember your video caption setting (if not already).
11. **YTSpeed**: add 2.25, 2.5, 2.75, and 3x playback speed
</details>
@@ -74,28 +76,32 @@
- My official AtlStore repo: https://qnblackcat.github.io/AltStore/
- [Open in AltStore (v17.14.2-2.1)](https://tinyurl.com/2a9ybxvu) - It will take a while to install because AltStore needs to download the IPA.
- [Open in AltStore (v17.16.4-2.1)](https://tinyurl.com/2p8t49r2) - It will take a while to install because AltStore needs to download the IPA.
- Version info: _(last update: Apr 13)_
- Version info: _(last update: Apr 25)_
<details>
<summary> Expand</summary>
| **Tweaks/App** | **Version** | **Open source** |
| :------------: | :----------:| :-------------: |
| **YouTube** | 17.14.2 | ✖︎ |
| **YouTube** | 17.16.4 | ✖︎ |
| **uYou** | 2.1 | ✖︎ |
| **Return YouTube Dislike** | 1.6.4 | [✔︎](https://github.com/PoomSmart/Return-YouTube-Dislikes) |
| **iSponsorBlock** | 1.0-14 | [✔︎](https://github.com/Galactic-Dev/iSponsorBlock) |
| **Alderis Color Picker** | 1.1.2| [✔︎](https://github.com/hbang/Alderis) |
| **YouRememberCaption** | 1.0.0 | [✔︎](https://www.ios-repo-updates.com/repository/poomsmart/package/com.ps.youremembercaption/) |
| **YouRememberCaption** | 1.0.0 | [✔︎](https://poomsmart.github.io/repo/depictions/youremembercaption.html) |
| **YTClassicVideoQuality** | 1.0.1 | [✔︎](https://github.com/PoomSmart/YTClassicVideoQuality) |
| **YTNoCheckLocalNetwork** | 1.0.2 | [✔︎](https://poomsmart.github.io/repo/depictions/ytnochecklocalnetwork.html) |
| **YTNoHoverCards** | 0.0.3 | [✔︎](https://github.com/level3tjg/YTNoHoverCards) |
| **YTSystemAppearance** | 1.0.0 | [✔︎](https://poomsmart.github.io/repo/depictions/ytsystemappearance.html) |
| **YTUHD** | 1.2.6 | [✔︎](https://github.com/PoomSmart/YTUHD) |
| **YouPiP** | 1.6.9 | [✔︎](https://github.com/PoomSmart/YouPiP) |
|**YTSpeed**| 1.0.1 | [✔︎](https://github.com/Lyvendia/YTSpeed.git) |
| **YTUHD** | 1.2.7 | [✔︎](https://github.com/PoomSmart/YTUHD) |
| **YouPiP** | 1.6.11 | [✔︎](https://github.com/PoomSmart/YouPiP) |
| **YTSpeed** | 1.0.1 | [✔︎](https://github.com/Lyvendia/YTSpeed) |
| **YTAutoFullScreen** | 1.0.3 | [✔︎](https://github.com/PoomSmart/YTAutoFullScreen/) |
| **YTReExplore** | 1.0.2 | [✔︎](https://github.com/PoomSmart/YTReExplore) |
| **BigYTMiniPlayer** | 1.0-1 | [✔︎](https://github.com/Galactic-Dev/BigYTMiniPlayer) |
| **YTCastConfirm** | 1.0.0 | [✔︎](https://github.com/JamieBerghmans/YTCastConfirm) |
</details>
@@ -127,11 +133,6 @@ See [Installation - Wiki](https://github.com/qnblackcat/uYouPlus/wiki/Installati
- Venmo: https://venmo.com/u/DavidBrett
</details>
<details>
<summary>Lillie</summary>
- Patreon: https://patreon.com/lillieweeb
</details>
# FAQ
+115
View File
@@ -0,0 +1,115 @@
#import "Tweaks/YouTubeHeader/YTSettingsSectionItem.h"
extern BOOL hideHUD();
extern BOOL oled();
extern BOOL autoFullScreen();
extern BOOL noHoverCard();
extern BOOL ReExplore();
extern BOOL bigYTMiniPlayer();
extern BOOL hideCC();
extern BOOL hideAutoplaySwitch();
extern BOOL castConfirm();
// Settings
%hook YTSettingsViewController
- (void)setSectionItems:(NSMutableArray <YTSettingsSectionItem *>*)sectionItems forCategory:(NSInteger)category title:(NSString *)title titleDescription:(NSString *)titleDescription headerHidden:(BOOL)headerHidden {
if (category == 1) {
NSUInteger statsForNerdsIndex = [sectionItems indexOfObjectPassingTest:^BOOL (YTSettingsSectionItem *item, NSUInteger idx, BOOL *stop) {
return item.settingItemId == 265;
}];
if (statsForNerdsIndex != NSNotFound) {
//
YTSettingsSectionItem *castConfirm = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Confirm alert before casting (YTCastConfirm)" titleDescription:@"Show a confirm alert before casting to prevent accidentally hijacking TV."];
castConfirm.hasSwitch = YES;
castConfirm.switchVisible = YES;
castConfirm.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"castConfirm_enabled"];
castConfirm.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"castConfirm_enabled"];
return YES;
};
[sectionItems insertObject:castConfirm atIndex:statsForNerdsIndex + 1];
//
YTSettingsSectionItem *hoverCardItem = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Show End screens hover cards (YTNoHoverCards)" titleDescription:@"Allows creator End screens (thumbnails) to appear at the end of videos."];
hoverCardItem.hasSwitch = YES;
hoverCardItem.switchVisible = YES;
hoverCardItem.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hover_cards_enabled"];
hoverCardItem.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hover_cards_enabled"];
return YES;
};
[sectionItems insertObject:hoverCardItem atIndex:statsForNerdsIndex + 1];
//
YTSettingsSectionItem *bigYTMiniPlayer = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"New miniplayer bar style (BigYTMiniPlayer)" titleDescription:@"App restart is required."];
bigYTMiniPlayer.hasSwitch = YES;
bigYTMiniPlayer.switchVisible = YES;
bigYTMiniPlayer.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"bigYTMiniPlayer_enabled"];
bigYTMiniPlayer.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"bigYTMiniPlayer_enabled"];
return YES;
};
[sectionItems insertObject:bigYTMiniPlayer atIndex:statsForNerdsIndex + 2];
//
YTSettingsSectionItem *reExplore = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Replace Shorts tab with Explore tab (YTReExplore)" titleDescription:@"App restart is required."];
reExplore.hasSwitch = YES;
reExplore.switchVisible = YES;
reExplore.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"reExplore_enabled"];
reExplore.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"reExplore_enabled"];
return YES;
};
[sectionItems insertObject:reExplore atIndex:statsForNerdsIndex + 2];
//
YTSettingsSectionItem *hideCC = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Hide Subtitles button" titleDescription:@"Hide the Subtitles button in video controls overlay. "];
hideCC.hasSwitch = YES;
hideCC.switchVisible = YES;
hideCC.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hideCC_enabled"];
hideCC.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideCC_enabled"];
return YES;
};
[sectionItems insertObject:hideCC atIndex:statsForNerdsIndex + 1];
//
YTSettingsSectionItem *hideAutoplaySwitch = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Hide Autoplay switch" titleDescription:@"Hide the Autoplay switch button in video controls overlay."];
hideAutoplaySwitch.hasSwitch = YES;
hideAutoplaySwitch.switchVisible = YES;
hideAutoplaySwitch.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hideAutoplaySwitch_enabled"];
hideAutoplaySwitch.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideAutoplaySwitch_enabled"];
return YES;
};
[sectionItems insertObject:hideAutoplaySwitch atIndex:statsForNerdsIndex + 1];
//
YTSettingsSectionItem *autoFUll = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Auto Full Screen (YTAutoFullScreen)" titleDescription:@"Autoplay videos at full screen."];
autoFUll.hasSwitch = YES;
autoFUll.switchVisible = YES;
autoFUll.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"autofull_enabled"];
autoFUll.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"autofull_enabled"];
return YES;
};
[sectionItems insertObject:autoFUll atIndex:statsForNerdsIndex + 3];
//
YTSettingsSectionItem *hideHUD = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Hide HUD Messages" titleDescription:@"Example: CC is turned on/off, Video loop is on,..."];
hideHUD.hasSwitch = YES;
hideHUD.switchVisible = YES;
hideHUD.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hideHUD_enabled"];
hideHUD.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideHUD_enabled"];
return YES;
};
[sectionItems insertObject:hideHUD atIndex:statsForNerdsIndex + 1];
//
YTSettingsSectionItem *Oleditem = [[%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."];
Oleditem.hasSwitch = YES;
Oleditem.switchVisible = YES;
Oleditem.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oled_enabled"];
Oleditem.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"oled_enabled"];
return YES;
};
[sectionItems insertObject:Oleditem atIndex:statsForNerdsIndex + 1];
}
}
%orig;
}
%end
+163 -107
View File
@@ -1,6 +1,7 @@
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#import "Header.h"
#import "Tweaks/YouTubeHeader/YTVideoQualitySwitchOriginalController.h"
#import "Tweaks/YouTubeHeader/YTSettingsSectionItem.h"
#import "Tweaks/YouTubeHeader/YTPlayerViewController.h"
@@ -12,19 +13,6 @@
#import "Tweaks/YouTubeHeader/YTIBrowseRequest.h"
#include <RemoteLog.h>
@interface YTMainAppVideoPlayerOverlayView : UIView
-(UIViewController *)_viewControllerForAncestor;
@end
@interface YTWatchMiniBarView : UIView
@end
@interface YTAsyncCollectionView : UIView
@end
@interface YTPlayerViewController (YTAFS)
- (void)autoFullscreen;
@end
UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
BOOL hideHUD() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideHUD_enabled"];
}
@@ -43,89 +31,37 @@ BOOL ReExplore() {
BOOL bigYTMiniPlayer() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"bigYTMiniPlayer_enabled"];
}
BOOL hideCC() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideCC_enabled"];
}
BOOL hideAutoplaySwitch() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideAutoplaySwitch_enabled"];
}
BOOL castConfirm() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"castConfirm_enabled"];
}
//Settings
%hook YTSettingsViewController
- (void)setSectionItems:(NSMutableArray <YTSettingsSectionItem *>*)sectionItems forCategory:(NSInteger)category title:(NSString *)title titleDescription:(NSString *)titleDescription headerHidden:(BOOL)headerHidden {
if (category == 1) {
NSUInteger statsForNerdsIndex = [sectionItems indexOfObjectPassingTest:^BOOL (YTSettingsSectionItem *item, NSUInteger idx, BOOL *stop) {
return item.settingItemId == 265;
}];
if (statsForNerdsIndex != NSNotFound) {
//
YTSettingsSectionItem *hoverCardItem = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Show End screens hover cards (YTNoHoverCards)" titleDescription:@"Allows creator End screens (thumbnails) to appear at the end of videos."];
hoverCardItem.hasSwitch = YES;
hoverCardItem.switchVisible = YES;
hoverCardItem.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hover_cards_enabled"];
hoverCardItem.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hover_cards_enabled"];
return YES;
};
[sectionItems insertObject:hoverCardItem atIndex:statsForNerdsIndex + 2];
//
YTSettingsSectionItem *Oleditem = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"OLED Dark mode (Experimental)" titleDescription:@"WARNING: You must set YouTube's appearance to Dark theme before enabling OLED dark mode (not tested on iPad yet). App restart is required."];
Oleditem.hasSwitch = YES;
Oleditem.switchVisible = YES;
Oleditem.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oled_enabled"];
Oleditem.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"oled_enabled"];
return YES;
};
[sectionItems insertObject:Oleditem atIndex:statsForNerdsIndex - 11];
//
YTSettingsSectionItem *autoFUll = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Auto Full Screen (YTAutoFullScreen)" titleDescription:@"Autoplay videos at full screen."];
autoFUll.hasSwitch = YES;
autoFUll.switchVisible = YES;
autoFUll.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"autofull_enabled"];
autoFUll.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"autofull_enabled"];
return YES;
};
[sectionItems insertObject:autoFUll atIndex:statsForNerdsIndex + 2];
//
YTSettingsSectionItem *hideHUD = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Hide HUD Messages" titleDescription:@"Example: CC is turned on/off, Video loop is on,... App restart is required."];
hideHUD.hasSwitch = YES;
hideHUD.switchVisible = YES;
hideHUD.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hideHUD_enabled"];
hideHUD.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideHUD_enabled"];
return YES;
};
[sectionItems insertObject:hideHUD atIndex:statsForNerdsIndex + 2];
//
YTSettingsSectionItem *reExplore = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Replace Shorts tab with Explore tab (YTReExplore)" titleDescription:@"App restart is required."];
reExplore.hasSwitch = YES;
reExplore.switchVisible = YES;
reExplore.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"reExplore_enabled"];
reExplore.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"reExplore_enabled"];
return YES;
};
[sectionItems insertObject:reExplore atIndex:statsForNerdsIndex + 4];
//
YTSettingsSectionItem *bigYTMiniPlayer = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Bigger miniplayer bar (BigYTMiniPlayer)" titleDescription:@"App restart is required."];
bigYTMiniPlayer.hasSwitch = YES;
bigYTMiniPlayer.switchVisible = YES;
bigYTMiniPlayer.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"bigYTMiniPlayer_enabled"];
bigYTMiniPlayer.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"bigYTMiniPlayer_enabled"];
return YES;
};
[sectionItems insertObject:bigYTMiniPlayer atIndex:statsForNerdsIndex + 4];
}
}
%orig;
}
UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
// Hide CC / Autoplay switch
%hook YTMainAppControlsOverlayView
- (void)layoutSubviews {
%orig();
if (hideAutoplaySwitch()) {
MSHookIvar<UIView *>(self, "_autonavSwitch").hidden = YES;
}
if (hideCC()) {
MSHookIvar<UIView *>(self, "_closedCaptionsOrSubtitlesButton").hidden = YES;
}
}
%end
// Hide HUD Messages
%hook YTHUDMessageView
- (id)initWithMessage:(id)arg1 dismissHandler:(id)arg2 {
if (hideHUD()) {
if (hideHUD()) {
return NULL;
}
else
return %orig;
} else { return %orig; }
}
%end
@@ -152,6 +88,42 @@ BOOL bigYTMiniPlayer() {
%orig;
}
%end
//YTCastConfirm: https://github.com/JamieBerghmans/YTCastConfirm
%hook MDXPlaybackRouteButtonController
-(void)didPressButton:(id)arg1 {
if (castConfirm()) {
UIAlertController* alertController = [%c(UIAlertController) alertControllerWithTitle:@"Casting"
message:@"Are you sure you want to start casting?"
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* defaultAction = [%c(UIAlertAction) actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
%orig;
}];
UIAlertAction* noButton = [%c(UIAlertAction)
actionWithTitle:@"Cancel"
style:UIAlertActionStyleDefault
handler: ^(UIAlertAction * action) {
return;
}];
[alertController addAction:defaultAction];
[alertController addAction:noButton];
id rootViewController = [%c(UIApplication) sharedApplication].delegate.window.rootViewController;
if([rootViewController isKindOfClass:[%c(UINavigationController) class]]) {
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];
} else { return %orig; }
}
%end
// Workaround for https://github.com/MiRO92/uYou-for-YouTube/issues/12
%hook YTAdsInnerTubeContextDecorator
@@ -181,13 +153,17 @@ BOOL bigYTMiniPlayer() {
// OLED
// Thanks u/DGh0st for his very well explained comment - https://www.reddit.com/r/jailbreakdevelopers/comments/9uape7/comment/e94sq80/
// Thanks sinfool for his flex patch which brings OLED Dark mode for YouTube - "Color Customizer (YouTube) OLED"
%group gOLED
%group gOLED
%hook UIView
-(void)setBackgroundColor:(id)arg1 {
if ([self.nextResponder isKindOfClass:%c(DownloadedVC)]) //uYou
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(DownloadsPagerVC)]) //uYou
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(DownloadingVC)]) //uYou
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(PlayerVC)]) //uYou
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTLinkCell)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTCommentsHeaderView)])
@@ -224,20 +200,27 @@ BOOL bigYTMiniPlayer() {
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(ASWAppSwitcherCollectionViewCell)])
arg1 = oledColor;
if ([self.nextResponder isKindOfClass:%c(YTEditSheetControllerHeader)])
arg1 = oledColor;
%orig;
}
}
//- (void)layoutSubviews {
// %orig;
// if ([self.nextResponder isKindOfClass:%c(YTALDialog)])
// self.backgroundColor = oledColor;
//}
%end
%hook YTAsyncCollectionView
-(void)setBackgroundColor:(id)arg1 {
if([self.nextResponder isKindOfClass:%c(YTRelatedVideosCollectionViewController)]) {
arg1 = [oledColor colorWithAlphaComponent:0.0];
arg1 = [oledColor colorWithAlphaComponent:0.0];
} else if([self.nextResponder isKindOfClass:%c(YTFullscreenMetadataHighlightsCollectionViewController)]) {
arg1 = [oledColor colorWithAlphaComponent:0.0];
} else {
arg1 = oledColor;
arg1 = [oledColor colorWithAlphaComponent:0.0];
} else {
arg1 = oledColor;
}
%orig;
}
}
%end
@@ -350,6 +333,13 @@ BOOL bigYTMiniPlayer() {
}
%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 YTEngagementPanelHeaderView
-(void)setBackgroundColor:(id)arg1 {
arg1 = oledColor;
@@ -404,7 +394,7 @@ BOOL bigYTMiniPlayer() {
arg1 = oledColor;
%orig;
}
%end
%end
%hook ASWAppSwitchingSheetHeaderView
-(void)setBackgroundColor:(id)arg1 {
@@ -428,6 +418,26 @@ BOOL bigYTMiniPlayer() {
- (void)layoutSubviews {}
%end
%hook YTLightweightQTMButton
-(void)setBackgroundColor:(id)arg1 {
if([self.nextResponder isKindOfClass:%c(YTShareMainView)]) {
arg1 = oledColor;
%orig;
}
}
-(void)setCustomTitleColor:(id)arg1 {
arg1 = [UIColor whiteColor];
%orig;
}
%end
%hook YTShareBusyView // sharesheet load
-(void)setBackgroundColor:(id)arg1 {
arg1 = oledColor;
%orig;
}
%end
%hook YTSearchSuggestionCollectionViewCell
-(void)updateColors {}
%end
@@ -439,25 +449,72 @@ BOOL bigYTMiniPlayer() {
}
%end
%hook YTELMView // upload videos
-(void)layoutSubviews {
%orig;
self.backgroundColor = oledColor;
}
%end
%hook YTMealBarPromoView
-(void)setBackgroundColor:(id)arg1 { // Offline
arg1 = oledColor;
%orig;
}
%end
%hook NIAttributedLabel
-(void)setBackgroundColor:(id)arg1 {
if ([self.nextResponder isKindOfClass:%c(UIScrollView)])
arg1 = oledColor;
%orig;
}
%end
////
/*
%hook YTShortsGalleryHeaderView // upload videos heaer (gallery)
-(void)setBackgroundColor:(id)arg1 {
arg1 = oledColor;
%orig;
}
%end
%hook _ASDisplayView // edit your videos
-(void)layoutSubviews {
if ([self.nextResponder isKindOfClass:%c(ELMView)]) //uYou
self.backgroundColor = oledColor;
}
%end
%hook ASCollectionView
-(void)layoutSubviews {
self.backgroundColor = oledColor;
%orig;
}
%end
%hook YTChannelProfileDescriptionEditorView // edit profile Description
-(void)setBackgroundColor:(id)arg1 {
arg1 = oledColor;
%orig;
}
%end
%hook YTChannelProfileNameEditorView // edit profile Name
-(void)setBackgroundColor:(id)arg1 {
arg1 = oledColor;
%orig;
}
%end
hook GOOTextField
-(void)setBackgroundColor:(id)arg1 { // edit profile Description
arg1 = oledColor;
%orig;
}
%end
%hook GOOMultilineTextField//
-(void)setBackgroundColor:(id)arg1 { // edit profile Name
arg1 = oledColor;
@@ -465,7 +522,6 @@ hook GOOTextField
}
%end
*/
%end
// YTReExplore: https://github.com/PoomSmart/YTReExplore/
@@ -529,13 +585,13 @@ static void replaceTab(YTIGuideResponse *response) {
%ctor {
%init;
if (oled()) {
%init(gOLED);
if (oled() && ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1)) {
%init(gOLED);
}
if (ReExplore()) {
%init(gReExplore)
}
if (bigYTMiniPlayer() && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) {
%init(Main)
}
}
if (ReExplore()) {
%init(gReExplore)
}
if (bigYTMiniPlayer() && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) {
%init(Main)
}
}