Updated a lot of uYouEnhanced Code. (v19.40.4-3.0.4)

This release also includes all of the new changes from qnblackcat/uYouPlus.
and the App Version Spoofer has finally been updated again!
This commit is contained in:
aric3435 (INACTIVE) 2024-10-10 00:40:33 -05:00 committed by GitHub
parent ae5558784e
commit 35e97ea8dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 1529 additions and 983 deletions

View file

@ -2,11 +2,9 @@
#import <YouTubeHeader/YTAssetLoader.h>
@interface AppIconOptionsController () <UITableViewDataSource, UITableViewDelegate>
@property (strong, nonatomic) UITableView *tableView;
@property (strong, nonatomic) NSArray<NSString *> *appIcons;
@property (assign, nonatomic) NSInteger selectedIconIndex;
@end
@implementation AppIconOptionsController
@ -15,8 +13,6 @@
[super viewDidLoad];
self.title = @"Change App Icon";
[self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName: [UIFont fontWithName:@"YTSans-Bold" size:22], NSForegroundColorAttributeName: [UIColor whiteColor]}];
self.selectedIconIndex = -1;
self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
@ -25,28 +21,11 @@
[self.view addSubview:self.tableView];
self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];
NSBundle *backIcon = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"uYouPlus" ofType:@"bundle"]];
UIImage *backImage = [UIImage imageNamed:@"Back.png" inBundle:backIcon compatibleWithTraitCollection:nil];
backImage = [self resizeImage:backImage newSize:CGSizeMake(24, 24)];
backImage = [backImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[self.backButton setTintColor:[UIColor whiteColor]];
[self.backButton setImage:backImage forState:UIControlStateNormal];
[self.backButton setImage:[UIImage customBackButtonImage] forState:UIControlStateNormal];
[self.backButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
[self.backButton setFrame:CGRectMake(0, 0, 24, 24)];
UIBarButtonItem *customBackButton = [[UIBarButtonItem alloc] initWithCustomView:self.backButton];
self.navigationItem.leftBarButtonItem = customBackButton;
UIColor *buttonColor = [UIColor colorWithRed:203.0/255.0 green:22.0/255.0 blue:51.0/255.0 alpha:1.0];
UIImage *resetImage = [UIImage systemImageNamed:@"arrow.clockwise.circle.fill"];
UIBarButtonItem *resetButton = [[UIBarButtonItem alloc] initWithImage:resetImage style:UIBarButtonItemStylePlain target:self action:@selector(resetIcon)];
resetButton.tintColor = buttonColor;
UIImage *saveImage = [UIImage systemImageNamed:@"square.and.arrow.up.fill"];
UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithImage:saveImage style:UIBarButtonItemStylePlain target:self action:@selector(saveIcon)];
saveButton.tintColor = buttonColor;
self.navigationItem.rightBarButtonItems = @[saveButton, resetButton];
NSString *path = [[NSBundle mainBundle] pathForResource:@"uYouPlus" ofType:@"bundle"];
NSBundle *bundle = [NSBundle bundleWithPath:path];
self.appIcons = [bundle pathsForResourcesOfType:@"png" inDirectory:@"AppIcons"];
@ -77,14 +56,8 @@
cell.imageView.image = iconImage;
cell.imageView.layer.cornerRadius = 10.0;
cell.imageView.clipsToBounds = YES;
cell.imageView.frame = CGRectMake(10, 10, 40, 40);
cell.textLabel.frame = CGRectMake(60, 10, self.view.frame.size.width - 70, 40);
if (indexPath.row == self.selectedIconIndex) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
} else {
cell.accessoryType = UITableViewCellAccessoryNone;
}
cell.accessoryType = (indexPath.row == self.selectedIconIndex) ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
return cell;
}
@ -97,11 +70,6 @@
}
- (void)resetIcon {
NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
NSMutableDictionary *infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath];
[infoDict removeObjectForKey:@"ALTAppIcon"];
[infoDict writeToFile:plistPath atomically:YES];
[[UIApplication sharedApplication] setAlternateIconName:nil completionHandler:^(NSError * _Nullable error) {
if (error) {
NSLog(@"Error resetting icon: %@", error.localizedDescription);
@ -109,70 +77,37 @@
} else {
NSLog(@"Icon reset successfully");
[self showAlertWithTitle:@"Success" message:@"Icon reset successfully"];
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
});
[self.tableView reloadData];
}
}];
}
- (void)saveIcon {
if (![UIApplication sharedApplication].supportsAlternateIcons) {
NSLog(@"Alternate icons are not supported on this device.");
if (self.selectedIconIndex < 0) {
[self showAlertWithTitle:@"Error" message:@"No icon selected"];
return;
}
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSString *selectedIcon = self.selectedIconIndex >= 0 ? self.appIcons[self.selectedIconIndex] : nil;
if (selectedIcon) {
NSString *iconName = [selectedIcon.lastPathComponent stringByDeletingPathExtension];
NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
NSMutableDictionary *infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath];
[infoDict setObject:iconName forKey:@"ALTAppIcon"];
[infoDict writeToFile:plistPath atomically:YES];
[[UIApplication sharedApplication] setAlternateIconName:iconName completionHandler:^(NSError * _Nullable error) {
if (error) {
NSLog(@"Error setting alternate icon: %@", error.localizedDescription);
[self showAlertWithTitle:@"Error" message:@"Failed to set alternate icon"];
} else {
NSLog(@"Alternate icon set successfully");
[self showAlertWithTitle:@"Success" message:@"Alternate icon set successfully"];
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
});
}
}];
NSString *selectedIcon = self.appIcons[self.selectedIconIndex];
NSString *iconName = [selectedIcon.lastPathComponent stringByDeletingPathExtension];
[[UIApplication sharedApplication] setAlternateIconName:iconName completionHandler:^(NSError * _Nullable error) {
if (error) {
NSLog(@"Error setting alternate icon: %@", error.localizedDescription);
[self showAlertWithTitle:@"Error" message:@"Failed to set alternate icon"];
} else {
NSLog(@"Selected icon path is nil");
NSLog(@"Alternate icon set successfully");
[self showAlertWithTitle:@"Success" message:@"Alternate icon set successfully"];
[self.tableView reloadData];
}
});
}
- (UIImage *)resizeImage:(UIImage *)image toSize:(CGSize)size {
UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);
[image drawInRect:CGRectMake(0, 0, size.width, size.height)];
UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return resizedImage;
}
- (UIImage *)resizeImage:(UIImage *)image newSize:(CGSize)newSize {
UIGraphicsBeginImageContextWithOptions(newSize, NO, [UIScreen mainScreen].scale);
[image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}];
}
- (void)showAlertWithTitle:(NSString *)title message:(NSString *)message {
dispatch_async(dispatch_get_main_queue(), ^{
UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
[alert addAction:okAction];
[self presentViewController:alert animated:YES completion:nil];
});
UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
[alert addAction:okAction];
[self presentViewController:alert animated:YES completion:nil];
}
- (void)back {

View file

@ -25,7 +25,7 @@
%end
%ctor {
if (IS_ENABLED(@"bigYTMiniPlayer_enabled") && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) {
if (IS_ENABLED(kBigYTMiniPlayer) && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) {
%init(BigYTMiniPlayer);
}
}

View file

@ -10,10 +10,13 @@ static BOOL lowContrastMode() {
static BOOL customContrastMode() {
return IS_ENABLED(@"lowContrastMode_enabled") && contrastMode() == 1;
}
// static UIColor *whiteTextColor() {
// return [UIColor whiteColor];
// }
UIColor *lcmHexColor;
%group gLowContrastMode // Low Contrast Mode v1.5.2 (Compatible with only YouTube v17.33.2-v17.38.10)
%group gLowContrastMode // Low Contrast Mode v1.6.0 BETA (Compatible with only YouTube v17.33.2-v17.38.10)
%hook UIColor
+ (UIColor *)whiteColor { // Dark Theme Color
return [UIColor colorWithRed: 0.56 green: 0.56 blue: 0.56 alpha: 1.00];
@ -54,39 +57,51 @@ UIColor *lcmHexColor;
%end
%hook YTCommonColorPalette
- (UIColor *)textPrimary {
NSLog(@"LowContrastMode: textPrimary called");
return self.pageStyle == 1 ? [UIColor whiteColor] : %orig;
}
- (UIColor *)textSecondary {
NSLog(@"LowContrastMode: textSecondary called");
return self.pageStyle == 1 ? [UIColor whiteColor] : %orig;
}
- (UIColor *)overlayTextPrimary {
NSLog(@"LowContrastMode: overlayTextPrimary called");
return self.pageStyle == 1 ? [UIColor whiteColor] : %orig;
}
- (UIColor *)overlayTextSecondary {
NSLog(@"LowContrastMode: overlayTextSecondary called");
return self.pageStyle == 1 ? [UIColor whiteColor] : %orig;
}
- (UIColor *)iconActive {
NSLog(@"LowContrastMode: iconActive called");
return self.pageStyle == 1 ? [UIColor whiteColor] : %orig;
}
- (UIColor *)iconActiveOther {
NSLog(@"LowContrastMode: iconActiveOther called");
return self.pageStyle == 1 ? [UIColor whiteColor] : %orig;
}
- (UIColor *)brandIconActive {
NSLog(@"LowContrastMode: brandIconActive called");
return self.pageStyle == 1 ? [UIColor whiteColor] : %orig;
}
- (UIColor *)staticBrandWhite {
NSLog(@"LowContrastMode: staticBrandWhite called");
return self.pageStyle == 1 ? [UIColor whiteColor] : %orig;
}
- (UIColor *)overlayIconActiveOther {
NSLog(@"LowContrastMode: overlayIconActiveOther called");
return self.pageStyle == 1 ? [UIColor whiteColor] : %orig;
}
- (UIColor *)overlayIconInactive {
NSLog(@"LowContrastMode: overlayIconInactive called");
return self.pageStyle == 1 ? [[UIColor whiteColor] colorWithAlphaComponent:0.7] : %orig;
}
- (UIColor *)overlayIconDisabled {
NSLog(@"LowContrastMode: overlayIconDisabled called");
return self.pageStyle == 1 ? [[UIColor whiteColor] colorWithAlphaComponent:0.3] : %orig;
}
- (UIColor *)overlayFilledButtonActive {
NSLog(@"LowContrastMode: overlayFilledButtonActive called");
return self.pageStyle == 1 ? [[UIColor whiteColor] colorWithAlphaComponent:0.2] : %orig;
}
%end
@ -246,12 +261,21 @@ UIColor *lcmHexColor;
[modifiedAttributes setObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
%orig(modifiedAttributes, state);
}
- (void)setCustomTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state {
NSMutableDictionary *customAttributes = [NSMutableDictionary dictionaryWithDictionary:attributes];
[customAttributes setObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
%orig(customAttributes, state);
}
%end
%hook UIButton
- (void)setTitleColor:(UIColor *)color forState:(UIControlState)state {
color = [UIColor whiteColor];
%orig(color, state);
}
- (void)setCustomTitleColor:(UIColor *)color forState:(UIControlState)state {
color = [UIColor whiteColor];
%orig(color, state);
}
%end
%hook UIBarButtonItem
- (void)setTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state {
@ -259,6 +283,11 @@ UIColor *lcmHexColor;
[modifiedAttributes setObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
%orig(modifiedAttributes, state);
}
- (void)setCustomTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state {
NSMutableDictionary *customAttributes = [NSMutableDictionary dictionaryWithDictionary:attributes];
[customAttributes setObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
%orig(customAttributes, state);
}
%end
%hook NSAttributedString
- (instancetype)initWithString:(NSString *)str attributes:(NSDictionary<NSAttributedStringKey, id> *)attrs {
@ -550,7 +579,18 @@ UIColor *lcmHexColor;
%end
%hook CATextLayer
- (void)setTextColor:(CGColorRef)textColor {
%orig([UIColor whiteColor].CGColor);
%orig([[UIColor whiteColor] CGColor]);
}
%end
%hook _ASDisplayView
- (void)setAttributedText:(NSAttributedString *)attributedText {
NSMutableAttributedString *newAttributedString = [attributedText mutableCopy];
[newAttributedString addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, newAttributedString.length)];
%orig(newAttributedString);
}
- (void)setTextColor:(UIColor *)textColor {
textColor = [UIColor whiteColor];
%orig(textColor);
}
%end
%hook ASTextNode
@ -563,20 +603,20 @@ UIColor *lcmHexColor;
%end
%hook ASTextFieldNode
- (void)setTextColor:(UIColor *)textColor {
%orig([UIColor whiteColor]);
%orig([UIColor whiteColor]);
}
%end
%hook ASTextView
- (void)setTextColor:(UIColor *)textColor {
%orig([UIColor whiteColor]);
%orig([UIColor whiteColor]);
}
%end
%hook ASButtonNode
- (void)setTextColor:(UIColor *)textColor {
%orig([UIColor whiteColor]);
%orig([UIColor whiteColor]);
}
%end
%hook UIControl // snackbar fix for lcm
%hook UIControl
- (UIColor *)backgroundColor {
return [UIColor blackColor];
}

View file

@ -1,16 +1,11 @@
#import "uYouPlus.h"
#import "uYouPlusSettings.h"
// Keys for "Copy settings" button (for: uYouEnhanced)
// In alphabetical order for tweaks after uYouEnhanced
NSArray *NSUserDefaultsCopyKeys = @[
// uYouEnhanced - gathered using get_keys.py
@"autoHideHomeBar_enabled", @"bigYTMiniPlayer_enabled", @"centerYouTubeLogo_enabled", @"classicVideoPlayer_enabled", @"disableAmbientMode_enabled", @"disableAnimatedYouTubeLogo_enabled", @"disableChapterSkip_enabled", @"disableCollapseButton_enabled", @"disableFullscreenButton_enabled", @"disableHints_enabled",
@"disableLiveChatSection_enabled", @"disableManageAllHistorySection_enabled", @"disableModernButtons_enabled", @"disableModernFlags_enabled", @"disableNotificationsSection_enabled", @"disablePrivacySection_enabled", @"disablePullToFull_enabled", @"disableRemainingTime_enabled", @"disableResumeToShorts_enabled",@"disableRoundedHints_enabled", @"disableTryNewFeaturesSection_enabled", @"disableVideoQualityPreferencesSection_enabled", @"disableAccountSection_enabled",
@"doubleTapToSeek_disabled", @"enableShareButton_enabled", @"enableSaveToButton_enabled", @"enableVersionSpoofer_enabled", @"fixLowContrastMode_enabled", @"flex_enabled", @"hideAutoplaySwitch_enabled", @"hideBuySuperThanks_enabled", @"hideCC_enabled", @"hideChannelHeaderLinks_enabled", @"hideChannelWatermark_enabled",
@"hideChipBar_enabled", @"hideClipButton_enabled", @"hideCommentSection_enabled", @"hideCommunityPosts_enabled", @"hideConnectButton_enabled", @"hideDownloadButton_enabled", @"hideDoubleTapToSeekOverlay_enabled", @"hideFullscreenActions_enabled", @"hideHeatwaves_enabled", @"hideHomeTab_enabled", @"hideHoverCards_enabled", @"hideHUD_enabled", @"hideModernFlags_enabled", @"hidePaidPromotionCard_enabled", @"hidePlayNextInQueue_enabled",
@"hidePreviewCommentSection_enabled", @"hidePreviousAndNextButton_enabled", @"hideRemixButton_enabled", @"hideReportButton_enabled", @"hideRightPanel_enabled", @"hideShareButton_enabled", @"hideSponsorBlockButton_enabled", @"hideSubcriptions_enabled", @"hideSubscriptionsNotificationBadge_enabled", @"hideThanksButton_enabled", @"hideVideoPlayerShadowOverlayButtons_enabled", @"hideVideoTitle_enabled", @"hideYouTubeLogo_enabled",
@"lowContrastMode_enabled", @"newSettingsUI_enabled", @"noRelatedWatchNexts_enabled", @"noSuggestedVideo_enabled", @"noVideosInFullscreen_enabled",
@"pinchToZoom_enabled", @"portraitFullscreen_enabled", @"redProgressBar_enabled", @"redSubscribeButton_enabled", @"reExplore_enabled", @"shortsQualityPicker_enabled", @"slideToSeek_enabled", @"snapToChapter_enabled", @"stockVolumeHUD_enabled", @"stickNavigationBar_enabled", @"uYouAdBlockingWorkaround_enabled", @"uYouAdBlockingWorkaroundLite_enabled", @"ytMiniPlayer_enabled", @"ytNoModernUI_enabled", @"ytStartupAnimation_enabled",
kReplaceCopyandPasteButtons, kAppTheme, kOLEDKeyboard, kPortraitFullscreen, kFullscreenToTheRight, kSlideToSeek, kYTTapToSeek, kDoubleTapToSeek, kSnapToChapter, kPinchToZoom, kYTMiniPlayer, kStockVolumeHUD, kReplaceYTDownloadWithuYou, kDisablePullToFull, kDisableChapterSkip, kAlwaysShowRemainingTime, kDisableRemainingTime, kEnableShareButton, kEnableSaveToButton, kHideYTMusicButton, kHideAutoplaySwitch, kHideCC, kHideVideoTitle, kDisableCollapseButton, kDisableFullscreenButton, kHideHUD, kHidePaidPromotionCard, kHideChannelWatermark, kHideVideoPlayerShadowOverlayButtons, kHidePreviousAndNextButton, kRedProgressBar, kHideHoverCards, kHideRightPanel, kHideFullscreenActions, kHideSuggestedVideo, kHideHeatwaves, kHideDoubleTapToSeekOverlay, kHideOverlayDarkBackground, kDisableAmbientMode, kHideVideosInFullscreen, kHideRelatedWatchNexts, kHideBuySuperThanks, kHideSubscriptions, kShortsQualityPicker, kRedSubscribeButton, kHideButtonContainers, kHideConnectButton, kHideShareButton, kHideRemixButton, kHideThanksButton, kHideDownloadButton, kHideClipButton, kHideSaveToPlaylistButton, kHideReportButton, kHidePreviewCommentSection, kHideCommentSection, kDisableAccountSection, kDisableAutoplaySection, kDisableTryNewFeaturesSection, kDisableVideoQualityPreferencesSection, kDisableNotificationsSection, kDisableManageAllHistorySection, kDisableYourDataInYouTubeSection, kDisablePrivacySection, kDisableLiveChatSection, kHidePremiumPromos, kHideHomeTab, kLowContrastMode, kClassicVideoPlayer, kFixLowContrastMode, kDisableModernButtons, kDisableRoundedHints, kDisableModernFlags, kYTNoModernUI, kEnableVersionSpoofer, kGoogleSignInPatch, kAdBlockWorkaroundLite, kAdBlockWorkaround, kYouTabFakePremium, kDisableAnimatedYouTubeLogo, kCenterYouTubeLogo, kHideYouTubeLogo, kYTStartupAnimation, kDisableHints, kStickNavigationBar, kHideiSponsorBlockButton, kHideChipBar, kHidePlayNextInQueue, kHideCommunityPosts, kHideChannelHeaderLinks, kiPhoneLayout, kBigYTMiniPlayer, kReExplore, kAutoHideHomeBar, kHideSubscriptionsNotificationBadge, kFixCasting, kNewSettingsUI, kFlex, kGoogleSigninFix,
// uYou - https://github.com/MiRO92/uYou-for-YouTube
@"showedWelcomeVC", @"hideShortsTab", @"hideCreateTab", @"hideCastButton", @"relatedVideosAtTheEndOfYTVideos", @"removeYouTubeAds", @"backgroundPlayback", @"disableAgeRestriction", @"iPadLayout", @"noSuggestedVideoAtEnd", @"shortsProgressBar", @"hideShortsCells", @"removeShortsCell", @"startupPage",
// DEMC - https://github.com/therealFoxster/DontEatMyContent/blob/master/Tweak.h

View file

@ -3,7 +3,7 @@
// YTMiniPlayerEnabler: https://github.com/level3tjg/YTMiniplayerEnabler/
%hook YTWatchMiniBarViewController
- (void)updateMiniBarPlayerStateFromRenderer {
if (IS_ENABLED(@"ytMiniPlayer_enabled")) {}
if (IS_ENABLED(kYTMiniPlayer)) {}
else { return %orig; }
}
%end

View file

@ -3,7 +3,7 @@
// YTNoHoverCards: https://github.com/level3tjg/YTNoHoverCards
%hook YTCreatorEndscreenView
- (void)setHidden:(BOOL)hidden {
if (IS_ENABLED(@"hideHoverCards_enabled"))
if (IS_ENABLED(kHideHoverCards))
hidden = YES;
%orig;
}

View file

@ -5,18 +5,18 @@
// YTNoPaidPromo: https://github.com/PoomSmart/YTNoPaidPromo
%hook YTMainAppVideoPlayerOverlayViewController
- (void)setPaidContentWithPlayerData:(id)data {
if (IS_ENABLED(@"hidePaidPromotionCard_enabled")) {}
if (IS_ENABLED(kHidePaidPromotionCard)) {}
else { return %orig; }
}
- (void)playerOverlayProvider:(YTPlayerOverlayProvider *)provider didInsertPlayerOverlay:(YTPlayerOverlay *)overlay {
if ([[overlay overlayIdentifier] isEqualToString:@"player_overlay_paid_content"] && IS_ENABLED(@"hidePaidPromotionCard_enabled")) return;
if ([[overlay overlayIdentifier] isEqualToString:@"player_overlay_paid_content"] && IS_ENABLED(kHidePaidPromotionCard)) return;
%orig;
}
%end
%hook YTInlineMutedPlaybackPlayerOverlayViewController
- (void)setPaidContentWithPlayerData:(id)data {
if (IS_ENABLED(@"hidePaidPromotionCard_enabled")) {}
if (IS_ENABLED(kHidePaidPromotionCard)) {}
else { return %orig; }
}
%end

View file

@ -38,7 +38,7 @@ static void replaceTab(YTIGuideResponse *response) {
%end
%ctor {
if (IS_ENABLED(@"reExplore_enabled")) {
if (IS_ENABLED(kReExplore)) {
%init(YTReExplore);
}
}

View file

@ -12,6 +12,9 @@
#import <YouTubeHeader/ASCollectionView.h>
#import <YouTubeHeader/ELMCellNode.h>
#import <YouTubeHeader/ELMNodeController.h>
#import <YouTubeHeader/ELMPBElement.h>
#import <YouTubeHeader/ELMPBProperties.h>
#import <YouTubeHeader/ELMPBIdentifierProperties.h>
#import <YouTubeHeader/GPBMessage.h>
#import <YouTubeHeader/MLPlayerStickySettings.h>
#import <YouTubeHeader/YTAppDelegate.h>
@ -62,6 +65,117 @@
#define DEFAULT_RATE 1.0f // YTSpeed
#define LOWCONTRASTMODE_CUTOFF_VERSION @"17.38.10" // LowContrastMode (v17.33.2-17.38.10)
// Keys
// Copy/Paste Settings
static NSString *const kReplaceCopyandPasteButtons = @"replaceCopyandPasteButtons_enabled";
// App appearance
static NSString *const kAppTheme = @"appTheme";
static NSString *const kOLEDKeyboard = @"oledKeyBoard_enabled";
// Video player
static NSString *const kPortraitFullscreen = @"portraitFullscreen_enabled";
static NSString *const kFullscreenToTheRight = @"fullscreenToTheRight_enabled";
static NSString *const kSlideToSeek = @"slideToSeek_enabled";
static NSString *const kYTTapToSeek = @"YTTapToSeek_enabled";
static NSString *const kDoubleTapToSeek = @"doubleTapToSeek_enabled";
static NSString *const kSnapToChapter = @"snapToChapter_enabled";
static NSString *const kPinchToZoom = @"pinchToZoom_enabled";
static NSString *const kYTMiniPlayer = @"ytMiniPlayer_enabled";
static NSString *const kStockVolumeHUD = @"stockVolumeHUD_enabled";
static NSString *const kReplaceYTDownloadWithuYou = @"kReplaceYTDownloadWithuYou_enabled";
static NSString *const kDisablePullToFull = @"disablePullToFull_enabled";
static NSString *const kDisableChapterSkip = @"disableChapterSkip_enabled";
static NSString *const kAlwaysShowRemainingTime = @"alwaysShowRemainingTime_enabled";
static NSString *const kDisableRemainingTime = @"disableRemainingTime_enabled";
// Video controls overlay
static NSString *const kEnableShareButton = @"enableShareButton_enabled";
static NSString *const kEnableSaveToButton = @"enableSaveToButton_enabled";
static NSString *const kHideYTMusicButton = @"hideYTMusicButton_enabled";
static NSString *const kHideAutoplaySwitch = @"hideAutoplaySwitch_enabled";
static NSString *const kHideCC = @"hideCC_enabled";
static NSString *const kHideVideoTitle = @"hideVideoTitle_enabled";
static NSString *const kDisableCollapseButton = @"disableCollapseButton_enabled";
static NSString *const kDisableFullscreenButton = @"disableFullscreenButton_enabled";
static NSString *const kHideHUD = @"hideHUD_enabled";
static NSString *const kHidePaidPromotionCard = @"hidePaidPromotionCard_enabled";
static NSString *const kHideChannelWatermark = @"hideChannelWatermark_enabled";
static NSString *const kHideVideoPlayerShadowOverlayButtons = @"hideVideoPlayerShadowOverlayButtons_enabled";
static NSString *const kHidePreviousAndNextButton = @"hidePreviousAndNextButton_enabled";
static NSString *const kRedProgressBar = @"redProgressBar_enabled";
static NSString *const kHideHoverCards = @"hideHoverCards_enabled";
static NSString *const kHideRightPanel = @"hideRightPanel_enabled";
static NSString *const kHideFullscreenActions = @"hideFullscreenActions_enabled";
static NSString *const kHideSuggestedVideo = @"hideSuggestedVideo_enabled";
static NSString *const kHideHeatwaves = @"hideHeatwaves_enabled";
static NSString *const kHideDoubleTapToSeekOverlay = @"hideDoubleTapToSeekOverlay_enabled";
static NSString *const kHideOverlayDarkBackground = @"hideOverlayDarkBackground_enabled";
static NSString *const kDisableAmbientMode = @"disableAmbientMode_enabled";
static NSString *const kHideVideosInFullscreen = @"hideVideosInFullscreen_enabled";
static NSString *const kHideRelatedWatchNexts = @"hideRelatedWatchNexts_enabled";
// Shorts control overlay
static NSString *const kHideBuySuperThanks = @"hideBuySuperThanks_enabled";
static NSString *const kHideSubscriptions = @"hideSubscriptions_enabled";
static NSString *const kShortsQualityPicker = @"shortsQualityPicker_enabled";
// Video player buttons
static NSString *const kRedSubscribeButton = @"redSubscribeButton_enabled";
static NSString *const kHideButtonContainers = @"hideButtonContainers_enabled";
static NSString *const kHideConnectButton = @"hideConnectButton_enabled";
static NSString *const kHideShareButton = @"hideShareButton_enabled";
static NSString *const kHideRemixButton = @"hideRemixButton_enabled";
static NSString *const kHideThanksButton = @"hideRemixButton_enabled";
static NSString *const kHideDownloadButton = @"hideDownloadButton_enabled";
static NSString *const kHideClipButton = @"hideClipButton_enabled";
static NSString *const kHideSaveToPlaylistButton = @"hideSaveToPlaylistButton_enabled";
static NSString *const kHideReportButton = @"hideReportButton_enabled";
static NSString *const kHidePreviewCommentSection = @"hidePreviewCommentSection_enabled";
static NSString *const kHideCommentSection = @"hideCommentSection_enabled";
// App settings overlay
static NSString *const kDisableAccountSection = @"disableAccountSection_enabled";
static NSString *const kDisableAutoplaySection = @"disableAutoplaySection_enabled";
static NSString *const kDisableTryNewFeaturesSection = @"disableTryNewFeaturesSection_enabled";
static NSString *const kDisableVideoQualityPreferencesSection = @"disableVideoQualityPreferencesSection_enabled";
static NSString *const kDisableNotificationsSection = @"disableNotificationsSection_enabled";
static NSString *const kDisableManageAllHistorySection = @"disableManageAllHistorySection_enabled";
static NSString *const kDisableYourDataInYouTubeSection = @"disableYourDataInYouTubeSection_enabled";
static NSString *const kDisablePrivacySection = @"disablePrivacySection_enabled";
static NSString *const kDisableLiveChatSection = @"disableLiveChatSection_enabled";
static NSString *const kHidePremiumPromos = @"hidePremiumPromos_enabled";
// UI Interface
static NSString *const kHideHomeTab = @"hideHomeTab_enabled";
static NSString *const kLowContrastMode = @"lowContrastMode_enabled";
static NSString *const kClassicVideoPlayer = @"classicVideoPlayer_enabled";
static NSString *const kFixLowContrastMode = @"fixLowContrastMode_enabled";
static NSString *const kDisableModernButtons = @"disableModernButtons_enabled";
static NSString *const kDisableRoundedHints = @"disableRoundedHints_enabled";
static NSString *const kDisableModernFlags = @"disableModernFlags_enabled";
static NSString *const kYTNoModernUI = @"ytNoModernUI_enabled";
static NSString *const kEnableVersionSpoofer = @"enableVersionSpoofer_enabled";
// Miscellaneous
static NSString *const kGoogleSignInPatch = @"googleSignInPatch_enabled";
static NSString *const kAdBlockWorkaroundLite = @"adBlockWorkaroundLite_enabled";
static NSString *const kAdBlockWorkaround = @"adBlockWorkaround_enabled";
static NSString *const kYouTabFakePremium = @"youTabFakePremium_enabled";
static NSString *const kDisableAnimatedYouTubeLogo = @"disableAnimatedYouTubeLogo_enabled";
static NSString *const kCenterYouTubeLogo = @"centerYouTubeLogo_enabled";
static NSString *const kHideYouTubeLogo = @"hideYouTubeLogo_enabled";
static NSString *const kYTStartupAnimation = @"ytStartupAnimation_enabled";
static NSString *const kDisableHints = @"disableHints_enabled";
static NSString *const kStickNavigationBar = @"stickNavigationBar_enabled";
static NSString *const kHideiSponsorBlockButton = @"hideiSponsorBlockButton_enabled";
static NSString *const kHideChipBar = @"hideChipBar_enabled";
static NSString *const kHidePlayNextInQueue = @"hidePlayNextInQueue_enabled";
static NSString *const kHideCommunityPosts = @"hideCommunityPosts_enabled";
static NSString *const kHideChannelHeaderLinks = @"hideChannelHeaderLinks_enabled";
static NSString *const kiPhoneLayout = @"iPhoneLayout_enabled";
static NSString *const kBigYTMiniPlayer = @"bigYTMiniPlayer_enabled";
static NSString *const kReExplore = @"reExplore_enabled";
static NSString *const kAutoHideHomeBar = @"autoHideHomeBar_enabled";
static NSString *const kHideSubscriptionsNotificationBadge = @"hideSubscriptionsNotificationBadge_enabled";
static NSString *const kFixCasting = @"fixCasting_enabled";
static NSString *const kNewSettingsUI = @"newSettingsUI_enabled";
static NSString *const kFlex = @"flex_enabled";
// unused (uYouEnhanced)
static NSString *const kGoogleSigninFix = @"googleSigninFix_enabled";
// Always show remaining time in video player - @bhackel
// Header has been moved to https://github.com/PoomSmart/YouTubeHeader/blob/main/YTPlayerBarController.h
// Header has been moved to https://github.com/PoomSmart/YouTubeHeader/blob/main/YTInlinePlayerBarContainerView.h
@ -167,6 +281,9 @@
@interface YTPlaybackButton : UIControl
@end
@interface HelperVC : UIViewController
@end
@interface YTPlaylistHeaderViewController : UIViewController
@property UIButton *downloadsButton;
@end

View file

@ -1,4 +1,5 @@
#import "uYouPlus.h"
#import "uYouPlusPatches.h"
// Tweak's bundle for Localizations support - @PoomSmart - https://github.com/PoomSmart/YouPiP/commit/aea2473f64c75d73cab713e1e2d5d0a77675024f
NSBundle *uYouPlusBundle() {
@ -16,6 +17,142 @@ NSBundle *uYouPlusBundle() {
NSBundle *tweakBundle = uYouPlusBundle();
//
// LEGACY VERSION ⚠️
// Hide the (Connect / Thanks / Save / Report) Buttons under the Video Player - 17.33.2 and up - @arichornlover (inspired by @PoomSmart's version)
%hook _ASDisplayView
- (void)layoutSubviews {
%orig;
BOOL hideConnectButton = IS_ENABLED(@"hideConnectButton_enabled");
BOOL hideThanksButton = IS_ENABLED(@"hideThanksButton_enabled");
BOOL hideSaveToPlaylistButton = IS_ENABLED(@"hideSaveToPlaylistButton_enabled");
BOOL hideReportButton = IS_ENABLED(@"hideReportButton_enabled");
for (UIView *subview in self.subviews) {
if ([subview.accessibilityLabel isEqualToString:@"connect account"]) {
subview.hidden = hideConnectButton;
} else if ([subview.accessibilityLabel isEqualToString:@"Thanks"]) {
subview.hidden = hideThanksButton;
} else if ([subview.accessibilityLabel isEqualToString:@"Save to playlist"]) {
subview.hidden = hideSaveToPlaylistButton;
} else if ([subview.accessibilityLabel isEqualToString:@"Report"]) {
subview.hidden = hideReportButton;
}
}
}
%end
// UPDATED VERSION
// Hide the (Connect / Share / Remix / Thanks / Download / Clip / Save / Report) Buttons under the Video Player - 17.33.2 and up - @PoomSmart (inspired by @arichornlover) - METHOD BROKE Server-Side on May 14th 2024
static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *identifiers) {
for (id child in [nodeController children]) {
NSLog(@"Child: %@", [child description]);
if ([child isKindOfClass:%c(ELMNodeController)]) {
NSArray <ELMComponent *> *elmChildren = [(ELMNodeController * _Nullable)child children];
for (ELMComponent *elmChild in elmChildren) {
for (NSString *identifier in identifiers) {
if ([[elmChild description] containsString:identifier]) {
NSLog(@"Found identifier: %@", identifier);
return YES;
}
}
}
}
if ([child isKindOfClass:%c(ASNodeController)]) {
ASDisplayNode *childNode = ((ASNodeController * _Nullable)child).node; // ELMContainerNode
NSArray<id> *yogaChildren = childNode.yogaChildren;
for (ASDisplayNode *displayNode in yogaChildren) {
NSLog(@"Yoga Child: %@", displayNode.accessibilityIdentifier);
if ([identifiers containsObject:displayNode.accessibilityIdentifier]) {
NSLog(@"Found identifier: %@", displayNode.accessibilityIdentifier);
return YES;
}
if (findCell(child, identifiers)) {
return YES;
}
}
}
}
return NO;
}
%hook ASCollectionView // This stopped working on May 14th 2024 due to a Server-Side Change from YouTube.
- (CGSize)sizeForElement:(ASCollectionElement * _Nullable)element {
if ([self.accessibilityIdentifier isEqualToString:@"id.video.scrollable_action_bar"]) {
ASCellNode *node = [element node];
ASNodeController *nodeController = [node controller];
if (IS_ENABLED(@"hideShareButton_enabled") && findCell(nodeController, @[@"id.video.share.button"])) {
return CGSizeZero;
}
if (IS_ENABLED(@"hideRemixButton_enabled") && findCell(nodeController, @[@"id.video.remix.button"])) {
return CGSizeZero;
}
if (IS_ENABLED(@"hideThanksButton_enabled") && findCell(nodeController, @[@"Thanks"])) {
return CGSizeZero;
}
if (IS_ENABLED(@"hideClipButton_enabled") && findCell(nodeController, @[@"clip_button.eml"])) {
return CGSizeZero;
}
if (IS_ENABLED(@"hideDownloadButton_enabled") && findCell(nodeController, @[@"id.ui.add_to.offline.button"])) {
return CGSizeZero;
}
if (IS_ENABLED(@"hideCommentSection_enabled") && findCell(nodeController, @[@"id.ui.carousel_header"])) {
return CGSizeZero;
}
}
return %orig;
}
%end
// Replace YouTube's download with uYou's
YTMainAppControlsOverlayView *controlsOverlayView;
%hook YTMainAppControlsOverlayView
- (id)initWithDelegate:(id)arg1 {
controlsOverlayView = %orig;
return controlsOverlayView;
}
%end
%hook YTElementsDefaultSheetController
+ (void)showSheetController:(id)arg1 showCommand:(id)arg2 commandContext:(id)arg3 handler:(id)arg4 {
if (IS_ENABLED(kReplaceYTDownloadWithuYou) && [arg2 isKindOfClass:%c(ELMPBShowActionSheetCommand)]) {
ELMPBShowActionSheetCommand *showCommand = (ELMPBShowActionSheetCommand *)arg2;
NSArray *listOptions = [showCommand listOptionArray];
for (ELMPBElement *element in listOptions) {
ELMPBProperties *properties = [element properties];
ELMPBIdentifierProperties *identifierProperties = [properties firstSubmessage];
// 19.30.2
if ([identifierProperties respondsToSelector:@selector(identifier)]) {
NSString *identifier = [identifierProperties identifier];
if ([identifier containsString:@"offline_upsell_dialog"]) {
if ([controlsOverlayView respondsToSelector:@selector(uYou)]) {
[controlsOverlayView uYou];
}
return;
}
}
// 19.20.2
NSString *description = [identifierProperties description];
if ([description containsString:@"offline_upsell_dialog"]) {
if ([controlsOverlayView respondsToSelector:@selector(uYou)]) {
[controlsOverlayView uYou];
}
return;
}
}
}
%orig;
}
%end
# pragma mark - Other hooks
// Activate FLEX
@ -24,7 +161,7 @@ NSBundle *tweakBundle = uYouPlusBundle();
didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> *)launchOptions {
BOOL didFinishLaunching = %orig;
if (IS_ENABLED(@"flex_enabled")) {
if (IS_ENABLED(kFlex)) {
[[%c(FLEXManager) performSelector:@selector(sharedManager)] performSelector:@selector(showExplorer)];
}
@ -32,7 +169,7 @@ NSBundle *tweakBundle = uYouPlusBundle();
}
- (void)appWillResignActive:(id)arg1 {
%orig;
if (IS_ENABLED(@"flex_enabled")) {
if (IS_ENABLED(kFlex)) {
[[%c(FLEXManager) performSelector:@selector(sharedManager)] performSelector:@selector(showExplorer)];
}
}
@ -77,7 +214,7 @@ NSBundle *tweakBundle = uYouPlusBundle();
}
%end
// uYou AdBlock Workaround LITE (This Version will only remove ads from Videos/Shorts!) - @PoomSmart
// uYou AdBlock Workaround LITE (This Version will only remove ads from only Videos/Shorts!) - @PoomSmart
%group uYouAdBlockingWorkaroundLite
%hook YTHotConfig
- (BOOL)disableAfmaIdfaCollection { return NO; }
@ -244,6 +381,27 @@ static NSMutableArray <YTIItemSectionRenderer *> *filteredArray(NSArray <YTIItem
%end
%end
/*
// Settings Menu with Blur Style - @arichornlover
%group gSettingsStyle
%hook YTWrapperSplitView
- (void)viewDidLoad {
[super viewDidLoad];
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
UIVisualEffectView *blurView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
blurView.frame = self.view.bounds;
blurView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view addSubview:blurView];
[self.view sendSubviewToBack:blurView];
// Apply dark theme if pageStyle is set to dark
if ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1) {
self.view.backgroundColor = [UIColor blackColor];
}
}
%end
%end
*/
// Hide YouTube Logo - @dayanch96
%group gHideYouTubeLogo
%hook YTHeaderLogoController
@ -285,7 +443,7 @@ static NSMutableArray <YTIItemSectionRenderer *> *filteredArray(NSArray <YTIItem
// YTMiniPlayerEnabler: https://github.com/level3tjg/YTMiniplayerEnabler/
%hook YTWatchMiniBarViewController
- (void)updateMiniBarPlayerStateFromRenderer {
if (IS_ENABLED(@"ytMiniPlayer_enabled")) {}
if (IS_ENABLED(kYTMiniPlayer)) {}
else { return %orig; }
}
%end
@ -293,7 +451,7 @@ static NSMutableArray <YTIItemSectionRenderer *> *filteredArray(NSArray <YTIItem
// YTNoHoverCards: https://github.com/level3tjg/YTNoHoverCards
%hook YTCreatorEndscreenView
- (void)setHidden:(BOOL)hidden {
if (IS_ENABLED(@"hideHoverCards_enabled"))
if (IS_ENABLED(kHideHoverCards))
hidden = YES;
%orig;
}
@ -534,7 +692,7 @@ static NSMutableArray <YTIItemSectionRenderer *> *filteredArray(NSArray <YTIItem
// Disable animated YouTube Logo - @bhackel
%hook YTHeaderLogoController
- (void)configureYoodleNitrateController {
if (IS_ENABLED(@"disableAnimatedYouTubeLogo_enabled")) {
if (IS_ENABLED(kDisableAnimatedYouTubeLogo)) {
return;
}
%orig;
@ -581,18 +739,18 @@ static NSMutableArray <YTIItemSectionRenderer *> *filteredArray(NSArray <YTIItem
// YTNoPaidPromo: https://github.com/PoomSmart/YTNoPaidPromo
%hook YTMainAppVideoPlayerOverlayViewController
- (void)setPaidContentWithPlayerData:(id)data {
if (IS_ENABLED(@"hidePaidPromotionCard_enabled")) {}
if (IS_ENABLED(kHidePaidPromotionCard)) {}
else { return %orig; }
}
- (void)playerOverlayProvider:(YTPlayerOverlayProvider *)provider didInsertPlayerOverlay:(YTPlayerOverlay *)overlay {
if ([[overlay overlayIdentifier] isEqualToString:@"player_overlay_paid_content"] && IS_ENABLED(@"hidePaidPromotionCard_enabled")) return;
if ([[overlay overlayIdentifier] isEqualToString:@"player_overlay_paid_content"] && IS_ENABLED(kHidePaidPromotionCard)) return;
%orig;
}
%end
%hook YTInlineMutedPlaybackPlayerOverlayViewController
- (void)setPaidContentWithPlayerData:(id)data {
if (IS_ENABLED(@"hidePaidPromotionCard_enabled")) {}
if (IS_ENABLED(kHidePaidPromotionCard)) {}
else { return %orig; }
}
%end
@ -874,9 +1032,8 @@ static int contrastMode() {
// WARNING: Please turn off the “Portrait Fullscreen” and "iPad Layout" Options while the option "Fullscreen to the Right" is enabled below.
%group gFullscreenToTheRight
%hook YTWatchViewController
- (UIInterfaceOrientationMask)allowedFullScreenOrientations {
UIInterfaceOrientationMask orientations = UIInterfaceOrientationMaskLandscapeRight;
return orientations;
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}
%end
%end
@ -884,7 +1041,7 @@ static int contrastMode() {
// Disable Double tap to skip chapter - @bhackel
%hook YTDoubleTapToSeekController
- (void)didTwoFingerDoubleTap:(id)arg1 {
if (IS_ENABLED(@"disableChapterSkip_enabled")) {
if (IS_ENABLED(kDisableChapterSkip)) {
return;
}
%orig;
@ -895,7 +1052,7 @@ static int contrastMode() {
%hook YTSegmentableInlinePlayerBarView
- (void)didMoveToWindow {
%orig;
if (IS_ENABLED(@"snapToChapter_enabled")) {
if (IS_ENABLED(kSnapToChapter)) {
self.enableSnapToChapter = NO;
}
}
@ -904,7 +1061,7 @@ static int contrastMode() {
// Disable Pinch to zoom
%hook YTColdConfig
- (BOOL)videoZoomFreeZoomEnabledGlobalConfig {
return IS_ENABLED(@"pinchToZoom_enabled") ? NO : %orig;
return IS_ENABLED(kPinchToZoom) ? NO : %orig;
}
%end
@ -913,7 +1070,7 @@ static int contrastMode() {
%group gStockVolumeHUD
%hook YTColdConfig
- (BOOL)iosUseSystemVolumeControlInFullscreen {
return IS_ENABLED(@"stockVolumeHUD_enabled") ? YES : %orig;
return IS_ENABLED(kStockVolumeHUD) ? YES : %orig;
}
%end
%hook UIApplication
@ -925,14 +1082,14 @@ static int contrastMode() {
%hook YTColdConfig
- (BOOL)speedMasterArm2FastForwardWithoutSeekBySliding {
return IS_ENABLED(@"slideToSeek_enabled") ? NO : %orig;
return IS_ENABLED(kSlideToSeek) ? NO : %orig;
}
%end
// Disable double tap to seek
%hook YTDoubleTapToSeekController
- (void)enableDoubleTapToSeek:(BOOL)arg1 {
return IS_ENABLED(@"doubleTapToSeek_disabled") ? %orig(NO) : %orig;
return IS_ENABLED(kDoubleTapToSeek) ? %orig(NO) : %orig;
}
%end
@ -1016,27 +1173,27 @@ static int contrastMode() {
// Hide CC / Hide Autoplay switch / Hide YTMusic Button / Enable Share Button / Enable Save to Playlist Button
%hook YTMainAppControlsOverlayView
- (void)setClosedCaptionsOrSubtitlesButtonAvailable:(BOOL)arg1 { // hide CC button
return IS_ENABLED(@"hideCC_enabled") ? %orig(NO) : %orig;
return IS_ENABLED(kHideCC) ? %orig(NO) : %orig;
}
- (void)setAutoplaySwitchButtonRenderer:(id)arg1 { // hide Autoplay
if (IS_ENABLED(@"hideAutoplaySwitch_enabled")) {}
if (IS_ENABLED(kHideAutoplaySwitch)) {}
else { return %orig; }
}
- (void)setYoutubeMusicButton:(id)arg1 {
if (IS_ENABLED(@"hideYTMusicButton_enabled")) {
if (IS_ENABLED(kHideYTMusicButton)) {
} else {
%orig(arg1);
}
}
- (void)setShareButtonAvailable:(BOOL)arg1 {
if (IS_ENABLED(@"enableShareButton_enabled")) {
if (IS_ENABLED(kEnableShareButton)) {
%orig(YES);
} else {
%orig(NO);
}
}
- (void)setAddToButtonAvailable:(BOOL)arg1 {
if (IS_ENABLED(@"enableSaveToButton_enabled")) {
if (IS_ENABLED(kEnableSaveToButton)) {
%orig(YES);
} else {
%orig(NO);
@ -1048,21 +1205,21 @@ static int contrastMode() {
%hook YTMainAppControlsOverlayView
- (void)layoutSubviews {
%orig;
if (IS_ENABLED(@"disableCollapseButton_enabled")) {
if (IS_ENABLED(kDisableCollapseButton)) {
if (self.watchCollapseButton) {
[self.watchCollapseButton removeFromSuperview];
}
}
}
- (BOOL)watchCollapseButtonHidden {
if (IS_ENABLED(@"disableCollapseButton_enabled")) {
if (IS_ENABLED(kDisableCollapseButton)) {
return YES;
} else {
return %orig;
}
}
- (void)setWatchCollapseButtonAvailable:(BOOL)available {
if (IS_ENABLED(@"disableCollapseButton_enabled")) {
if (IS_ENABLED(kDisableCollapseButton)) {
} else {
%orig(available);
}
@ -1075,7 +1232,7 @@ static int contrastMode() {
%hook YTInlinePlayerBarContainerView
- (void)layoutSubviews {
%orig;
if (IS_ENABLED(@"disableFullscreenButton_enabled")) {
if (IS_ENABLED(kDisableFullscreenButton)) {
if (self.exitFullscreenButton) {
[self.exitFullscreenButton removeFromSuperview];
self.exitFullscreenButton.frame = CGRectZero;
@ -1113,19 +1270,19 @@ static int contrastMode() {
// Hide HUD Messages
%hook YTHUDMessageView
- (id)initWithMessage:(id)arg1 dismissHandler:(id)arg2 {
return IS_ENABLED(@"hideHUD_enabled") ? nil : %orig;
return IS_ENABLED(kHideHUD) ? nil : %orig;
}
%end
// Hide Channel Watermark
%hook YTColdConfig
- (BOOL)iosEnableFeaturedChannelWatermarkOverlayFix {
return IS_ENABLED(@"hideChannelWatermark_enabled") ? NO : %orig;
return IS_ENABLED(kHideChannelWatermark) ? NO : %orig;
}
%end
%hook YTAnnotationsViewController
- (void)loadFeaturedChannelWatermark {
if (IS_ENABLED(@"hideChannelWatermark_enabled")) {}
if (IS_ENABLED(kHideChannelWatermark)) {}
else { return %orig; }
}
%end
@ -1228,7 +1385,7 @@ static int contrastMode() {
%hook YTPlayerBarRectangleDecorationView // Red Progress Bar - New (Compatible for v19.10.7-latest)
- (void)drawRectangleDecorationWithSideMasks:(CGRect)rect {
if (IS_ENABLED(@"redProgressBar_enabled")) {
if (IS_ENABLED(kRedProgressBar)) {
YTIPlayerBarDecorationModel *model = [self valueForKey:@"_model"];
int overlayMode = model.playingState.overlayMode;
model.playingState.overlayMode = 1;
@ -1243,7 +1400,7 @@ static int contrastMode() {
// Disable the right panel in fullscreen mode
%hook YTColdConfig
- (BOOL)isLandscapeEngagementPanelEnabled {
return IS_ENABLED(@"hideRightPanel_enabled") ? NO : %orig;
return IS_ENABLED(kHideRightPanel) ? NO : %orig;
}
%end
@ -1251,12 +1408,12 @@ static int contrastMode() {
%hook _ASDisplayView
- (void)didMoveToWindow {
%orig;
if ((IS_ENABLED(@"hideBuySuperThanks_enabled")) && ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.suggested_action"])) {
if ((IS_ENABLED(kHideBuySuperThanks)) && ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.suggested_action"])) {
self.hidden = YES;
}
// Hide Header Links under Channel Profile - @arichornlover
if ((IS_ENABLED(@"hideChannelHeaderLinks_enabled")) && ([self.accessibilityIdentifier isEqualToString:@"eml.channel_header_links"])) {
if ((IS_ENABLED(kHideChannelHeaderLinks)) && ([self.accessibilityIdentifier isEqualToString:@"eml.channel_header_links"])) {
self.hidden = YES;
self.opaque = YES;
self.userInteractionEnabled = NO;
@ -1267,7 +1424,7 @@ static int contrastMode() {
}
// Completely Remove the Comment Section under the Video Player - @arichornlover
if ((IS_ENABLED(@"hideCommentSection_enabled")) && ([self.accessibilityIdentifier isEqualToString:@"id.ui.comments_entry_point_teaser"]
if ((IS_ENABLED(kHideCommentSection)) && ([self.accessibilityIdentifier isEqualToString:@"id.ui.comments_entry_point_teaser"]
|| [self.accessibilityIdentifier isEqualToString:@"id.ui.comments_entry_point_simplebox"]
|| [self.accessibilityIdentifier isEqualToString:@"id.ui.video_metadata_carousel"]
|| [self.accessibilityIdentifier isEqualToString:@"id.ui.carousel_header"])) {
@ -1283,7 +1440,7 @@ static int contrastMode() {
}
// Hide the Comment Section Previews under the Video Player - @arichornlover
if ((IS_ENABLED(@"hidePreviewCommentSection_enabled")) && ([self.accessibilityIdentifier isEqualToString:@"id.ui.comments_entry_point_teaser"])) {
if ((IS_ENABLED(kHidePreviewCommentSection)) && ([self.accessibilityIdentifier isEqualToString:@"id.ui.comments_entry_point_teaser"])) {
self.hidden = YES;
self.opaque = YES;
self.userInteractionEnabled = NO;
@ -1299,7 +1456,7 @@ static int contrastMode() {
%hook YTReelWatchRootViewController
- (void)setPausedStateCarouselView {
if (IS_ENABLED(@"hideSubscriptions_enabled")) {}
if (IS_ENABLED(kHideSubscriptions)) {}
else { return %orig; }
}
%end
@ -1309,7 +1466,7 @@ static int contrastMode() {
%hook YTIElementRenderer
- (NSData *)elementData {
NSString *description = [self description];
if (IS_ENABLED(@"hideCommunityPosts_enabled")) {
if (IS_ENABLED(kHideCommunityPosts)) {
if ([description containsString:@"post_base_wrapper.eml"]) {
if (!cellDividerData) cellDividerData = [NSData dataWithBytes:cellDividerDataBytes length:cellDividerDataBytesLength];
return cellDividerData;
@ -1324,13 +1481,13 @@ static int contrastMode() {
%hook ELMContainerNode
- (void)setBackgroundColor:(id)color {
NSString *description = [self description];
if (IS_ENABLED(@"redSubscribeButton_enabled")) {
if (IS_ENABLED(kRedSubscribeButton)) {
if ([description containsString:@"eml.compact_subscribe_button"]) {
color = [UIColor redColor];
}
}
// Hide the Button Containers under the Video Player - 17.33.2 and up - @arichornlover
if (IS_ENABLED(@"hideButtonContainers_enabled")) {
if (IS_ENABLED(kHideButtonContainers)) {
if ([description containsString:@"id.video.like.button"] ||
[description containsString:@"id.video.dislike.button"] ||
[description containsString:@"id.video.share.button"] ||
@ -1343,95 +1500,6 @@ static int contrastMode() {
}
%end
// LEGACY VERSION ⚠️
// Hide the (Connect / Thanks / Save / Report) Buttons under the Video Player - 17.33.2 and up - @arichornlover (inspired by @PoomSmart's version)
%hook _ASDisplayView
- (void)layoutSubviews {
%orig;
BOOL hideConnectButton = IS_ENABLED(@"hideConnectButton_enabled");
BOOL hideThanksButton = IS_ENABLED(@"hideThanksButton_enabled");
BOOL hideSaveToPlaylistButton = IS_ENABLED(@"hideSaveToPlaylistButton_enabled");
BOOL hideReportButton = IS_ENABLED(@"hideReportButton_enabled");
for (UIView *subview in self.subviews) {
if ([subview.accessibilityLabel isEqualToString:@"connect account"]) {
subview.hidden = hideConnectButton;
} else if ([subview.accessibilityLabel isEqualToString:@"Thanks"]) {
subview.hidden = hideThanksButton;
} else if ([subview.accessibilityLabel isEqualToString:@"Save to playlist"]) {
subview.hidden = hideSaveToPlaylistButton;
} else if ([subview.accessibilityLabel isEqualToString:@"Report"]) {
subview.hidden = hideReportButton;
}
}
}
%end
// UPDATED VERSION
// Hide the (Connect / Share / Remix / Thanks / Download / Clip / Save / Report) Buttons under the Video Player - 17.33.2 and up - @PoomSmart (inspired by @arichornlover) - METHOD BROKE Server-Side on May 14th 2024
static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *identifiers) {
for (id child in [nodeController children]) {
if ([child isKindOfClass:%c(ELMNodeController)]) {
NSArray <ELMComponent *> *elmChildren = [(ELMNodeController * _Nullable)child children];
for (ELMComponent *elmChild in elmChildren) {
for (NSString *identifier in identifiers) {
if ([[elmChild description] containsString:identifier])
return YES;
}
}
}
if ([child isKindOfClass:%c(ASNodeController)]) {
ASDisplayNode *childNode = ((ASNodeController * _Nullable)child).node; // ELMContainerNode
NSArray<id> *yogaChildren = childNode.yogaChildren;
for (ASDisplayNode *displayNode in yogaChildren) {
if ([identifiers containsObject:displayNode.accessibilityIdentifier])
return YES;
}
return findCell(child, identifiers);
}
return NO;
}
return NO;
}
%hook ASCollectionView // This stopped working on May 14th 2024 due to a Server-Side Change from YouTube.
- (CGSize)sizeForElement:(ASCollectionElement * _Nullable)element {
if ([self.accessibilityIdentifier isEqualToString:@"id.video.scrollable_action_bar"]) {
ASCellNode *node = [element node];
ASNodeController *nodeController = [node controller];
if (IS_ENABLED(@"hideShareButton_enabled") && findCell(nodeController, @[@"id.video.share.button"])) {
return CGSizeZero;
}
if (IS_ENABLED(@"hideRemixButton_enabled") && findCell(nodeController, @[@"id.video.remix.button"])) {
return CGSizeZero;
}
if (IS_ENABLED(@"hideThanksButton_enabled") && findCell(nodeController, @[@"Thanks"])) {
return CGSizeZero;
}
if (IS_ENABLED(@"hideClipButton_enabled") && findCell(nodeController, @[@"clip_button.eml"])) {
return CGSizeZero;
}
if (IS_ENABLED(@"hideDownloadButton_enabled") && findCell(nodeController, @[@"id.ui.add_to.offline.button"])) {
return CGSizeZero;
}
if (IS_ENABLED(@"hideCommentSection_enabled") && findCell(nodeController, @[@"id.ui.carousel_header"])) {
return CGSizeZero;
}
}
return %orig;
}
%end
// App Settings Overlay Options
%group gDisableAccountSection
%hook YTSettingsSectionItemManager
@ -1520,7 +1588,7 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
%end
%end
// Auto-Hide Home Bar - @arichornlover
// Auto-Hide Home Bar
%group gAutoHideHomeBar
%hook UIViewController
- (BOOL)prefersHomeIndicatorAutoHidden {
@ -1532,11 +1600,11 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
// YT startup animation
%hook YTColdConfig
- (BOOL)mainAppCoreClientIosEnableStartupAnimation {
return IS_ENABLED(@"ytStartupAnimation_enabled") ? YES : NO;
return IS_ENABLED(kYTStartupAnimation) ? YES : NO;
}
%end
// Disable hints - https://github.com/LillieH001/YouTube-Reborn/blob/v4/
// Disable hints
%group gDisableHints
%hook YTSettings
- (BOOL)areHintsDisabled {
@ -1589,7 +1657,7 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
// Remove “Play next in queue” from the menu (@PoomSmart) - qnblackcat/uYouPlus#1138
%hook YTMenuItemVisibilityHandler
- (BOOL)shouldShowServiceItemRenderer:(YTIMenuConditionalServiceItemRenderer *)renderer {
return IS_ENABLED(@"hidePlayNextInQueue_enabled") && renderer.icon.iconType == 251 && renderer.secondaryIcon.iconType == 741 ? NO : %orig;
return IS_ENABLED(kHidePlayNextInQueue) && renderer.icon.iconType == 251 && renderer.secondaryIcon.iconType == 741 ? NO : %orig;
}
%end
@ -1629,7 +1697,7 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
%end
%end
// iPhone Layout - @LillieH1000 & @arichornlover
// iPhone Layout - @arichornlover
%group giPhoneLayout
%hook UIDevice
- (UIUserInterfaceIdiom)userInterfaceIdiom {
@ -1689,165 +1757,170 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
// dlopen([[NSString stringWithFormat:@"%@/Frameworks/uYou.dylib", [[NSBundle mainBundle] bundlePath]] UTF8String], RTLD_LAZY);
%init;
if (IS_ENABLED(@"hideYouTubeLogo_enabled")) {
/*
if (IS_ENABLED(kSettingsStyle_enabled)) {
%init(gSettingsStyle);
}
*/
if (IS_ENABLED(kHideYouTubeLogo)) {
%init(gHideYouTubeLogo);
}
if (IS_ENABLED(@"centerYouTubeLogo_enabled")) {
if (IS_ENABLED(kCenterYouTubeLogo)) {
%init(gCenterYouTubeLogo);
}
if (IS_ENABLED(@"hideSubscriptionsNotificationBadge_enabled")) {
if (IS_ENABLED(kHideSubscriptionsNotificationBadge)) {
%init(gHideSubscriptionsNotificationBadge);
}
if (IS_ENABLED(@"hidePreviousAndNextButton_enabled")) {
if (IS_ENABLED(kHidePreviousAndNextButton)) {
%init(gHidePreviousAndNextButton);
}
if (IS_ENABLED(@"hideOverlayDarkBackground_enabled")) {
if (IS_ENABLED(kHideOverlayDarkBackground)) {
%init(gHideOverlayDarkBackground);
}
if (IS_ENABLED(@"hideVideoPlayerShadowOverlayButtons_enabled")) {
if (IS_ENABLED(kHideVideoPlayerShadowOverlayButtons)) {
%init(gHideVideoPlayerShadowOverlayButtons);
}
if (IS_ENABLED(@"disableHints_enabled")) {
if (IS_ENABLED(kDisableHints)) {
%init(gDisableHints);
}
if (IS_ENABLED(@"redProgressBar_enabled")) {
if (IS_ENABLED(kRedProgressBar)) {
%init(gRedProgressBar);
}
if (IS_ENABLED(@"stickNavigationBar_enabled")) {
if (IS_ENABLED(kStickNavigationBar)) {
%init(gStickNavigationBar);
}
if (IS_ENABLED(@"hideChipBar_enabled")) {
if (IS_ENABLED(kHideChipBar)) {
%init(gHideChipBar);
}
if (IS_ENABLED(@"portraitFullscreen_enabled")) {
if (IS_ENABLED(kPortraitFullscreen)) {
%init(gPortraitFullscreen);
}
if (IS_ENABLED(@"fullscreenToTheRight_enabled")) {
if (IS_ENABLED(kFullscreenToTheRight)) {
%init(gFullscreenToTheRight);
}
if (IS_ENABLED(@"disableFullscreenButton_enabled")) {
if (IS_ENABLED(kDisableFullscreenButton)) {
%init(gHideFullscreenButton);
}
if (IS_ENABLED(@"hideFullscreenActions_enabled")) {
if (IS_ENABLED(kHideFullscreenActions)) {
%init(hideFullscreenActions);
}
if (IS_ENABLED(@"iPhoneLayout_enabled") && (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad)) {
if (IS_ENABLED(kiPhoneLayout) && (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad)) {
%init(giPhoneLayout);
}
if (IS_ENABLED(@"stockVolumeHUD_enabled")) {
if (IS_ENABLED(kStockVolumeHUD)) {
%init(gStockVolumeHUD);
}
if (IS_ENABLED(@"hideHeatwaves_enabled")) {
if (IS_ENABLED(kHideHeatwaves)) {
%init(gHideHeatwaves);
}
if (IS_ENABLED(@"noRelatedWatchNexts_enabled")) {
if (IS_ENABLED(kHideRelatedWatchNexts)) {
%init(gNoRelatedWatchNexts);
}
if (IS_ENABLED(@"noVideosInFullscreen_enabled")) {
if (IS_ENABLED(kHideVideosInFullscreen)) {
%init(gNoVideosInFullscreen);
}
if (IS_ENABLED(@"classicVideoPlayer_enabled")) {
if (IS_ENABLED(kClassicVideoPlayer)) {
%init(gClassicVideoPlayer);
}
if (IS_ENABLED(@"fixLowContrastMode_enabled")) {
if (IS_ENABLED(kFixLowContrastMode)) {
%init(gFixLowContrastMode);
}
if (IS_ENABLED(@"disableModernButtons_enabled")) {
if (IS_ENABLED(kDisableModernButtons)) {
%init(gDisableModernButtons);
}
if (IS_ENABLED(@"disableRoundedHints_enabled")) {
if (IS_ENABLED(kDisableRoundedHints)) {
%init(gDisableRoundedHints);
}
if (IS_ENABLED(@"disableModernFlags_enabled")) {
if (IS_ENABLED(kDisableModernFlags)) {
%init(gDisableModernFlags);
}
if (IS_ENABLED(@"disableAmbientMode_enabled")) {
if (IS_ENABLED(kDisableAmbientMode)) {
%init(gDisableAmbientMode);
}
if (IS_ENABLED(@"disableAccountSection_enabled")) {
if (IS_ENABLED(kDisableAccountSection)) {
%init(gDisableAccountSection);
}
if (IS_ENABLED(@"disableAutoplaySection_enabled")) {
if (IS_ENABLED(kDisableAutoplaySection)) {
%init(gDisableAutoplaySection);
}
if (IS_ENABLED(@"disableTryNewFeaturesSection_enabled")) {
if (IS_ENABLED(kDisableTryNewFeaturesSection)) {
%init(gDisableTryNewFeaturesSection);
}
if (IS_ENABLED(@"disableVideoQualityPreferencesSection_enabled")) {
if (IS_ENABLED(kDisableVideoQualityPreferencesSection)) {
%init(gDisableVideoQualityPreferencesSection);
}
if (IS_ENABLED(@"disableNotificationsSection_enabled")) {
if (IS_ENABLED(kDisableNotificationsSection)) {
%init(gDisableNotificationsSection);
}
if (IS_ENABLED(@"disableManageAllHistorySection_enabled")) {
if (IS_ENABLED(kDisableManageAllHistorySection)) {
%init(gDisableManageAllHistorySection);
}
if (IS_ENABLED(@"disableYourDataInYouTubeSection_enabled")) {
if (IS_ENABLED(kDisableYourDataInYouTubeSection)) {
%init(gDisableYourDataInYouTubeSection);
}
if (IS_ENABLED(@"disablePrivacySection_enabled")) {
if (IS_ENABLED(kDisablePrivacySection)) {
%init(gDisablePrivacySection);
}
if (IS_ENABLED(@"disableLiveChatSection_enabled")) {
if (IS_ENABLED(kDisableLiveChatSection)) {
%init(gDisableLiveChatSection);
}
if (IS_ENABLED(@"YTTapToSeek_enabled")) {
if (IS_ENABLED(kYTTapToSeek)) {
%init(gYTTapToSeek);
}
if (IS_ENABLED(@"hidePremiumPromos_enabled")) {
if (IS_ENABLED(kHidePremiumPromos)) {
%init(gHidePremiumPromos);
}
if (IS_ENABLED(@"youTabFakePremium_enabled")) {
if (IS_ENABLED(kYouTabFakePremium)) {
%init(gFakePremium);
}
if (IS_ENABLED(@"disablePullToFull_enabled")) {
if (IS_ENABLED(kDisablePullToFull)) {
%init(gDisablePullToFull);
}
if (IS_ENABLED(@"uYouAdBlockingWorkaroundLite_enabled")) {
if (IS_ENABLED(kAdBlockWorkaroundLite)) {
%init(uYouAdBlockingWorkaroundLite);
}
if (IS_ENABLED(@"uYouAdBlockingWorkaround_enabled")) {
if (IS_ENABLED(kAdBlockWorkaround)) {
%init(uYouAdBlockingWorkaround);
}
if (IS_ENABLED(@"hideHomeTab_enabled")) {
if (IS_ENABLED(kHideHomeTab)) {
%init(gHideHomeTab);
}
if (IS_ENABLED(@"autoHideHomeBar_enabled")) {
if (IS_ENABLED(kAutoHideHomeBar)) {
%init(gAutoHideHomeBar);
}
if (IS_ENABLED(@"hideDoubleTapToSeekOverlay_enabled")) {
if (IS_ENABLED(kHideDoubleTapToSeekOverlay)) {
%init(gHideDoubleTapToSeekOverlay);
}
if (IS_ENABLED(@"shortsQualityPicker_enabled")) {
if (IS_ENABLED(kShortsQualityPicker)) {
%init(gShortsQualityPicker);
}
if (IS_ENABLED(@"fixCasting_enabled")) {
if (IS_ENABLED(kFixCasting)) {
%init(gFixCasting);
}
// YTNoModernUI - @arichorn
BOOL ytNoModernUIEnabled = IS_ENABLED(@"ytNoModernUI_enabled");
// YTNoModernUI - @arichornlover
BOOL ytNoModernUIEnabled = IS_ENABLED(kYTNoModernUI);
if (ytNoModernUIEnabled) {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setBool:NO forKey:@"enableVersionSpoofer_enabled"];
[userDefaults setBool:NO forKey:kEnableVersionSpoofer];
} else {
BOOL enableVersionSpooferEnabled = IS_ENABLED(@"enableVersionSpoofer_enabled");
BOOL enableVersionSpooferEnabled = IS_ENABLED(kEnableVersionSpoofer);
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setBool:enableVersionSpooferEnabled forKey:@"enableVersionSpoofer_enabled"];
[userDefaults setBool:enableVersionSpooferEnabled forKey:kEnableVersionSpoofer];
}
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setBool:ytNoModernUIEnabled ? ytNoModernUIEnabled : [userDefaults boolForKey:@"fixLowContrastMode_enabled"] forKey:@"fixLowContrastMode_enabled"];
[userDefaults setBool:ytNoModernUIEnabled ? ytNoModernUIEnabled : [userDefaults boolForKey:@"disableModernButtons_enabled"] forKey:@"disableModernButtons_enabled"];
[userDefaults setBool:ytNoModernUIEnabled ? ytNoModernUIEnabled : [userDefaults boolForKey:@"disableRoundedHints_enabled"] forKey:@"disableRoundedHints_enabled"];
[userDefaults setBool:ytNoModernUIEnabled ? ytNoModernUIEnabled : [userDefaults boolForKey:@"disableModernFlags_enabled"] forKey:@"disableModernFlags_enabled"];
[userDefaults setBool:ytNoModernUIEnabled ? ytNoModernUIEnabled : [userDefaults boolForKey:@"disableAmbientMode_enabled"] forKey:@"disableAmbientMode_enabled"];
[userDefaults setBool:ytNoModernUIEnabled ? ytNoModernUIEnabled : [userDefaults boolForKey:@"redProgressBar_enabled"] forKey:@"redProgressBar_enabled"];
[userDefaults setBool:ytNoModernUIEnabled ? ytNoModernUIEnabled : [userDefaults boolForKey:kFixLowContrastMode] forKey:kFixLowContrastMode];
[userDefaults setBool:ytNoModernUIEnabled ? ytNoModernUIEnabled : [userDefaults boolForKey:kDisableModernButtons] forKey:kDisableModernButtons];
[userDefaults setBool:ytNoModernUIEnabled ? ytNoModernUIEnabled : [userDefaults boolForKey:kDisableRoundedHints] forKey:kDisableRoundedHints];
[userDefaults setBool:ytNoModernUIEnabled ? ytNoModernUIEnabled : [userDefaults boolForKey:kDisableModernFlags] forKey:kDisableModernFlags];
[userDefaults setBool:ytNoModernUIEnabled ? ytNoModernUIEnabled : [userDefaults boolForKey:kDisableAmbientMode] forKey:kDisableAmbientMode];
[userDefaults setBool:ytNoModernUIEnabled ? ytNoModernUIEnabled : [userDefaults boolForKey:kRedProgressBar] forKey:kRedProgressBar];
// Change the default value of some options
NSArray *allKeys = [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys];
if (![allKeys containsObject:@"hidePlayNextInQueue_enabled"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"hidePlayNextInQueue_enabled"];
if (![allKeys containsObject:kHidePlayNextInQueue]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kHidePlayNextInQueue];
}
if (![allKeys containsObject:@"relatedVideosAtTheEndOfYTVideos"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"relatedVideosAtTheEndOfYTVideos"];
@ -1861,14 +1934,17 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
if (![allKeys containsObject:@"YouPiPEnabled"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"YouPiPEnabled"];
}
if (![allKeys containsObject:@"uYouAdBlockingWorkaroundLite_enabled"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"uYouAdBlockingWorkaroundLite_enabled"];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"uYouAdBlockingWorkaround_enabled"];
if (![allKeys containsObject:kReplaceYTDownloadWithuYou]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kReplaceYTDownloadWithuYou];
}
if (![allKeys containsObject:kAdBlockWorkaroundLite]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kAdBlockWorkaroundLite];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:kAdBlockWorkaround];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"removeYouTubeAds"];
}
if (![allKeys containsObject:@"uYouAdBlockingWorkaround_enabled"]) {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"uYouAdBlockingWorkaroundLite_enabled"];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"uYouAdBlockingWorkaround_enabled"];
if (![allKeys containsObject:kAdBlockWorkaround]) {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:kAdBlockWorkaroundLite];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kAdBlockWorkaround];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"removeYouTubeAds"];
}
// Broken uYou 3.0.3 setting: No Suggested Videos at The Video End
@ -1887,10 +1963,10 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
}
// Set video casting fix default to enabled
if (![allKeys containsObject:@"fixCasting_enabled"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"fixCasting_enabled"];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kFixCasting];
}
// Set new grouped settings UI to default enabled
if (![allKeys containsObject:@"newSettingsUI_enabled"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"newSettingsUI_enabled"];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kNewSettingsUI];
}
}

View file

@ -75,6 +75,7 @@
@interface ELMPBShowActionSheetCommand : GPBMessage
@property (nonatomic, strong, readwrite) ELMPBCommand *onAppear;
@property (nonatomic, assign, readwrite) BOOL hasOnAppear;
- (id)listOptionArray;
@end
@interface ELMContext : NSObject

View file

@ -392,11 +392,11 @@ static void refreshUYouAppearance() {
%ctor {
%init;
if (IS_ENABLED(@"googleSignInPatch_enabled")) {
if (IS_ENABLED(kGoogleSignInPatch)) {
%init(gGoogleSignInPatch);
}
/*
if (IS_ENABLED(@"youtubeNativeShare_enabled")) {
if (IS_ENABLED(kYouTubeNativeShare)) {
%init(gYouTubeNativeShare);
}
*/

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -24,6 +24,7 @@ jobs:
git submodule add https://github.com/arichornloverALT/YTHoldForSpeed.git Tweaks/YTHoldForSpeed
git submodule add https://github.com/arichornloverALT/YouGroupSettings.git Tweaks/YouGroupSettings
git submodule add https://github.com/arichornloverALT/YouTimeStamp.git Tweaks/YouTimeStamp
git submodule add https://github.com/bhackel/YouLoop.git Tweaks/YouLoop
git submodule add https://github.com/protocolbuffers/protobuf.git Tweaks/protobuf
git add .
git commit -m "added uYouEnhanced submodules"
@ -65,6 +66,8 @@ jobs:
git add .
git submodule update --init --recursive --remote Tweaks/YouMute
git add .
git submodule update --init --recursive --remote Tweaks/YouLoop
git add .
git submodule update --init --recursive --remote Tweaks/YouPiP
git add .
git submodule update --init --recursive --remote Tweaks/YouQuality
@ -87,6 +90,7 @@ jobs:
ln -s ../Tweaks/uYouLocalization/layout/Library/Application\ Support/uYouLocalization.bundle uYouLocalization.bundle
ln -s ../Tweaks/YTHoldForSpeed/layout/Library/Application\ Support/YTHoldForSpeed.bundle YTHoldForSpeed.bundle
ln -s ../Tweaks/YouGroupSettings/layout/Library/Application\ Support/YouGroupSettings.bundle YouGroupSettings.bundle
ln -s ../Tweaks/YouLoop/layout/Library/Application\ Support/YouLoop.bundle YouLoop.bundle
ln -s ../Tweaks/YouTimeStamp/layout/Library/Application\ Support/YouTimeStamp.bundle YouTimeStamp.bundle
git add .
git commit -m "Added bundles"
@ -97,9 +101,11 @@ jobs:
# - name: Delete .bundle files
# run: |
# cd Bundles
# rm -f MrBeastify.bundle
# rm -f uYouLocalization.bundle
# rm -f YTHoldForSpeed.bundle
# rm -f YouGroupSettings.bundle
# rm -f YouLoop.bundle
# rm -f YouTimeStamp.bundle
# git add .
# git commit -m "Deleted bundles"