Move source files to Sources/
This commit is contained in:
@@ -0,0 +1,425 @@
|
||||
#import "../Tweaks/YouTubeHeader/YTSettingsViewController.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTSearchableSettingsViewController.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTSettingsSectionItem.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTSettingsSectionItemManager.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTUIUtils.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTSettingsPickerViewController.h"
|
||||
#import "uYouPlus.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)
|
||||
- (void)updateTweakSectionWithEntry:(id)entry;
|
||||
@end
|
||||
|
||||
extern NSBundle *uYouPlusBundle();
|
||||
|
||||
// Settings
|
||||
%hook YTAppSettingsPresentationData
|
||||
+ (NSArray *)settingsCategoryOrder {
|
||||
NSArray *order = %orig;
|
||||
NSMutableArray *mutableOrder = [order mutableCopy];
|
||||
NSUInteger insertIndex = [order indexOfObject:@(1)];
|
||||
if (insertIndex != NSNotFound)
|
||||
[mutableOrder insertObject:@(uYouPlusSection) atIndex:insertIndex + 1];
|
||||
return mutableOrder;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTSettingsSectionController
|
||||
- (void)setSelectedItem:(NSUInteger)selectedItem {
|
||||
if (selectedItem != NSNotFound) %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTSettingsSectionItemManager
|
||||
%new(v@:@)
|
||||
- (void)updateTweakSectionWithEntry:(id)entry {
|
||||
NSMutableArray *sectionItems = [NSMutableArray array];
|
||||
NSBundle *tweakBundle = uYouPlusBundle();
|
||||
Class YTSettingsSectionItemClass = %c(YTSettingsSectionItem);
|
||||
YTSettingsViewController *settingsViewController = [self valueForKey:@"_settingsViewControllerDelegate"];
|
||||
|
||||
YTSettingsSectionItem *version = [%c(YTSettingsSectionItem)
|
||||
itemWithTitle:[NSString stringWithFormat:LOC(@"VERSION"), @(OS_STRINGIFY(TWEAK_VERSION))]
|
||||
titleDescription:LOC(@"VERSION_CHECK")
|
||||
accessibilityIdentifier:nil
|
||||
detailTextBlock:nil
|
||||
selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
return [%c(YTUIUtils) openURL:[NSURL URLWithString:@"https://github.com/qnblackcat/uYouPlus/releases/latest"]];
|
||||
}];
|
||||
[sectionItems addObject:version];
|
||||
|
||||
# pragma mark - VideoPlayer
|
||||
YTSettingsSectionItem *videoPlayerGroup = [YTSettingsSectionItemClass itemWithTitle:LOC(@"VIDEO_PLAYER_OPTIONS") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
NSArray <YTSettingsSectionItem *> *rows = @[
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"DISABLE_DOUBLE_TAP_TO_SEEK")
|
||||
titleDescription:LOC(@"DISABLE_DOUBLE_TAP_TO_SEEK_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"doubleTapToSeek_disabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"doubleTapToSeek_disabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"SNAP_TO_CHAPTER")
|
||||
titleDescription:LOC(@"SNAP_TO_CHAPTER_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"snapToChapter_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"snapToChapter_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"PINCH_TO_ZOOM")
|
||||
titleDescription:LOC(@"PINCH_TO_ZOOM_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"pinchToZoom_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"pinchToZoom_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"YT_MINIPLAYER")
|
||||
titleDescription:LOC(@"YT_MINIPLAYER_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"ytMiniPlayer_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"ytMiniPlayer_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"STOCK_VOLUME_HUD")
|
||||
titleDescription:LOC(@"STOCK_VOLUME_HUD_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"stockVolumeHUD_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"stockVolumeHUD_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
];
|
||||
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"VIDEO_PLAYER_OPTIONS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
|
||||
[settingsViewController pushViewController:picker];
|
||||
return YES;
|
||||
}];
|
||||
[sectionItems addObject:videoPlayerGroup];
|
||||
|
||||
# pragma mark - Video Controls Overlay Options
|
||||
YTSettingsSectionItem *videoControlOverlayGroup = [YTSettingsSectionItemClass itemWithTitle:LOC(@"VIDEO_CONTROLS_OVERLAY_OPTIONS") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
NSArray <YTSettingsSectionItem *> *rows = @[
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_AUTOPLAY_SWITCH")
|
||||
titleDescription:LOC(@"HIDE_AUTOPLAY_SWITCH_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideAutoplaySwitch_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideAutoplaySwitch_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_SUBTITLES_BUTTON")
|
||||
titleDescription:LOC(@"HIDE_SUBTITLES_BUTTON_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideCC_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideCC_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_HUD_MESSAGES")
|
||||
titleDescription:LOC(@"HIDE_HUD_MESSAGES_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideHUD_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideHUD_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_PAID_PROMOTION_CARDS")
|
||||
titleDescription:LOC(@"HIDE_PAID_PROMOTION_CARDS_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hidePaidPromotionCard_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hidePaidPromotionCard_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_CHANNEL_WATERMARK")
|
||||
titleDescription:LOC(@"HIDE_CHANNEL_WATERMARK_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideChannelWatermark_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideChannelWatermark_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON")
|
||||
titleDescription:LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hidePreviousAndNextButton_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hidePreviousAndNextButton_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"REPLACE_PREVIOUS_NEXT_BUTTON")
|
||||
titleDescription:LOC(@"REPLACE_PREVIOUS_NEXT_BUTTON_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"replacePreviousAndNextButton_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"replacePreviousAndNextButton_enabled"];
|
||||
return YES;
|
||||
}
|
||||
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
|
||||
switchOn:IsEnabled(@"hideHoverCards_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideHoverCards_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_RIGHT_PANEL")
|
||||
titleDescription:LOC(@"HIDE_RIGHT_PANEL_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideRightPanel_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideRightPanel_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
];
|
||||
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"VIDEO_CONTROLS_OVERLAY_OPTIONS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
|
||||
[settingsViewController pushViewController:picker];
|
||||
return YES;
|
||||
}];
|
||||
[sectionItems addObject:videoControlOverlayGroup];
|
||||
|
||||
# pragma mark - Shorts Controls Overlay Options
|
||||
YTSettingsSectionItem *shortsControlOverlayGroup = [YTSettingsSectionItemClass itemWithTitle:LOC(@"SHORTS_CONTROLS_OVERLAY_OPTIONS") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
NSArray <YTSettingsSectionItem *> *rows = @[
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_SUPER_THANKS")
|
||||
titleDescription:LOC(@"HIDE_SUPER_THANKS_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideBuySuperThanks_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideBuySuperThanks_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_SUBCRIPTIONS")
|
||||
titleDescription:LOC(@"HIDE_SUBCRIPTIONS_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideSubcriptions_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideSubcriptions_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"DISABLE_RESUME_TO_SHORTS")
|
||||
titleDescription:LOC(@"DISABLE_RESUME_TO_SHORTS_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"disableResumeToShorts")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"disableResumeToShorts"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
];
|
||||
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"SHORTS_CONTROLS_OVERLAY_OPTIONS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
|
||||
[settingsViewController pushViewController:picker];
|
||||
return YES;
|
||||
}];
|
||||
[sectionItems addObject:shortsControlOverlayGroup];
|
||||
|
||||
# pragma mark - Theme
|
||||
YTSettingsSectionItem *themeGroup = [YTSettingsSectionItemClass itemWithTitle:LOC(@"THEME_OPTIONS")
|
||||
accessibilityIdentifier:nil
|
||||
detailTextBlock:^NSString *() {
|
||||
switch (GetSelection(@"appTheme")) {
|
||||
case 1:
|
||||
return LOC(@"OLED_DARK_THEME_2");
|
||||
case 2:
|
||||
return LOC(@"OLD_DARK_THEME");
|
||||
case 0:
|
||||
default:
|
||||
return LOC(@"DEFAULT_THEME");
|
||||
}
|
||||
}
|
||||
selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
NSArray <YTSettingsSectionItem *> *rows = @[
|
||||
[YTSettingsSectionItemClass checkmarkItemWithTitle:LOC(@"DEFAULT_THEME") titleDescription:LOC(@"DEFAULT_THEME_DESC") selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@"appTheme"];
|
||||
[settingsViewController reloadData];
|
||||
return YES;
|
||||
}],
|
||||
[YTSettingsSectionItemClass checkmarkItemWithTitle:LOC(@"OLED_DARK_THEME") titleDescription:LOC(@"OLED_DARK_THEME_DESC") selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:1 forKey:@"appTheme"];
|
||||
[settingsViewController reloadData];
|
||||
return YES;
|
||||
}],
|
||||
[YTSettingsSectionItemClass checkmarkItemWithTitle:LOC(@"OLD_DARK_THEME") titleDescription:LOC(@"OLD_DARK_THEME_DESC") selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:2 forKey:@"appTheme"];
|
||||
[settingsViewController reloadData];
|
||||
return YES;
|
||||
}],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"OLED_KEYBOARD")
|
||||
titleDescription:LOC(@"OLED_KEYBOARD_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"oledKeyBoard_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"oledKeyBoard_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0]
|
||||
];
|
||||
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"THEME_OPTIONS") pickerSectionTitle:nil rows:rows selectedItemIndex:GetSelection(@"appTheme") parentResponder:[self parentResponder]];
|
||||
[settingsViewController pushViewController:picker];
|
||||
return YES;
|
||||
}];
|
||||
[sectionItems addObject:themeGroup];
|
||||
|
||||
# pragma mark - Miscellaneous
|
||||
YTSettingsSectionItem *miscellaneousGroup = [YTSettingsSectionItemClass itemWithTitle:LOC(@"MISCELLANEOUS") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
NSArray <YTSettingsSectionItem *> *rows = @[
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"CAST_CONFIRM")
|
||||
titleDescription:LOC(@"CAST_CONFIRM_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"castConfirm_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"castConfirm_enabled"];
|
||||
return YES;
|
||||
}
|
||||
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(@"ENABLE_FLEX")
|
||||
titleDescription:LOC(@"ENABLE_FLEX_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"flex_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"flex_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"ENABLE_YT_STARTUP_ANIMATION")
|
||||
titleDescription:LOC(@"ENABLE_YT_STARTUP_ANIMATION_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"ytStartupAnimation_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"ytStartupAnimation_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_CHIP_BAR")
|
||||
titleDescription:LOC(@"HIDE_CHIP_BAR_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideChipBar_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideChipBar_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_PLAY_NEXT_IN_QUEUE")
|
||||
titleDescription:LOC(@"HIDE_PLAY_NEXT_IN_QUEUE_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hidePlayNextInQueue_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hidePlayNextInQueue_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"IPHONE_LAYOUT")
|
||||
titleDescription:LOC(@"IPHONE_LAYOUT_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"iPhoneLayout_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"iPhoneLayout_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"NEW_MINIPLAYER_STYLE")
|
||||
titleDescription:LOC(@"NEW_MINIPLAYER_STYLE_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"bigYTMiniPlayer_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"bigYTMiniPlayer_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"YT_RE_EXPLORE")
|
||||
titleDescription:LOC(@"YT_RE_EXPLORE_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"reExplore_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"reExplore_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
];
|
||||
|
||||
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"MISCELLANEOUS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
|
||||
[settingsViewController pushViewController:picker];
|
||||
return YES;
|
||||
}];
|
||||
[sectionItems addObject:miscellaneousGroup];
|
||||
|
||||
[settingsViewController setSectionItems:sectionItems forCategory:uYouPlusSection title:@"uYouPlus" titleDescription:LOC(@"TITLE DESCRIPTION") headerHidden:YES];
|
||||
}
|
||||
|
||||
- (void)updateSectionForCategory:(NSUInteger)category withEntry:(id)entry {
|
||||
if (category == uYouPlusSection) {
|
||||
[self updateTweakSectionWithEntry:entry];
|
||||
return;
|
||||
}
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
@@ -0,0 +1,194 @@
|
||||
#import "../Tweaks/YouTubeHeader/YTAppDelegate.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTPlayerViewController.h"
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <dlfcn.h>
|
||||
#import <sys/utsname.h>
|
||||
#import <substrate.h>
|
||||
#import <rootless.h>
|
||||
#import "../Tweaks/YouTubeHeader/YTVideoQualitySwitchOriginalController.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTPlayerViewController.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTWatchController.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTIGuideResponse.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTIGuideResponseSupportedRenderers.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTIPivotBarSupportedRenderers.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTIPivotBarRenderer.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTIBrowseRequest.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTCommonColorPalette.h"
|
||||
#import "../Tweaks/YouTubeHeader/ASCollectionView.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTPlayerOverlay.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTPlayerOverlayProvider.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTReelWatchPlaybackOverlayView.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTReelPlayerBottomButton.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTReelPlayerViewController.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTAlertView.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTISectionListRenderer.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTIMenuConditionalServiceItemRenderer.h"
|
||||
|
||||
#define LOC(x) [tweakBundle localizedStringForKey:x value:nil table:nil]
|
||||
#define YT_BUNDLE_ID @"com.google.ios.youtube"
|
||||
#define YT_NAME @"YouTube"
|
||||
#define DEFAULT_RATE 2.0f // YTSpeed
|
||||
|
||||
// IAmYouTube
|
||||
@interface SSOConfiguration : NSObject
|
||||
@end
|
||||
|
||||
// uYouPlus
|
||||
@interface YTChipCloudCell : UIView
|
||||
@end
|
||||
|
||||
@interface YTPlayabilityResolutionUserActionUIController : NSObject // Skips content warning before playing *some videos - @PoomSmart
|
||||
- (void)confirmAlertDidPressConfirm;
|
||||
@end
|
||||
|
||||
@interface YTMainAppControlsOverlayView : UIView
|
||||
@end
|
||||
|
||||
@interface YTTransportControlsButtonView : UIView
|
||||
@end
|
||||
|
||||
@interface _ASCollectionViewCell : UICollectionViewCell
|
||||
- (id)node;
|
||||
@end
|
||||
|
||||
@interface YTAsyncCollectionView : UICollectionView
|
||||
- (void)removeShortsAndFeaturesAdsAtIndexPath:(NSIndexPath *)indexPath;
|
||||
@end
|
||||
|
||||
@interface FRPSliderCell : UITableViewCell
|
||||
@end
|
||||
|
||||
@interface boolSettingsVC : UIViewController
|
||||
@end
|
||||
|
||||
@interface PlayerManager : NSObject
|
||||
- (float)progress;
|
||||
@end
|
||||
|
||||
@interface YTSegmentableInlinePlayerBarView
|
||||
@property (nonatomic, assign, readwrite) BOOL enableSnapToChapter;
|
||||
@end
|
||||
|
||||
@interface YTPlaylistHeaderViewController: UIViewController
|
||||
@property UIButton *downloadsButton;
|
||||
@end
|
||||
|
||||
// YTSpeed
|
||||
@interface YTVarispeedSwitchControllerOption : NSObject
|
||||
- (id)initWithTitle:(id)title rate:(float)rate;
|
||||
@end
|
||||
|
||||
@interface MLHAMQueuePlayer : NSObject
|
||||
@property id playerEventCenter;
|
||||
@property id delegate;
|
||||
- (void)setRate:(float)rate;
|
||||
- (void)internalSetRate;
|
||||
@end
|
||||
|
||||
@interface MLPlayerStickySettings : NSObject
|
||||
- (void)setRate:(float)rate;
|
||||
@end
|
||||
|
||||
@interface MLPlayerEventCenter : NSObject
|
||||
- (void)broadcastRateChange:(float)rate;
|
||||
@end
|
||||
|
||||
@interface HAMPlayerInternal : NSObject
|
||||
- (void)setRate:(float)rate;
|
||||
@end
|
||||
|
||||
// iOS16 fix
|
||||
@interface OBPrivacyLinkButton : UIButton
|
||||
- (instancetype)initWithCaption:(NSString *)caption
|
||||
buttonText:(NSString *)buttonText
|
||||
image:(UIImage *)image
|
||||
imageSize:(CGSize)imageSize
|
||||
useLargeIcon:(BOOL)useLargeIcon
|
||||
displayLanguage:(NSString *)displayLanguage;
|
||||
@end
|
||||
|
||||
// uYouLocal fix
|
||||
@interface YTLocalPlaybackController : NSObject
|
||||
- (id)activeVideo;
|
||||
@end
|
||||
|
||||
// uYou theme fix
|
||||
@interface YTAppDelegate ()
|
||||
@property(nonatomic, strong) id downloadsVC;
|
||||
@end
|
||||
|
||||
|
||||
// BigYTMiniPlayer
|
||||
@interface YTMainAppVideoPlayerOverlayView : UIView
|
||||
- (UIViewController *)_viewControllerForAncestor;
|
||||
@end
|
||||
|
||||
@interface YTWatchMiniBarView : UIView
|
||||
@end
|
||||
|
||||
// YTAutoFullScreen
|
||||
@interface YTPlayerViewController (YTAFS)
|
||||
- (void)autoFullscreen;
|
||||
// DontEatMycontent
|
||||
- (id)activeVideoPlayerOverlay;
|
||||
- (id)playerView;
|
||||
// YTSpeed
|
||||
@property id activeVideo;
|
||||
@property float playbackRate;
|
||||
- (void)singleVideo:(id)video playbackRateDidChange:(float)rate;
|
||||
@end
|
||||
|
||||
// App Theme
|
||||
@interface YCHLiveChatView : UIView
|
||||
@end
|
||||
|
||||
@interface YTFullscreenEngagementOverlayView : UIView
|
||||
@end
|
||||
|
||||
@interface YTRelatedVideosView : UIView
|
||||
@end
|
||||
|
||||
@interface ELMView : UIView
|
||||
@end
|
||||
|
||||
@interface ASWAppSwitcherCollectionViewCell : UIView
|
||||
@end
|
||||
|
||||
@interface ASScrollView : UIView
|
||||
@end
|
||||
|
||||
@interface UIKeyboardLayoutStar : UIView
|
||||
@end
|
||||
|
||||
@interface UIKeyboardDockView : UIView
|
||||
@end
|
||||
|
||||
@interface _ASDisplayView : UIView
|
||||
@end
|
||||
|
||||
@interface YTCommentDetailHeaderCell : UIView
|
||||
@end
|
||||
|
||||
@interface SponsorBlockSettingsController : UITableViewController
|
||||
@end
|
||||
|
||||
@interface SponsorBlockViewController : UIViewController
|
||||
@end
|
||||
|
||||
@interface UICandidateViewController : UIViewController
|
||||
@end
|
||||
|
||||
@interface UIPredictionViewController : UIViewController
|
||||
@end
|
||||
|
||||
@interface FRPreferences : UITableViewController
|
||||
@end
|
||||
|
||||
@interface FRPSelectListTable : UITableViewController
|
||||
@end
|
||||
|
||||
@interface settingsReorderTable : UIViewController
|
||||
@property(nonatomic, strong) UITableView *tableView;
|
||||
@end
|
||||
+1045
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user