diff --git a/Settings.xm b/Settings.xm index 312d4d7..51eab1f 100644 --- a/Settings.xm +++ b/Settings.xm @@ -6,6 +6,12 @@ #import "Tweaks/YouTubeHeader/YTSettingsPickerViewController.h" #import "Header.h" +static BOOL IsEnabled(NSString *key) { + return [[NSUserDefaults standardUserDefaults] boolForKey:key]; +} +static int GetSelection(NSString *key) { + return [[NSUserDefaults standardUserDefaults] integerForKey:key]; +} static const NSInteger uYouPlusSection = 500; @interface YTSettingsSectionItemManager (uYouPlus) @@ -166,6 +172,16 @@ extern NSBundle *uYouPlusBundle(); } settingItemId:0], + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"RED_PROGRESS_BAR") + titleDescription:LOC(@"RED_PROGRESS_BAR_DESC") + accessibilityIdentifier:nil + switchOn:IsEnabled(@"redProgressBar_enabled") + switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { + [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"redProgressBar_enabled"]; + return YES; + } + settingItemId:0], + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_HOVER_CARD") titleDescription:LOC(@"HIDE_HOVER_CARD_DESC") accessibilityIdentifier:nil @@ -333,6 +349,16 @@ extern NSBundle *uYouPlusBundle(); } settingItemId:0], + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"DISABLE_HINTS") + titleDescription:LOC(@"DISABLE_HINTS_DESC") + accessibilityIdentifier:nil + switchOn:IsEnabled(@"disableHints_enabled") + switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { + [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"disableHints_enabled"]; + return YES; + } + settingItemId:0], + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"FIX_GOOGLE_SIGNIN") titleDescription:LOC(@"FIX_GOOGLE_SIGNIN_DESC") accessibilityIdentifier:nil diff --git a/uYouPlus.xm b/uYouPlus.xm index cb71919..c2ff0ee 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -61,6 +61,9 @@ static NSString *accessGroupID() { } // +static BOOL IsEnabled(NSString *key) { + return [[NSUserDefaults standardUserDefaults] boolForKey:key]; +} static BOOL isDarkMode() { return ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1); } @@ -439,6 +442,7 @@ BOOL didLateHook = NO; - (BOOL)isLandscapeEngagementPanelSwipeRightToDismissEnabled { return YES; } // Swipe right to dismiss the right panel in fullscreen mode - (BOOL)mainAppCoreClientIosTransientVisualGlitchInPivotBarFix { return NO; } // Fix uYou's label glitching - qnblackcat/uYouPlus#552 - (BOOL)enableSwipeToRemoveInPlaylistWatchEp { return YES; } // Enable swipe right to remove video in Playlist. +- (BOOL)iosEnableShortsPlayerSplitViewController { return NO; } // Fix uYou's button missing in Shorts %end // NOYTPremium - https://github.com/PoomSmart/NoYTPremium/ @@ -1193,7 +1197,7 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha: } %end -// Hide Water mark +// Hide Watermark %hook YTAnnotationsViewController - (void)loadFeaturedChannelWatermark { if (IsEnabled(@"hideChannelWatermark_enabled")) {} @@ -1201,6 +1205,34 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha: } %end +// Disable hints - https://github.com/LillieH001/YouTube-Reborn/blob/v4/ +%group gDisableHints +%hook YTSettings +- (BOOL)areHintsDisabled { + return YES; +} +- (void)setHintsDisabled:(BOOL)arg1 { + %orig(YES); +} +%end +%hook YTUserDefaults +- (BOOL)areHintsDisabled { + return YES; +} +- (void)setHintsDisabled:(BOOL)arg1 { + %orig(YES); +} +%end +%end + +// Bring back the red progress bar +%hook YTColdConfig +- (BOOL)segmentablePlayerBarUpdateColors { + if (IsEnabled(@"redProgressBar_enabled")) { return NO; } + else { return %orig; } +} +%end + // Shorts options %hook YTReelWatchPlaybackOverlayView - (void)setNativePivotButton:(id)arg1 { @@ -1226,11 +1258,9 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha: %end %hook _ASDisplayView -- (void)layoutSubviews { +- (void)didMoveToWindow { %orig; - if (IsEnabled(@"hideBuySuperThanks_enabled")) { - if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.suggested_action"]) { self.hidden = YES; } - } + if ((IsEnabled(@"hideBuySuperThanks_enabled")) && ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.suggested_action"])) { self.hidden = YES; } } %end @@ -1274,10 +1304,14 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha: if (IsEnabled(@"oledKeyBoard_enabled")) { %init(gOLEDKB); } + if (IsEnabled(@"disableHints_enabled")) { + %init(gDisableHints); + } // Disable broken options of uYou - [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"removeYouTubeAds"]; - [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"disableAgeRestriction"]; + [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"removeYouTubeAds"]; + [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"disableAgeRestriction"]; + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"showedWelcomeVC"]; // Change the default value of some uYou's options if (![[[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys] containsObject:@"relatedVideosAtTheEndOfYTVideos"]) { @@ -1289,10 +1323,4 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha: if (![[[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys] containsObject:@"uYouPiPButtonVideoControlsOverlay"]) { [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"uYouPiPButtonVideoControlsOverlay"]; } - // if (![[[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys] containsObject:@"uYouRepeatButtonVideoControlsOverlay"]) { - // [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"uYouRepeatButtonVideoControlsOverlay"]; - // } - // if (![[[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys] containsObject:@"uYouRightRotateButtonVideoControlsOverlay"]) { - // [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"uYouRightRotateButtonVideoControlsOverlay"]; - // } } \ No newline at end of file