mirror of
https://github.com/SoPat712/YTLitePlus.git
synced 2025-08-22 02:38:45 -04:00
Merge pull request #9 from arichorn/main
Improvements & Removed Duplicated Options
This commit is contained in:
@@ -156,6 +156,7 @@ static BOOL pinkContrastMode() {
|
||||
%orig(textColor);
|
||||
}
|
||||
%end
|
||||
/* disabled the code to stop crashing
|
||||
%hook _ASDisplayView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
@@ -180,6 +181,7 @@ static BOOL pinkContrastMode() {
|
||||
label.textColor = [UIColor whiteColor];
|
||||
}
|
||||
%end
|
||||
*/
|
||||
%end
|
||||
|
||||
%group gRedContrastMode // Red Contrast Mode
|
||||
|
@@ -67,46 +67,6 @@ extern NSBundle *YTLitePlusBundle();
|
||||
# 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(@"AUTO_FULLSCREEN")
|
||||
titleDescription:LOC(@"AUTO_FULLSCREEN_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"autoFull_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"autoFull_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"TAP_TO_SKIP")
|
||||
titleDescription:LOC(@"TAP_TO_SKIP_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"tapToSkip_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"tapToSkip_enabled"];
|
||||
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
|
||||
@@ -156,56 +116,6 @@ extern NSBundle *YTLitePlusBundle();
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[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_SHADOW_OVERLAY_BUTTONS")
|
||||
titleDescription:LOC(@"HIDE_SHADOW_OVERLAY_BUTTONS_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
@@ -216,56 +126,6 @@ extern NSBundle *YTLitePlusBundle();
|
||||
}
|
||||
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(@"DISABLE_VIDEO_PLAYER_ZOOM")
|
||||
titleDescription:LOC(@"DISABLE_VIDEO_PLAYER_ZOOM")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"disableVideoPlayerZoom_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"disableVideoPlayerZoom_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
|
||||
@@ -284,16 +144,6 @@ extern NSBundle *YTLitePlusBundle();
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideHeatwaves_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_DARK_OVERLAY_BACKGROUND")
|
||||
titleDescription:LOC(@"HIDE_DARK_OVERLAY_BACKGROUND_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideOverlayDarkBackground_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideOverlayDarkBackground_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]];
|
||||
@@ -302,95 +152,6 @@ extern NSBundle *YTLitePlusBundle();
|
||||
}];
|
||||
[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_SHORTS_CHANNEL_AVATAR")
|
||||
titleDescription:LOC(@"HIDE_SHORTS_CHANNEL_AVATAR_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideShortsChannelAvatar_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideShortsChannelAvatar_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_SHORTS_LIKE_BUTTON")
|
||||
titleDescription:LOC(@"HIDE_SHORTS_LIKE_BUTTON_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideShortsLikeButton_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideShortsLikeButton_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_SHORTS_DISLIKE_BUTTON")
|
||||
titleDescription:LOC(@"HIDE_SHORTS_DISLIKE_BUTTON_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideShortsDislikeButton_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideShortsDislikeButton_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_SHORTS_COMMENT_BUTTON")
|
||||
titleDescription:LOC(@"HIDE_SHORTS_COMMENT_BUTTON_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideShortsCommentButton_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideShortsCommentButton_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_SHORTS_REMIX_BUTTON")
|
||||
titleDescription:LOC(@"HIDE_SHORTS_REMIX_BUTTON_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideShortsRemixButton_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideShortsRemixButton_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_SHORTS_SHARE_BUTTON")
|
||||
titleDescription:LOC(@"HIDE_SHORTS_SHARE_BUTTON_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideShortsShareButton_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideShortsShareButton_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[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_SUBSCRIPTIONS")
|
||||
titleDescription:LOC(@"HIDE_SUBSCRIPTIONS_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideSubscriptions_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideSubscriptions_enabled"];
|
||||
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 - LowContrastMode
|
||||
YTSettingsSectionItem *lowContrastModeSection = [YTSettingsSectionItemClass itemWithTitle:LOC(@"LCM_CHOOSE_COLOR")
|
||||
accessibilityIdentifier:nil
|
||||
@@ -498,7 +259,7 @@ extern NSBundle *YTLitePlusBundle();
|
||||
}
|
||||
selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
NSArray <YTSettingsSectionItem *> *rows = @[
|
||||
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"Default Version" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"Latest Version" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@"versionSpoofer"];
|
||||
[settingsViewController reloadData];
|
||||
return YES;
|
||||
@@ -619,26 +380,6 @@ extern NSBundle *YTLitePlusBundle();
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_YOUTUBE_LOGO")
|
||||
titleDescription:LOC(@"HIDE_YOUTUBE_LOGO_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideYouTubeLogo_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideYouTubeLogo_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_MODERN_INTERFACE")
|
||||
titleDescription:LOC(@"HIDE_MODERN_INTERFACE_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
@@ -679,16 +420,6 @@ extern NSBundle *YTLitePlusBundle();
|
||||
}
|
||||
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(@"NEW_MINIPLAYER_STYLE")
|
||||
titleDescription:LOC(@"NEW_MINIPLAYER_STYLE_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
@@ -709,16 +440,6 @@ extern NSBundle *YTLitePlusBundle();
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_NOTIFICATION_BUTTON")
|
||||
titleDescription:LOC(@"HIDE_NOTIFICATION_BUTTON_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideNotificationButton_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideNotificationButton_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_SPONSORBLOCK_BUTTON")
|
||||
titleDescription:LOC(@"HIDE_SPONSORBLOCK_BUTTON_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
@@ -739,26 +460,6 @@ extern NSBundle *YTLitePlusBundle();
|
||||
}
|
||||
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],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"YT_SPEED")
|
||||
titleDescription:LOC(@"YT_SPEED_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"ytSpeed_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"ytSpeed_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"ENABLE_FLEX")
|
||||
titleDescription:LOC(@"ENABLE_FLEX_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
@@ -769,7 +470,7 @@ extern NSBundle *YTLitePlusBundle();
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:@"Enable App Version Spoofer (Lite)"
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Enable App Version Spoofer (Lite)")
|
||||
titleDescription:LOC(@"Enable this to use the Version Spoofer and select your perferred version below. App restart is required.")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"enableVersionSpoofer_enabled")
|
||||
|
@@ -36,10 +36,12 @@ static BOOL version8() {
|
||||
}
|
||||
|
||||
%group gDefault
|
||||
%hook YTVersionUtils // Default
|
||||
%hook YTVersionUtils
|
||||
+ (NSString *)appVersion {
|
||||
NSString *originalVersion = %orig;
|
||||
return originalVersion;
|
||||
NSURL *versionURL = [NSURL URLWithString:@"https://raw.githubusercontent.com/arichorn/YTAppVersionSpoofer-WIP/main/version.txt"];
|
||||
NSString *latestVersion = [NSString stringWithContentsOfURL:versionURL encoding:NSUTF8StringEncoding error:nil];
|
||||
|
||||
return latestVersion ?: @"18.27.3"; // <-- Fallback Version
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
533
YTLitePlus.xm
533
YTLitePlus.xm
@@ -14,25 +14,6 @@ NSBundle *YTLitePlusBundle() {
|
||||
}
|
||||
NSBundle *tweakBundle = YTLitePlusBundle();
|
||||
|
||||
// Keychain fix
|
||||
static NSString *accessGroupID() {
|
||||
NSDictionary *query = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
(__bridge NSString *)kSecClassGenericPassword, (__bridge NSString *)kSecClass,
|
||||
@"bundleSeedID", kSecAttrAccount,
|
||||
@"", kSecAttrService,
|
||||
(id)kCFBooleanTrue, kSecReturnAttributes,
|
||||
nil];
|
||||
CFDictionaryRef result = nil;
|
||||
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, (CFTypeRef *)&result);
|
||||
if (status == errSecItemNotFound)
|
||||
status = SecItemAdd((__bridge CFDictionaryRef)query, (CFTypeRef *)&result);
|
||||
if (status != errSecSuccess)
|
||||
return nil;
|
||||
NSString *accessGroup = [(__bridge NSDictionary *)result objectForKey:(__bridge NSString *)kSecAttrAccessGroup];
|
||||
|
||||
return accessGroup;
|
||||
}
|
||||
|
||||
//
|
||||
static BOOL IsEnabled(NSString *key) {
|
||||
return [[NSUserDefaults standardUserDefaults] boolForKey:key];
|
||||
@@ -71,7 +52,7 @@ static BOOL IsEnabled(NSString *key) {
|
||||
}
|
||||
%end
|
||||
|
||||
# pragma mark - Hide Notification Button
|
||||
# pragma mark - Hide SponsorBlock Button
|
||||
%hook YTRightNavigationButtons
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
@@ -79,21 +60,17 @@ static BOOL IsEnabled(NSString *key) {
|
||||
|
||||
- (void)layoutSubviews {
|
||||
%orig;
|
||||
if (IsEnabled(@"hideNotificationButton_enabled")) {
|
||||
self.notificationButton.hidden = YES;
|
||||
}
|
||||
if (IsEnabled(@"hideSponsorBlockButton_enabled")) {
|
||||
self.sponsorBlockButton.hidden = YES;
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Hide Cast Button since Cercube's option is not working
|
||||
// Hide Video Player Cast Button
|
||||
%group gHideCastButton
|
||||
%hook MDXPlaybackRouteButtonController
|
||||
- (BOOL)isPersistentCastIconEnabled { return NO; }
|
||||
- (void)updateRouteButton:(id)arg1 {} // hide Cast button in video controls overlay
|
||||
- (void)updateAllRouteButtons {} // hide Cast button in Nav bar
|
||||
%end
|
||||
|
||||
%hook YTSettings
|
||||
@@ -101,22 +78,21 @@ static BOOL IsEnabled(NSString *key) {
|
||||
%end
|
||||
%end
|
||||
|
||||
// Hide CC / Hide Autoplay switch / Enable Share Button / Enable Save to Playlist Button
|
||||
// Enable Share Button / Enable Save to Playlist Button
|
||||
%hook YTMainAppControlsOverlayView
|
||||
- (void)setClosedCaptionsOrSubtitlesButtonAvailable:(BOOL)arg1 { // hide CC button
|
||||
return IsEnabled(@"hideCC_enabled") ? %orig(NO) : %orig;
|
||||
- (void)setShareButtonAvailable:(BOOL)arg1 { // enable Share button
|
||||
if (IsEnabled(@"enableShareButton_enabled")) {
|
||||
%orig(YES);
|
||||
} else {
|
||||
%orig(NO);
|
||||
}
|
||||
}
|
||||
- (void)setAutoplaySwitchButtonRenderer:(id)arg1 { // hide Autoplay switch
|
||||
if (IsEnabled(@"hideAutoplaySwitch_enabled")) {}
|
||||
else { return %orig; }
|
||||
}
|
||||
- (void)setShareButtonAvailable:(BOOL)arg2 { // enable Share Button
|
||||
if (IsEnabled(@"enableShareButton_enabled")) {}
|
||||
else { return %orig; }
|
||||
}
|
||||
- (void)setAddToButtonAvailable:(BOOL)arg2 { // enable Save to Playlist Button
|
||||
if (IsEnabled(@"enableSaveToButton_enabled")) {}
|
||||
else { return %orig; }
|
||||
- (void)setAddToButtonAvailable:(BOOL)arg1 { // enable Save To Playlist button
|
||||
if (IsEnabled(@"enableSaveToButton_enabled")) {
|
||||
%orig(YES);
|
||||
} else {
|
||||
%orig(NO);
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
@@ -127,22 +103,6 @@ static BOOL IsEnabled(NSString *key) {
|
||||
}
|
||||
%end
|
||||
|
||||
// Hide Next & Previous button
|
||||
%group gHidePreviousAndNextButton
|
||||
%hook YTColdConfig
|
||||
- (BOOL)removeNextPaddleForSingletonVideos { return YES; }
|
||||
- (BOOL)removePreviousPaddleForSingletonVideos { return YES; }
|
||||
%end
|
||||
%end
|
||||
|
||||
%group gHideOverlayDarkBackground
|
||||
%hook YTMainAppVideoPlayerOverlayView
|
||||
- (void)setBackgroundVisible:(BOOL)arg1 {
|
||||
%orig(NO);
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
%group gHideVideoPlayerShadowOverlayButtons
|
||||
%hook YTMainAppControlsOverlayView
|
||||
- (void)layoutSubviews {
|
||||
@@ -154,23 +114,12 @@ static BOOL IsEnabled(NSString *key) {
|
||||
MSHookIvar<YTPlaybackButton *>(self, "_playPauseButton").backgroundColor = nil;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTPlayBackButton
|
||||
- (UIColor *)backgroundColor {
|
||||
return [UIColor colorWithRed: 0.00 green: 0.00 blue: 0.00 alpha: 0.00];
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
// A/B flags
|
||||
%hook YTColdConfig
|
||||
- (BOOL)respectDeviceCaptionSetting { return NO; } // YouRememberCaption: https://poomsmart.github.io/repo/depictions/youremembercaption.html
|
||||
- (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
|
||||
%end
|
||||
|
||||
// Disabled App Breaking Dialog Flags - @arichorn
|
||||
%hook YTColdConfig
|
||||
- (BOOL)commercePlatformClientEnablePopupWebviewInWebviewDialogController { return NO;}
|
||||
%end
|
||||
|
||||
@@ -182,25 +131,6 @@ static BOOL IsEnabled(NSString *key) {
|
||||
- (BOOL)shouldShowUpgradeDialog { return NO;}
|
||||
%end
|
||||
|
||||
// Disable YouTube Ads - @arichorn
|
||||
%group gRemoveAds
|
||||
%hook YTHotConfig
|
||||
- (BOOL)disableAfmaIdfaCollection { return NO; }
|
||||
%end
|
||||
|
||||
%hook YTIElementRenderer
|
||||
- (NSData *)elementData {
|
||||
if (self.hasCompatibilityOptions && self.compatibilityOptions.hasAdLoggingData)
|
||||
return nil;
|
||||
NSString *description = [self description];
|
||||
// product_carousel.eml product_engagement_panel.eml product_item.eml
|
||||
if ([description containsString:@"brand_promo"] || [description containsString:@"statement_banner"])
|
||||
return [NSData data];
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
// Disable Wifi Related Settings - @arichorn
|
||||
%group gDisableWifiRelatedSettings
|
||||
%hook YTSettingsSectionItemManager
|
||||
@@ -217,16 +147,16 @@ static BOOL IsEnabled(NSString *key) {
|
||||
// YTNoModernUI - @arichorn
|
||||
%group gYTNoModernUI
|
||||
%hook YTVersionUtils // YTNoModernUI Version
|
||||
+ (NSString *)appVersion { return @"16.42.3"; }
|
||||
+ (NSString *)appVersion { return @"17.11.2"; }
|
||||
%end
|
||||
|
||||
%hook YTInlinePlayerBarContainerView // Red Progress Bar - YTNoModernUI
|
||||
%hook YTInlinePlayerBarContainerView // Red Progress Bar - YTNoModernUI - made by Dayanch96
|
||||
- (id)quietProgressBarColor {
|
||||
return [UIColor redColor];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTSegmentableInlinePlayerBarView // Old Buffer Bar - YTNoModernUI
|
||||
%hook YTSegmentableInlinePlayerBarView // Gray Buffer Progress - YTNoModernUI - made by Dayanch96
|
||||
- (void)setBufferedProgressBarColor:(id)arg1 {
|
||||
[UIColor colorWithRed:0.65 green:0.65 blue:0.65 alpha:0.60];
|
||||
}
|
||||
@@ -241,6 +171,9 @@ static BOOL IsEnabled(NSString *key) {
|
||||
%end
|
||||
|
||||
%hook YTColdConfig
|
||||
// 16.xx.x Styled YouTube Channel Page Interface - YTNoModernUI
|
||||
- (BOOL)channelsClientConfigIosChannelNavRestructuring { return NO; }
|
||||
- (BOOL)channelsClientConfigIosMultiPartChannelHeader { return NO; }
|
||||
// Disable Modern Content - YTNoModernUI
|
||||
- (BOOL)creatorClientConfigEnableStudioModernizedMdeThumbnailPickerForClient { return NO; }
|
||||
- (BOOL)cxClientEnableModernizedActionSheet { return NO; }
|
||||
@@ -282,9 +215,6 @@ static BOOL IsEnabled(NSString *key) {
|
||||
- (BOOL)mainAppCoreClientEnableClientCinematicPlaylists { return NO; }
|
||||
- (BOOL)mainAppCoreClientEnableClientCinematicPlaylistsPostMvp { return NO; }
|
||||
- (BOOL)mainAppCoreClientEnableClientCinematicTablets { return NO; }
|
||||
// 16.42.3 Styled YouTube Channel Page Interface - YTNoModernUI
|
||||
- (BOOL)channelsClientConfigIosChannelNavRestructuring { return NO; }
|
||||
- (BOOL)channelsClientConfigIosMultiPartChannelHeader { return NO; }
|
||||
// Disable Optional Content - YTNoModernUI
|
||||
- (BOOL)elementsClientIosElementsEnableLayoutUpdateForIob { return NO; }
|
||||
- (BOOL)supportElementsInMenuItemSupportedRenderers { return NO; }
|
||||
@@ -299,20 +229,6 @@ static BOOL IsEnabled(NSString *key) {
|
||||
%end
|
||||
%end
|
||||
|
||||
// Disable Video Player Zoom - @arichorn
|
||||
%group gDisableVideoPlayerZoom
|
||||
%hook YTColdConfig
|
||||
- (BOOL)enableFreeZoomHaptics { return NO; }
|
||||
- (BOOL)enableFreeZoomInPotraitOrientation { return NO; }
|
||||
- (BOOL)isVideoZoomEnabled { return NO; }
|
||||
- (BOOL)uiSystemsClientGlobalConfigEnableDisplayZoomMenuBugFix { return NO; }
|
||||
- (BOOL)videoZoomFreeZoomEnabledGlobalConfig { return NO; }
|
||||
- (BOOL)videoZoomFreeZoomIndicatorPersistentGlobalConfig { return NO; }
|
||||
- (BOOL)videoZoomFreeZoomIndicatorTopGlobalConfig { return NO; }
|
||||
- (BOOL)deprecateTabletPinchFullscreenGestures { return NO; } // <-- this is an iPad Exclusive Flag
|
||||
%end
|
||||
%end
|
||||
|
||||
// Hide YouTube Heatwaves in Video Player (YouTube v17.19.2-present) - @level3tjg - https://www.reddit.com/r/jailbreak/comments/v29yvk/
|
||||
%group gHideHeatwaves
|
||||
%hook YTInlinePlayerBarContainerView
|
||||
@@ -320,35 +236,6 @@ static BOOL IsEnabled(NSString *key) {
|
||||
%end
|
||||
%end
|
||||
|
||||
// Replace Next & Previous button with Fast forward & Rewind button
|
||||
%group gReplacePreviousAndNextButton
|
||||
%hook YTColdConfig
|
||||
- (BOOL)replaceNextPaddleWithFastForwardButtonForSingletonVods { return YES; }
|
||||
- (BOOL)replacePreviousPaddleWithRewindButtonForSingletonVods { return YES; }
|
||||
%end
|
||||
%end
|
||||
|
||||
// Hide HUD Messages
|
||||
%hook YTHUDMessageView
|
||||
- (id)initWithMessage:(id)arg1 dismissHandler:(id)arg2 {
|
||||
return IsEnabled(@"hideHUD_enabled") ? nil : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// YTAutoFullScreen: https://github.com/PoomSmart/YTAutoFullScreen/
|
||||
%hook YTPlayerViewController
|
||||
- (void)loadWithPlayerTransition:(id)arg1 playbackConfig:(id)arg2 {
|
||||
%orig;
|
||||
if (IsEnabled(@"autoFull_enabled"))
|
||||
[NSTimer scheduledTimerWithTimeInterval:0.75 target:self selector:@selector(autoFullscreen) userInfo:nil repeats:NO];
|
||||
}
|
||||
%new
|
||||
- (void)autoFullscreen {
|
||||
YTWatchController *watchController = [self valueForKey:@"_UIDelegate"];
|
||||
[watchController showFullScreen];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTYouThereController
|
||||
- (BOOL)shouldShowYouTherePrompt { return NO; }
|
||||
%end
|
||||
@@ -358,214 +245,6 @@ static BOOL IsEnabled(NSString *key) {
|
||||
- (BOOL)isPromptForLocalNetworkPermissionsEnabled { return NO; }
|
||||
%end
|
||||
|
||||
// YTNoPaidPromo: https://github.com/PoomSmart/YTNoPaidPromo
|
||||
%hook YTMainAppVideoPlayerOverlayViewController
|
||||
- (void)setPaidContentWithPlayerData:(id)data {
|
||||
if (IsEnabled(@"hidePaidPromotionCard_enabled")) {}
|
||||
else { return %orig; }
|
||||
}
|
||||
- (void)playerOverlayProvider:(YTPlayerOverlayProvider *)provider didInsertPlayerOverlay:(YTPlayerOverlay *)overlay {
|
||||
if ([[overlay overlayIdentifier] isEqualToString:@"player_overlay_paid_content"] && IsEnabled(@"hidePaidPromotionCard_enabled")) return;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTInlineMutedPlaybackPlayerOverlayViewController
|
||||
- (void)setPaidContentWithPlayerData:(id)data {
|
||||
if (IsEnabled(@"hidePaidPromotionCard_enabled")) {}
|
||||
else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
# pragma mark - IAmYouTube - https://github.com/PoomSmart/IAmYouTube/
|
||||
%hook YTVersionUtils
|
||||
+ (NSString *)appName { return YT_NAME; }
|
||||
+ (NSString *)appID { return YT_BUNDLE_ID; }
|
||||
%end
|
||||
|
||||
%hook GCKBUtils
|
||||
+ (NSString *)appIdentifier { return YT_BUNDLE_ID; }
|
||||
%end
|
||||
|
||||
%hook GPCDeviceInfo
|
||||
+ (NSString *)bundleId { return YT_BUNDLE_ID; }
|
||||
%end
|
||||
|
||||
%hook OGLBundle
|
||||
+ (NSString *)shortAppName { return YT_NAME; }
|
||||
%end
|
||||
|
||||
%hook GVROverlayView
|
||||
+ (NSString *)appName { return YT_NAME; }
|
||||
%end
|
||||
|
||||
%hook OGLPhenotypeFlagServiceImpl
|
||||
- (NSString *)bundleId { return YT_BUNDLE_ID; }
|
||||
%end
|
||||
|
||||
%hook APMAEU
|
||||
+ (BOOL)isFAS { return YES; }
|
||||
%end
|
||||
|
||||
%hook GULAppEnvironmentUtil
|
||||
+ (BOOL)isFromAppStore { return YES; }
|
||||
%end
|
||||
|
||||
%hook SSOConfiguration
|
||||
- (id)initWithClientID:(id)clientID supportedAccountServices:(id)supportedAccountServices {
|
||||
self = %orig;
|
||||
[self setValue:YT_NAME forKey:@"_shortAppName"];
|
||||
[self setValue:YT_BUNDLE_ID forKey:@"_applicationIdentifier"];
|
||||
return self;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook NSBundle
|
||||
- (NSString *)bundleIdentifier {
|
||||
NSArray *address = [NSThread callStackReturnAddresses];
|
||||
Dl_info info = {0};
|
||||
if (dladdr((void *)[address[2] longLongValue], &info) == 0)
|
||||
return %orig;
|
||||
NSString *path = [NSString stringWithUTF8String:info.dli_fname];
|
||||
if ([path hasPrefix:NSBundle.mainBundle.bundlePath])
|
||||
return YT_BUNDLE_ID;
|
||||
return %orig;
|
||||
}
|
||||
- (id)objectForInfoDictionaryKey:(NSString *)key {
|
||||
if ([key isEqualToString:@"CFBundleIdentifier"])
|
||||
return YT_BUNDLE_ID;
|
||||
if ([key isEqualToString:@"CFBundleDisplayName"] || [key isEqualToString:@"CFBundleName"])
|
||||
return YT_NAME;
|
||||
return %orig;
|
||||
}
|
||||
// Fix Google Sign in by @PoomSmart and @level3tjg (qnblackcat/uYouPlus#684)
|
||||
- (NSDictionary *)infoDictionary {
|
||||
NSMutableDictionary *info = %orig.mutableCopy;
|
||||
NSString *altBundleIdentifier = info[@"ALTBundleIdentifier"];
|
||||
if (altBundleIdentifier) info[@"CFBundleIdentifier"] = altBundleIdentifier;
|
||||
return info;
|
||||
}
|
||||
%end
|
||||
|
||||
// Fix login for YouTube 18.13.2 and higher
|
||||
%hook SSOKeychainHelper
|
||||
+ (NSString *)accessGroup {
|
||||
return accessGroupID();
|
||||
}
|
||||
+ (NSString *)sharedAccessGroup {
|
||||
return accessGroupID();
|
||||
}
|
||||
%end
|
||||
|
||||
// Fix login for YouTube 17.33.2 and higher - @BandarHL
|
||||
// https://gist.github.com/BandarHL/492d50de46875f9ac7a056aad084ac10
|
||||
%hook SSOKeychainCore
|
||||
+ (NSString *)accessGroup {
|
||||
return accessGroupID();
|
||||
}
|
||||
|
||||
+ (NSString *)sharedAccessGroup {
|
||||
return accessGroupID();
|
||||
}
|
||||
%end
|
||||
|
||||
// Fix App Group Directory by move it to document directory
|
||||
%hook NSFileManager
|
||||
- (NSURL *)containerURLForSecurityApplicationGroupIdentifier:(NSString *)groupIdentifier {
|
||||
if (groupIdentifier != nil) {
|
||||
NSArray *paths = [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask];
|
||||
NSURL *documentsURL = [paths lastObject];
|
||||
return [documentsURL URLByAppendingPathComponent:@"AppGroup"];
|
||||
}
|
||||
return %orig(groupIdentifier);
|
||||
}
|
||||
%end
|
||||
|
||||
// Shorts Controls Overlay Options
|
||||
%hook YTReelWatchPlaybackOverlayView
|
||||
- (void)setNativePivotButton:(id)arg1 {
|
||||
if (IsEnabled(@"hideShortsChannelAvatar_enabled")) {}
|
||||
else { return %orig; }
|
||||
}
|
||||
- (void)setReelLikeButton:(id)arg1 {
|
||||
if (IsEnabled(@"hideShortsLikeButton_enabled")) {}
|
||||
else { return %orig; }
|
||||
}
|
||||
- (void)setReelDislikeButton:(id)arg1 {
|
||||
if (IsEnabled(@"hideShortsDislikeButton_enabled")) {}
|
||||
else { return %orig; }
|
||||
}
|
||||
- (void)setViewCommentButton:(id)arg1 {
|
||||
if (IsEnabled(@"hideShortsCommentButton_enabled")) {}
|
||||
else { return %orig; }
|
||||
}
|
||||
- (void)setRemixButton:(id)arg1 {
|
||||
if (IsEnabled(@"hideShortsRemixButton_enabled")) {}
|
||||
else { return %orig; }
|
||||
}
|
||||
- (void)setShareButton:(id)arg1 {
|
||||
if (IsEnabled(@"hideShortsShareButton_enabled")) {}
|
||||
else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
%hook _ASDisplayView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if ((IsEnabled(@"hideBuySuperThanks_enabled")) && ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.suggested_action"])) {
|
||||
self.hidden = YES;
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTReelWatchRootViewController
|
||||
- (void)setPausedStateCarouselView {
|
||||
if (IsEnabled(@"hideSubscriptions_enabled")) {}
|
||||
else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTColdConfig
|
||||
- (BOOL)enableResumeToShorts {
|
||||
if (IsEnabled(@"disableResumeToShorts")) { return NO; }
|
||||
else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
// YTReExplore: https://github.com/PoomSmart/YTReExplore/
|
||||
%group gReExplore
|
||||
static void replaceTab(YTIGuideResponse *response) {
|
||||
NSMutableArray <YTIGuideResponseSupportedRenderers *> *renderers = [response itemsArray];
|
||||
for (YTIGuideResponseSupportedRenderers *guideRenderers in renderers) {
|
||||
YTIPivotBarRenderer *pivotBarRenderer = [guideRenderers pivotBarRenderer];
|
||||
NSMutableArray <YTIPivotBarSupportedRenderers *> *items = [pivotBarRenderer itemsArray];
|
||||
NSUInteger shortIndex = [items indexOfObjectPassingTest:^BOOL(YTIPivotBarSupportedRenderers *renderers, NSUInteger idx, BOOL *stop) {
|
||||
return [[[renderers pivotBarItemRenderer] pivotIdentifier] isEqualToString:@"FEshorts"];
|
||||
}];
|
||||
if (shortIndex != NSNotFound) {
|
||||
[items removeObjectAtIndex:shortIndex];
|
||||
NSUInteger exploreIndex = [items indexOfObjectPassingTest:^BOOL(YTIPivotBarSupportedRenderers *renderers, NSUInteger idx, BOOL *stop) {
|
||||
return [[[renderers pivotBarItemRenderer] pivotIdentifier] isEqualToString:[%c(YTIBrowseRequest) browseIDForExploreTab]];
|
||||
}];
|
||||
if (exploreIndex == NSNotFound) {
|
||||
YTIPivotBarSupportedRenderers *exploreTab = [%c(YTIPivotBarRenderer) pivotSupportedRenderersWithBrowseId:[%c(YTIBrowseRequest) browseIDForExploreTab] title:@"Explore" iconType:292];
|
||||
[items insertObject:exploreTab atIndex:1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%hook YTGuideServiceCoordinator
|
||||
- (void)handleResponse:(YTIGuideResponse *)response withCompletion:(id)completion {
|
||||
replaceTab(response);
|
||||
%orig(response, completion);
|
||||
}
|
||||
- (void)handleResponse:(YTIGuideResponse *)response error:(id)error completion:(id)completion {
|
||||
replaceTab(response);
|
||||
%orig(response, error, completion);
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
// BigYTMiniPlayer: https://github.com/Galactic-Dev/BigYTMiniPlayer
|
||||
%group Main
|
||||
%hook YTWatchMiniBarView
|
||||
@@ -591,72 +270,6 @@ static void replaceTab(YTIGuideResponse *response) {
|
||||
%end
|
||||
%end
|
||||
|
||||
// YTSpeed - https://github.com/Lyvendia/YTSpeed
|
||||
%group gYTSpeed
|
||||
%hook YTVarispeedSwitchController
|
||||
- (id)init {
|
||||
id result = %orig;
|
||||
|
||||
const int size = 17;
|
||||
float speeds[] = {0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 5.0};
|
||||
id varispeedSwitchControllerOptions[size];
|
||||
|
||||
for (int i = 0; i < size; ++i) {
|
||||
id title = [NSString stringWithFormat:@"%.2fx", speeds[i]];
|
||||
varispeedSwitchControllerOptions[i] = [[%c(YTVarispeedSwitchControllerOption) alloc] initWithTitle:title rate:speeds[i]];
|
||||
}
|
||||
|
||||
NSUInteger count = sizeof(varispeedSwitchControllerOptions) / sizeof(id);
|
||||
NSArray *varispeedArray = [NSArray arrayWithObjects:varispeedSwitchControllerOptions count:count];
|
||||
MSHookIvar<NSArray *>(self, "_options") = varispeedArray;
|
||||
|
||||
return result;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook MLHAMQueuePlayer
|
||||
- (void)setRate:(float)rate {
|
||||
MSHookIvar<float>(self, "_rate") = rate;
|
||||
MSHookIvar<float>(self, "_preferredRate") = rate;
|
||||
|
||||
id player = MSHookIvar<HAMPlayerInternal *>(self, "_player");
|
||||
[player setRate: rate];
|
||||
|
||||
id stickySettings = MSHookIvar<MLPlayerStickySettings *>(self, "_stickySettings");
|
||||
[stickySettings setRate: rate];
|
||||
|
||||
[self.playerEventCenter broadcastRateChange: rate];
|
||||
|
||||
YTSingleVideoController *singleVideoController = self.delegate;
|
||||
[singleVideoController playerRateDidChange: rate];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTPlayerViewController
|
||||
%property (nonatomic, assign) float playbackRate;
|
||||
- (void)singleVideo:(id)video playbackRateDidChange:(float)rate {
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
// Disable snap to chapter
|
||||
%hook YTSegmentableInlinePlayerBarView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (IsEnabled(@"snapToChapter_enabled")) {
|
||||
self.enableSnapToChapter = NO;
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Disable Pinch to zoom
|
||||
%hook YTColdConfig
|
||||
- (BOOL)videoZoomFreeZoomEnabledGlobalConfig {
|
||||
return IsEnabled(@"pinchToZoom_enabled") ? NO : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// YTStockVolumeHUD - https://github.com/lilacvibes/YTStockVolumeHUD
|
||||
%group gStockVolumeHUD
|
||||
%hook YTVolumeBarView
|
||||
@@ -672,81 +285,7 @@ static void replaceTab(YTIGuideResponse *response) {
|
||||
%end
|
||||
%end
|
||||
|
||||
// Hide Watermark
|
||||
%hook YTAnnotationsViewController
|
||||
- (void)loadFeaturedChannelWatermark {
|
||||
if (IsEnabled(@"hideChannelWatermark_enabled")) {}
|
||||
else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
// Bring back the red progress bar
|
||||
%hook YTInlinePlayerBarContainerView
|
||||
- (id)quietProgressBarColor {
|
||||
return IsEnabled(@"redProgressBar_enabled") ? [UIColor redColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Disable tap to skip
|
||||
%hook YTDoubleTapToSeekController
|
||||
- (void)enableDoubleTapToSeek:(BOOL)arg1 {
|
||||
return IsEnabled(@"tapToSkip_disabled") ? %orig(NO) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Hide YouTube Logo
|
||||
%group gHideYouTubeLogo
|
||||
%hook YTHeaderLogoController
|
||||
- (YTHeaderLogoController *)init {
|
||||
return NULL;
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
// Miscellaneous
|
||||
// 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
|
||||
|
||||
// Hide the Chip Bar (Upper Bar) in Home feed
|
||||
%group gHideChipBar
|
||||
%hook YTMySubsFilterHeaderView
|
||||
- (void)setChipFilterView:(id)arg1 {}
|
||||
%end
|
||||
|
||||
%hook YTHeaderContentComboView
|
||||
- (void)enableSubheaderBarWithView:(id)arg1 {}
|
||||
%end
|
||||
|
||||
%hook YTHeaderContentComboView
|
||||
- (void)setFeedHeaderScrollMode:(int)arg1 { %orig(0); }
|
||||
%end
|
||||
|
||||
// Hide the chip bar under the video player?
|
||||
// %hook YTChipCloudCell //
|
||||
// - (void)didMoveToWindow {
|
||||
// %orig;
|
||||
// self.hidden = YES;
|
||||
// }
|
||||
// %end
|
||||
%end
|
||||
|
||||
%group giPadLayout // https://github.com/LillieH001/YouTube-Reborn
|
||||
%hook UIDevice
|
||||
- (long long)userInterfaceIdiom {
|
||||
@@ -812,21 +351,9 @@ static void replaceTab(YTIGuideResponse *response) {
|
||||
if (IsEnabled(@"iPhoneLayout_enabled")) {
|
||||
%init(giPhoneLayout);
|
||||
}
|
||||
if (IsEnabled(@"reExplore_enabled")) {
|
||||
%init(gReExplore);
|
||||
}
|
||||
if (IsEnabled(@"bigYTMiniPlayer_enabled") && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) {
|
||||
%init(Main);
|
||||
}
|
||||
if (IsEnabled(@"hidePreviousAndNextButton_enabled")) {
|
||||
%init(gHidePreviousAndNextButton);
|
||||
}
|
||||
if (IsEnabled(@"replacePreviousAndNextButton_enabled")) {
|
||||
%init(gReplacePreviousAndNextButton);
|
||||
}
|
||||
if (IsEnabled(@"hideOverlayDarkBackground_enabled")) {
|
||||
%init(gHideOverlayDarkBackground);
|
||||
}
|
||||
if (IsEnabled(@"hideVideoPlayerShadowOverlayButtons_enabled")) {
|
||||
%init(gHideVideoPlayerShadowOverlayButtons);
|
||||
}
|
||||
@@ -839,24 +366,6 @@ static void replaceTab(YTIGuideResponse *response) {
|
||||
if (IsEnabled(@"ytNoModernUI_enabled")) {
|
||||
%init(gYTNoModernUI);
|
||||
}
|
||||
if (IsEnabled(@"disableVideoPlayerZoom_enabled")) {
|
||||
%init(gDisableVideoPlayerZoom);
|
||||
}
|
||||
if (IsEnabled(@"hideYouTubeLogo_enabled")) {
|
||||
%init(gHideYouTubeLogo);
|
||||
}
|
||||
if (IsEnabled(@"disableHints_enabled")) {
|
||||
%init(gDisableHints);
|
||||
}
|
||||
if (IsEnabled(@"hideChipBar_enabled")) {
|
||||
%init(gHideChipBar);
|
||||
}
|
||||
if (IsEnabled(@"ytSpeed_enabled")) {
|
||||
%init(gYTSpeed);
|
||||
}
|
||||
if (IsEnabled(@"removeAds_enabled")) {
|
||||
%init(gRemoveAds);
|
||||
}
|
||||
if (IsEnabled(@"stockVolumeHUD_enabled")) {
|
||||
%init(gStockVolumeHUD);
|
||||
}
|
||||
|
Reference in New Issue
Block a user