Refreshed uYouPlusExtra Branch

Branch has been refreshed to update to the latest commits from qnblackcat/uYouPlus to provide a more up-to-date experience.
This commit is contained in:
arichorn 2023-08-19 15:21:42 -05:00 committed by GitHub
parent 33c5fc41ca
commit a9943de261
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 6389 additions and 512 deletions

View file

@ -1,5 +1,6 @@
#import "Tweaks/YouTubeHeader/YTAppDelegate.h"
#import "Tweaks/YouTubeHeader/YTPlayerViewController.h"
#import "Tweaks/YouTubeHeader/YTQTMButton.h"
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
@ -15,6 +16,7 @@
#import "Tweaks/YouTubeHeader/YTIPivotBarSupportedRenderers.h"
#import "Tweaks/YouTubeHeader/YTIPivotBarRenderer.h"
#import "Tweaks/YouTubeHeader/YTIBrowseRequest.h"
#import "Tweaks/YouTubeHeader/YTColorPalette.h"
#import "Tweaks/YouTubeHeader/YTCommonColorPalette.h"
#import "Tweaks/YouTubeHeader/ASCollectionView.h"
#import "Tweaks/YouTubeHeader/YTPlayerOverlay.h"
@ -25,6 +27,10 @@
#import "Tweaks/YouTubeHeader/YTAlertView.h"
#import "Tweaks/YouTubeHeader/YTISectionListRenderer.h"
#import "Tweaks/YouTubeHeader/YTIMenuConditionalServiceItemRenderer.h"
#import "Tweaks/YouTubeHeader/YTPivotBarItemView.h"
#import "Tweaks/YouTubeHeader/YTVideoWithContextNode.h" // YouTube-X
#import "Tweaks/YouTubeHeader/ELMCellNode.h" // YouTube-X
#import "Tweaks/YouTubeHeader/ELMNodeController.h" // YouTube-X
#define LOC(x) [tweakBundle localizedStringForKey:x value:nil table:nil]
#define YT_BUNDLE_ID @"com.google.ios.youtube"
@ -63,6 +69,9 @@
@interface boolSettingsVC : UIViewController
@end
@interface YTPlaybackButton : UIControl
@end
@interface PlayerManager : NSObject
- (float)progress;
@end
@ -75,6 +84,12 @@
@property UIButton *downloadsButton;
@end
// Buttons
@interface YTRightNavigationButtons : UIView
@property YTQTMButton *notificationButton;
@property YTQTMButton *sponsorBlockButton;
@end
// YTSpeed
@interface YTVarispeedSwitchControllerOption : NSObject
- (id)initWithTitle:(id)title rate:(float)rate;
@ -99,16 +114,6 @@
- (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;
@ -119,7 +124,6 @@
@property(nonatomic, strong) id downloadsVC;
@end
// BigYTMiniPlayer
@interface YTMainAppVideoPlayerOverlayView : UIView
- (UIViewController *)_viewControllerForAncestor;
@ -131,9 +135,6 @@
// YTAutoFullScreen
@interface YTPlayerViewController (YTAFS)
- (void)autoFullscreen;
// DontEatMycontent
- (id)activeVideoPlayerOverlay;
- (id)playerView;
// YTSpeed
@property id activeVideo;
@property float playbackRate;
@ -150,6 +151,9 @@
@interface YTRelatedVideosView : UIView
@end
@interface YTTopAlignedView : UIView
@end
@interface ELMView : UIView
@end
@ -168,6 +172,9 @@
@interface _ASDisplayView : UIView
@end
@interface YTPivotBarIndicatorView : UIView
@end
@interface YTCommentDetailHeaderCell : UIView
@end
@ -191,4 +198,4 @@
@interface settingsReorderTable : UIViewController
@property(nonatomic, strong) UITableView *tableView;
@end
@end

View file

@ -1,5 +1,4 @@
![IMG_2196](https://user-images.githubusercontent.com/52943116/189822859-8a0952db-9264-4b5b-9cbe-d0a87b2db5a0.PNG)
***
<p align="center">
<img src="https://img.shields.io/badge/Platform-iOS%20%7C%20iPadOS%2014.0%2B-yellow" alt="Badge"/>
@ -11,17 +10,17 @@
</p>
<p align="center">
<a href="https://github.com/qnblackcat/uYouPlus/releases/latest"><img src="https://custom-icon-badges.demolab.com/github/v/release/qnblackcat/uYouPlus?color=brightgreen&label=Latest%20release" alt="Badge"></img></a>
<a href="https://github.com/qnblackcat/uYouPlus/releases/latest"><img src="https://img.shields.io/github/downloads/qnblackcat/uYouPlus/total?label=Download" alt="Badge"></img></a>
<a href="https://github.com/qnblackcat/uYouPlus/commit"><img src="https://custom-icon-badges.demolab.com/github/last-commit/qnblackcat/uYouPlus?logo=history&logoColor=white&label=Last commit" alt="Badge"></img></a>
<a href="https://github.com/qnblackcat/uYouPlus/issues"><img src="https://custom-icon-badges.demolab.com/github/issues-raw/qnblackcat/uYouPlus?logo=issue-opened&label=Issues" alt="Badge"></img></a>
<a href="https://github.com/arichorn/uYouPlusExtra/releases/latest"><img src="https://custom-icon-badges.demolab.com/github/v/release/arichorn/uYouPlusExtra?color=brightgreen&label=Latest%20release" alt="Badge"></img></a>
<a href="https://github.com/arichorn/uYouPlusExtra/releases/latest"><img src="https://img.shields.io/github/downloads/qnblackcat/uYouPlus/total?label=Download" alt="Badge"></img></a>
<a href="https://github.com/arichorn/uYouPlusExtra/commit"><img src="https://custom-icon-badges.demolab.com/github/last-commit/arichorn/uYouPlusExtra?logo=history&logoColor=white&label=Last commit" alt="Badge"></img></a>
<a href="https://github.com/arichorn/uYouPlusExtra/issues"><img src="https://custom-icon-badges.demolab.com/github/issues-raw/arichorn/uYouPlusExtra?logo=issue-opened&label=Issues" alt="Badge"></img></a>
</p>
<p align="center">
<img src="https://img.shields.io/github/stars/qnblackcat/uYouPlus?style=social" alt="Badge"/>
<img src="https://img.shields.io/github/forks/qnblackcat/uYouPlus?style=social" alt="Badge"/>
<a href="https://github.com/qnblackcat/uYouPlus#support-the-developers"><img src="https://img.shields.io/badge/-Support-lightgrey?style=social&logo=paypal" alt="Badge"></img></a>
<img src="https://img.shields.io/github/stars/arichorn/uYouPlusExtra?style=social" alt="Badge"/>
<img src="https://img.shields.io/github/forks/arichorn/uYouPlusExtra?style=social" alt="Badge"/>
<a href="https://github.com/arichorn/uYouPlusExtra#support-the-developers"><img src="https://img.shields.io/badge/-Support-lightgrey?style=social&logo=paypal" alt="Badge"></img></a>
</p>
# Table of Contents
@ -46,6 +45,12 @@
</a>
<h4 align='center'><a href='https://twitter.com/miro92'>MiRO92</a></h4>
</td>
<td id='qnblackcat'>
<a href='https://github.com/qnblackcat'>
<img src='https://github.com/qnblackcat.png' width='140px;'>
</a>
<h4 align='center'><a href='https://twitter.com/qnblackcat'>qnblackcat</a></h4>
</td>
<td id='poomsmart'>
<a href='https://github.com/PoomSmart'>
<img src='https://github.com/PoomSmart.png' width='140px;'>
@ -64,15 +69,15 @@
</a>
<h4 align='center'><a href='https://twitter.com/bandarhl'>BandarHelal</a></h4>
</td>
</tr>
<tr>
<td id='galactic-dev'>
<a href='https://github.com/Galactic-Dev'>
<img src='https://github.com/Galactic-Dev.png' width='140px;'>
</a>
<h4 align='center'><a href='https://twitter.com/dev_galactic'>galactic</a></h4>
</td>
</tr>
<tr>
<td id='julioverne'>
<a href='https://github.com/julioverne'>
<img src='https://github.com/julioverne.png' width='140px;'>
@ -97,15 +102,15 @@
</a>
<h4 align='center'><a href='https://twitter.com/therealFoxster'>Foxster</a></h4>
</td>
</tr>
<tr>
<td id='ichitaso'>
<a href='https://github.com/ichitaso'>
<img src='https://github.com/ichitaso.png' width='140px;'>
</a>
<h4 align='center'><a href='https://twitter.com/ichitaso'>ichitaso</a></h4>
</td>
</tr>
<tr>
<td id='ahmed-bafkir'>
<a href='https://github.com/AhmedBafkir'>
<img src='https://github.com/AhmedBafkir.png' width='140px;'>
@ -168,6 +173,10 @@
15. **YTVideoOverlay**: add buttons to overlay the video.
16. **YTNoCommunityPosts**: Tweak to disable all Community Posts on the YouTube app. **<-- uYouPlusExtra Exclusive Feature (may change)**
17. **LowContrastMode**: this tweak allows users to darken the text in the YouTube app. **<-- uYouPlusExtra Exclusive Feature (may change)**
</details>
# Known issues
@ -178,36 +187,36 @@
# Download
- **uYouPlus** (or you can call it uYou+) requires iOS or iPadOS 14.0 or later. The latest version of **uYouPlus** can be found in the [Release tab](https://github.com/qnblackcat/uYouPlus/releases/latest).
- **uYouPlusExtra** (or you can just call it uYou+) requires iOS or iPadOS 14.0 or later. The latest version of **uYouPlusExtra** ipa can be found in the [Release tab](https://github.com/arichorn/uYouPlusExtra/releases/latest).
<!-- - For AltStore user:
- For AltStore user:
- My official AltStore repo: https://qnblackcat.github.io/AltStore/
- My official AltStore repo: https://therealfoxster.github.io/altsource-viewer/index.html?source=https://raw.githubusercontent.com/arichorn/arichorn.github.io/main/apps.json
- [Open in AltStore (v18.14.1-3.0)](https://tinyurl.com/yv6wrxjz) - It will take a while to install because AltStore needs to download the IPA first. -->
- [Open in AltStore (v18.31.3-3.0.1)](https://tinyurl.com/4srfmcm2) - It will take a while to install because AltStore needs to download the IPA first.
- Version info: _(last update: Aug 5)_
- Version info: _(last update: Aug 15)_
<details>
<summary>Expand </summary>
| **Tweaks/App** | **Developer** | **Version** | **Open source** |
| - | - | :-: | :-: |
| **YouTube** | Google Inc | 18.30.7 | ✖︎ |
| [uYou](https://github.com/MiRO92/uYou-for-YouTube) | [MiRO92](https://twitter.com/miro92) | 3.0 | ✖︎ |
| **YouTube** | Google Inc | 18.31.3 | ✖︎ |
| [uYou](https://github.com/MiRO92/uYou-for-YouTube) | [MiRO92](https://twitter.com/miro92) | 3.0.1 | ✖︎ |
| **Open in YouTube** | [CokePokes](https://github.com/CokePokes) | 1.2 | [✔︎](https://github.com/CokePokes/YoutubeExtensions) |
| **iSponsorBlock** | [Galactic-Dev](https://github.com/Galactic-Dev) | 1.0-15 | [✔︎](https://github.com/Galactic-Dev/iSponsorBlock) |
| **iSponsorBlock** | [Galactic-Dev](https://github.com/Galactic-Dev) | 1.2 | [✔︎](https://github.com/Galactic-Dev/iSponsorBlock) |
| **BigYTMiniPlayer** | [Galactic-Dev](https://github.com/Galactic-Dev) | 1.0-1 | [✔︎](https://github.com/Galactic-Dev/BigYTMiniPlayer) |
| **YTNoHoverCards** | [level3tjg](https://twitter.com/level3tjg) | 0.0.3 | [✔︎](https://github.com/level3tjg/YTNoHoverCards) |
| **YTMiniplayerEnabler** | [level3tjg](https://twitter.com/level3tjg) | 0.0.2 | [✔︎](https://github.com/level3tjg/YTMiniplayerEnabler) |
| **DontEatMyContent** | [therealFoxster](https://github.com/therealFoxster) | 1.0.6 | [✔︎](https://github.com/therealFoxster/DontEatMyContent) |
| **DontEatMyContent** | [therealFoxster](https://github.com/therealFoxster) | 1.0.10 | [✔︎](https://github.com/therealFoxster/DontEatMyContent) |
| **YTSpeed** | [Lyvendia](https://github.com/Lyvendia) | 1.0.1 | [✔︎](https://github.com/Lyvendia/YTSpeed) |
| **YTCastConfirm** | [JamieBerghmans](https://github.com/JamieBerghmans) | 1.0.0 | [✔︎](https://github.com/JamieBerghmans/YTCastConfirm) |
| **Alderis Color Picker** | [HASHBANG Productions](https://github.com/hbang) | 1.2| [✔︎](https://github.com/hbang/Alderis) |
| **YTUHD** | [PoomSmart](https://twitter.com/poomsmart) | 1.3.5-1 | [✔︎](https://github.com/PoomSmart/YTUHD) |
| **YouPiP** | [PoomSmart](https://twitter.com/poomsmart) | 1.7.19-1 | [✔︎](https://github.com/PoomSmart/YouPiP) |
| **YTUHD** | [PoomSmart](https://twitter.com/poomsmart) | 1.4.0 | [✔︎](https://github.com/PoomSmart/YTUHD) |
| **YouPiP** | [PoomSmart](https://twitter.com/poomsmart) | 1.7.20 | [✔︎](https://github.com/PoomSmart/YouPiP) |
| **IAmYouTube** | [PoomSmart](https://twitter.com/poomsmart) | 1.2.0 | [✔︎](https://github.com/PoomSmart/IAmYouTube) |
| **YTABConfig** | [PoomSmart](https://twitter.com/poomsmart) | 1.5.0 | [✔︎](https://github.com/PoomSmart/YTABConfig) |
| **YTABConfig** | [PoomSmart](https://twitter.com/poomsmart) | 1.5.0-1 | [✔︎](https://github.com/PoomSmart/YTABConfig) |
| **YTReExplore** | [PoomSmart](https://twitter.com/poomsmart) | 1.0.2 | [✔︎](https://github.com/PoomSmart/YTReExplore) |
| **NoYTPremium** | [PoomSmart](https://twitter.com/poomsmart) | 1.0.4 | [✔︎](https://github.com/PoomSmart/NoYTPremium) |
| **YTNoPaidPromo** | [PoomSmart](https://twitter.com/poomsmart) | 1.0.0 | [✔︎](https://github.com/PoomSmart/YTNoPaidPromo) |
@ -216,15 +225,24 @@
| **YouMute** | [PoomSmart](https://twitter.com/poomsmart) | 1.2.1-2 | [✔︎](https://github.com/PoomSmart/YouMute) |
| **YouQuality** | [PoomSmart](https://twitter.com/poomsmart) | 1.1.4 | [✔︎](https://github.com/PoomSmart/YouQuality) |
| **YTVideoOverlay** | [PoomSmart](https://twitter.com/poomsmart) | 1.1.0-2 | [✔︎](https://github.com/PoomSmart/YTVideoOverlay) |
| **YTNoCommunityPosts** | [michael-winay](https://github.com/michael-winay) | 0.0.2 | [✔︎](https://github.com/michael-winay/YTNoCommunityPosts) |
| **LowContrastMode** | [arichorn](https://github.com/arichorn) | 1.4.0 | [✔︎](https://github.com/arichorn/YTLowContrastMode) |
</details>
# uYou Tweak Compatibility List
| Developer | Tweak Name and Version | App Version Compatibility |
|-----------|:----------------------:|:-------------------------:|
| MiRO92 | uYou 2.1/2.3~1 | Works on v16.42.3-18.01.6 |
| MiRO92 | uYou 3.0 | Works on v18.06.6-18.18.2 |
| MiRO92 | uYou 3.0.1 | Works on v18.06.6-latest |
# Installation
See [Installation - Wiki](https://github.com/qnblackcat/uYouPlus/wiki/Installation).
# Support the developers
- [**MiRO92**](https://twitter.com/miro92): https://github.com/MiRO92/uYou-for-YouTube#support
- [**Poomsmart**](https://twitter.com/poomsmart): https://poomsmart.github.io
- [**level3tjg**](https://twitter.com/level3tjg): https://ko-fi.com/level3tjg
- [**BandarHL**](https://twitter.com/bandarhl): https://www.paypal.com/paypalme/BandarHL
- [**julioverne**](https://twitter.com/ijulioverne): https://www.patreon.com/julioverne
@ -238,4 +256,28 @@ See [FAQ - Wiki](https://github.com/qnblackcat/uYouPlus/wiki/FAQ).
# Building (optional)
See [Building - Wiki](https://github.com/qnblackcat/uYouPlus/wiki/Building).
See [qnblackcat/Building - Wiki](https://github.com/qnblackcat/uYouPlus/wiki/Building)
or [arichorn/Building - Wiki](https://github.com/arichorn/uYouPlusExtra/wiki/Building).
<details>
<summary>Balackburn's YTLitePlus</summary>
# change from uYouPlus/uYouPlusExtra to YTLitePlus (optional)
hello, this is here to show yall this tweak. I've been seeing the YTLitePlus tweak on reddit for quite some time now and decided to join in. before you download the tweak you must look at the Pros and Cons below before downloading because it lets you know more about the tweak.
https://github.com/Balackburn/YTLitePlus/releases
**Pros**
- YTLitePlus is stable and more tweakable then uYouPlus/uYouPlusExtra.
- YTLitePlus has more features in YTLite Settings that uYouPlusExtra doesn't have.
- YTLitePlus has a lightweight Version of the App Version Spoofer which makes it easier to use.
**Cons**
- No Video Downloading in YTLitePlus.
- Video Quality on WiFi not in YTLitePlus.
</details>

20
SECURITY.md Normal file
View file

@ -0,0 +1,20 @@
# Security Policy for uYouPlus Developers
If I verify a reported security vulnerability, my policy is:
- the uYouPlusExtra Developer will patch the current main branch, as well as the immediate prior minor release branch.
- the Contributors are allowed to patch the current main branch with custom features and the ability to add new & updated Localizable Strings.
- After fully patching the main branch, the uYouPlusExtra Developer will issue a new release for the main branch along with LTS release branches.
## Supported Versions
these versions of the project are
currently being supported with security/feature updates.
| Version | LTS Support of the uYouPlusExtra Tweak | YT Version Supported by Google | App Stability |
| ------- | -------------------------------------- | ------------------------------ | -------------------- |
| [latest](https://github.com/arichorn/uYouPlusExtra/releases/latest) | ✅ | ✅ | The latest version is stable! |
| [17.49.6-2.3.1 LTS](https://github.com/arichorn/uYouPlusExtra/releases/tag/v17.49.6-2.3.1-F4) | ✅ | ✅ | This version is Stable, this version may be unstable to some if using it on iOS 17 Beta. |
| [17.38.10-2.1 LTS](https://github.com/arichorn/uYouPlusExtra/releases/latest) | N/A | ✅ | This new LTS Release will soon to replace **16.42.3-2.1** next year. |
| [16.42.3-2.1 LTS](https://github.com/arichorn/uYouPlusExtra/releases/tag/v16.42.3-2.1-F19) | ❌ | ✅ until 2024+ | Unstable if you are using iOS 16 or later, Stage Manager won't work correctly when playing videos in the video player, The App Pivot Bar does not hide when playing videos in iOS 16+ due to iOS/iPadOS Changes but this version can still get new features from Google like for these new ones that were recently added in as an example --> (Shorts, Continue Watching Section, Watch It Again Section, Handles & etc.) so overrall this YouTube Version is still supported by Google. |

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,43 @@
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var textField: UITextField!
@IBOutlet weak var colorButton: UIButton!
var textColor: UIColor = (red: 0.56, green: 0.56, blue: 0.56, alpha: 1.00)
override func viewDidLoad() {
super.viewDidLoad()
// Configure Text Field
textField.placeholder = "YouTube"
// Configure Color Button
colorButton.setTitleColor(textColor, for: .normal)
}
@IBAction func onColorButtonTap(_ sender: Any) {
let colorPicker = UIColorPickerViewController()
colorPicker.delegate = self
present(colorPicker, animated: true, completion: nil)
}
}
extension ViewController: UITextFieldDelegate {
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
}
}
extension ViewController: UIColorPickerViewControllerDelegate {
func colorPickerViewControllerDidSelectColor(_ viewController: UIColorPickerViewController) {
textColor = viewController.selectedColor
colorButton.setTitleColor(textColor, for: .normal)
}
func colorPickerViewControllerDidFinish(_ viewController: UIColorPickerViewController) {
dismiss

1987
Source/LowContrastMode.xm Normal file

File diff suppressed because it is too large Load diff

1037
Source/Themes.xm Normal file

File diff suppressed because it is too large Load diff

1591
Source/VersionSpoofer.xm Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,86 @@
// Template for whenever I refresh the main branch. and to re-add the submodules afterwards.
name: Update Submodules
on:
workflow_dispatch:
jobs:
update-submodules:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3.5.3
- name: Set up Git
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
- name: Add uYouPlusExtra submodules
run: |
git submodule add https://github.com/michael-winay/YTNoCommunityPosts.git Tweaks/YTNoCommunityPosts
# git submodule add https://github.com/arichorn/YTHoldForSpeed.git Tweaks/YTHoldForSpeed
git add .
git commit -m "added uYouPlusExtra submodules"
git push origin
# - name: Update submodules
# run: |
# git submodule update --init --recursive --remote
# git add .
# git commit -m "updated submodules"
# git push origin
# continue-on-error: true
- name: Update submodules
run: |
git submodule update --init --recursive --remote Tweaks/Alderis
git add .
git submodule update --init --recursive --remote Tweaks/DontEatMyContent
git add .
git submodule update --init --recursive --remote Tweaks/PSHeader
git add .
git submodule update --init --recursive --remote Tweaks/Return-YouTube-Dislikes
git add .
git submodule update --init --recursive --remote Tweaks/YTABConfig
git add .
git submodule update --init --recursive --remote Tweaks/YTNoCommunityPosts
git add .
git submodule update --init --recursive --remote Tweaks/YTUHD
git add .
git submodule update --init --recursive --remote Tweaks/YTVideoOverlay
git add .
git submodule update --init --recursive --remote Tweaks/YouMute
git add .
git submodule update --init --recursive --remote Tweaks/YouPiP
git add .
git submodule update --init --recursive --remote Tweaks/YouQuality
git add .
git submodule update --init --recursive --remote Tweaks/YouTubeHeader
git add .
git submodule update --init --recursive --remote Tweaks/iSponsorBlock
git add .
git commit -m "updated submodules"
git push origin
continue-on-error: true
- name: Make .bundle files
run: |
cd Bundles
ln -s ../Tweaks/YTVideoOverlay/layout/Library/Application\ Support/YTVideoOverlay.bundle YTVideoOverlay.bundle
ln -s ../Tweaks/YouMute/layout/Library/Application\ Support/YouMute.bundle YouMute.bundle
ln -s ../Tweaks/YouQuality/layout/Library/Application\ Support/YouQuality.bundle YouQuality.bundle
ln -s ../Tweaks/YTNoCommunityPosts/layout/Library/Application\ Support/YTNoCommunityPosts.bundle YTNoCommunityPosts.bundle
git add .
git commit -m "Added bundles"
git push origin
- name: Check exit code
run: |
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Submodule update failed with exit code $exit_code"
exit 1
fi

View file

@ -19,15 +19,6 @@ NSBundle *tweakBundle = uYouPlusBundle();
static BOOL IsEnabled(NSString *key) {
return [[NSUserDefaults standardUserDefaults] boolForKey:key];
}
static BOOL isDarkMode() {
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1);
}
static BOOL oledDarkTheme() {
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"appTheme"] == 1);
}
static BOOL oldDarkTheme() {
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"appTheme"] == 2);
}
//
# pragma mark - uYou's patches
@ -51,33 +42,6 @@ static BOOL oldDarkTheme() {
}
%end
// Workaround for issue #54
%hook YTMainAppVideoPlayerOverlayViewController
- (void)updateRelatedVideos {
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"relatedVideosAtTheEndOfYTVideos"] == NO) {}
else { return %orig; }
}
%end
// iOS 16 uYou crash fix - @level3tjg: https://github.com/qnblackcat/uYouPlus/pull/224
%group iOS16
%hook OBPrivacyLinkButton
%new
- (instancetype)initWithCaption:(NSString *)caption
buttonText:(NSString *)buttonText
image:(UIImage *)image
imageSize:(CGSize)imageSize
useLargeIcon:(BOOL)useLargeIcon {
return [self initWithCaption:caption
buttonText:buttonText
image:image
imageSize:imageSize
useLargeIcon:useLargeIcon
displayLanguage:[NSLocale currentLocale].languageCode];
}
%end
%end
%hook YTAppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> *)launchOptions {
@ -91,51 +55,55 @@ static BOOL oldDarkTheme() {
}
- (void)appWillResignActive:(id)arg1 {
%orig;
if (IsEnabled(@"flex_enabled")) {
if (IsEnabled(@"flex_enabled")) {
[[%c(FLEXManager) performSelector:@selector(sharedManager)] performSelector:@selector(showExplorer)];
}
}
%end
# pragma mark - YouTube's patches
// Workaround for MiRO92/uYou-for-YouTube#12, qnblackcat/uYouPlus#263
%hook YTDataUtils
+ (NSMutableDictionary *)spamSignalsDictionary {
return nil;
}
+ (NSMutableDictionary *)spamSignalsDictionaryWithoutIDFA {
return nil;
}
%end
%hook YTHotConfig
- (BOOL)disableAfmaIdfaCollection { return NO; }
%end
// https://github.com/PoomSmart/YouTube-X/blob/1e62b68e9027fcb849a75f54a402a530385f2a51/Tweak.x#L27
// %hook YTAdsInnerTubeContextDecorator
// - (void)decorateContext:(id)context {}
// %end
// Hide YouTube annoying banner in Home page? - @MiRO92 - YTNoShorts: https://github.com/MiRO92/YTNoShorts
%hook YTAsyncCollectionView
- (id)cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCell *cell = %orig;
if ([cell isKindOfClass:NSClassFromString(@"_ASCollectionViewCell")]) {
_ASCollectionViewCell *cell = %orig;
if ([cell respondsToSelector:@selector(node)]) {
if ([[[cell node] accessibilityIdentifier] isEqualToString:@"statement_banner.view"]) { [self removeShortsAndFeaturesAdsAtIndexPath:indexPath]; }
if ([[[cell node] accessibilityIdentifier] isEqualToString:@"compact.view"]) { [self removeShortsAndFeaturesAdsAtIndexPath:indexPath]; }
// if ([[[cell node] accessibilityIdentifier] isEqualToString:@"id.ui.video_metadata_carousel"]) { [self removeShortsAndFeaturesAdsAtIndexPath:indexPath]; }
}
}
return %orig;
}
%new
- (void)removeShortsAndFeaturesAdsAtIndexPath:(NSIndexPath *)indexPath {
[self deleteItemsAtIndexPaths:[NSArray arrayWithObject:indexPath]];
// Remove “Play next in queue” from the menu (@PoomSmart) - qnblackcat/uYouPlus#1138
%group gHidePlayNextInQueue
%hook YTMenuItemVisibilityHandler
- (BOOL)shouldShowServiceItemRenderer:(YTIMenuConditionalServiceItemRenderer *)renderer {
return renderer.icon.iconType == 251 ? NO : %orig;
}
%end
%end
// Reposition "Create" Tab to the Center in the Pivot Bar - qnblackcat/uYouPlus#107
/*
static void repositionCreateTab(YTIGuideResponse *response) {
NSMutableArray<YTIGuideResponseSupportedRenderers *> *renderers = [response itemsArray];
for (YTIGuideResponseSupportedRenderers *guideRenderers in renderers) {
YTIPivotBarRenderer *pivotBarRenderer = [guideRenderers pivotBarRenderer];
NSMutableArray<YTIPivotBarSupportedRenderers *> *items = [pivotBarRenderer itemsArray];
NSUInteger createIndex = [items indexOfObjectPassingTest:^BOOL(YTIPivotBarSupportedRenderers *renderers, NSUInteger idx, BOOL *stop) {
return [[[renderers pivotBarItemRenderer] pivotIdentifier] isEqualToString:@"FEuploads"];
}];
if (createIndex != NSNotFound) {
YTIPivotBarSupportedRenderers *createTab = [items objectAtIndex:createIndex];
[items removeObjectAtIndex:createIndex];
NSUInteger centerIndex = items.count / 2;
[items insertObject:createTab atIndex:centerIndex]; // Reposition the "Create" tab at the center
}
}
}
%hook YTGuideServiceCoordinator
- (void)handleResponse:(YTIGuideResponse *)response withCompletion:(id)completion {
repositionCreateTab(response);
%orig(response, completion);
}
- (void)handleResponse:(YTIGuideResponse *)response error:(id)error completion:(id)completion {
repositionCreateTab(response);
%orig(response, error, completion);
}
%end
*/
// Fix streched artwork in uYou's player view
%hook ArtworkImageView
@ -152,13 +120,6 @@ static BOOL oldDarkTheme() {
}
%end
// Remove “Play next in queue” from the menu (@PoomSmart) - qnblackcat/uYouPlus#1138
%hook YTMenuItemVisibilityHandler
- (BOOL)shouldShowServiceItemRenderer:(YTIMenuConditionalServiceItemRenderer *)renderer {
return renderer.icon.iconType == 251 ? NO : %orig;
}
%end
# pragma mark - Tweaks
// IAmYouTube - https://github.com/PoomSmart/IAmYouTube/
%hook YTVersionUtils
@ -247,7 +208,7 @@ static BOOL oldDarkTheme() {
}
%end
//YTCastConfirm: https://github.com/JamieBerghmans/YTCastConfirm
// YTCastConfirm: https://github.com/JamieBerghmans/YTCastConfirm
%hook MDXPlaybackRouteButtonController
- (void)didPressButton:(id)arg1 {
if (IsEnabled(@"castConfirm_enabled")) {
@ -264,15 +225,6 @@ static BOOL oldDarkTheme() {
}
%end
// Hide search ads by @PoomSmart - https://github.com/PoomSmart/YouTube-X
// %hook YTIElementRenderer
// - (NSData *)elementData {
// if (self.hasCompatibilityOptions && self.compatibilityOptions.hasAdLoggingData)
// return nil;
// return %orig;
// }
// %end
// %hook YTSectionListViewController
// - (void)loadWithModel:(YTISectionListRenderer *)model {
// NSMutableArray <YTISectionListSupportedRenderers *> *contentsArray = model.contentsArray;
@ -287,13 +239,19 @@ static BOOL oldDarkTheme() {
// %end
// YTClassicVideoQuality: https://github.com/PoomSmart/YTClassicVideoQuality
%hook YTVideoQualitySwitchControllerFactory
- (id)videoQualitySwitchControllerWithParentResponder:(id)responder {
Class originalClass = %c(YTVideoQualitySwitchOriginalController);
return originalClass ? [[originalClass alloc] initWithParentResponder:responder] : %orig;
}
%hook YTIMediaQualitySettingsHotConfig // (works for YouTube 18.19.1-latest)
%new(B@:) - (BOOL)enableQuickMenuVideoQualitySettings { return NO; }
%end
// %hook YTVideoQualitySwitchControllerFactory
// - (id)videoQualitySwitchControllerWithParentResponder:(id)responder {
// Class originalClass = %c(YTVideoQualitySwitchOriginalController);
// return originalClass ? [[originalClass alloc] initWithParentResponder:responder] : %orig;
// }
// %end
// A/B flags
%hook YTColdConfig
- (BOOL)respectDeviceCaptionSetting { return NO; } // YouRememberCaption: https://poomsmart.github.io/repo/depictions/youremembercaption.html
@ -327,6 +285,13 @@ static BOOL oldDarkTheme() {
- (void)showSurveyWithRenderer:(id)arg1 surveyParentResponder:(id)arg2 {}
%end
%hook YTIOfflineabilityFormat
%new
- (int)availabilityType { return 1; }
%new
- (BOOL)savedSettingShouldExpire { return NO; }
%end
// YTNoPaidPromo: https://github.com/PoomSmart/YTNoPaidPromo
%hook YTMainAppVideoPlayerOverlayViewController
- (void)setPaidContentWithPlayerData:(id)data {
@ -346,6 +311,141 @@ static BOOL oldDarkTheme() {
}
%end
// Disable Wifi Related Settings - @arichorn
%group gDisableWifiRelatedSettings
%hook YTSettingsSectionItemManager
- (void)updatePremiumEarlyAccessSectionWithEntry:(id)arg1 {} // Try New Features
- (void)updateAutoplaySectionWithEntry:(id)arg1 {} // Autoplay
- (void)updateNotificationSectionWithEntry:(id)arg1 {} // Notifications
- (void)updateHistorySectionWithEntry:(id)arg1 {} // History
- (void)updatePrivacySectionWithEntry:(id)arg1 {} // Privacy
- (void)updateHistoryAndPrivacySectionWithEntry:(id)arg1 {} // History & Privacy
- (void)updateLiveChatSectionWithEntry:(id)arg1 {} // Live chat
%end
%end
// YTNoModernUI - @arichorn
%group gYTNoModernUI
%hook YTVersionUtils // YTNoModernUI Original Version
+ (NSString *)appVersion { return @"17.38.10"; }
%end
%hook YTSettingsCell // made by Dayanch96
- (void)setDetailText:(id)arg1 {
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
NSString *appVersion = infoDictionary[@"CFBundleShortVersionString"];
if ([arg1 isEqualToString:@"17.38.10"]) {
arg1 = appVersion;
} %orig(arg1);
}
%end
%hook YTInlinePlayerBarContainerView // Red Progress Bar - YTNoModernUI
- (id)quietProgressBarColor {
return [UIColor redColor];
}
%end
%hook YTSegmentableInlinePlayerBarView // Old Buffer Bar - YTNoModernUI
- (void)setBufferedProgressBarColor:(id)arg1 {
[UIColor colorWithRed:0.65 green:0.65 blue:0.65 alpha:0.60];
}
%end
%hook YTQTMButton
- (BOOL)buttonModernizationEnabled { return NO; }
%end
%hook YTSearchBarView
- (BOOL)_roundedSearchBarEnabled { return NO; }
%end
%hook YTColdConfig
// Disable Modern Content - YTNoModernUI
- (BOOL)creatorClientConfigEnableStudioModernizedMdeThumbnailPickerForClient { return NO; }
- (BOOL)cxClientEnableModernizedActionSheet { return NO; }
- (BOOL)enableClientShortsSheetsModernization { return NO; }
- (BOOL)enableTimestampModernizationForNative { return NO; }
- (BOOL)mainAppCoreClientIosEnableModernOssPage { return NO; }
- (BOOL)modernizeElementsTextColor { return NO; }
- (BOOL)modernizeElementsBgColor { return NO; }
- (BOOL)modernizeCollectionLockups { return NO; }
- (BOOL)uiSystemsClientGlobalConfigEnableEpUxUpdates { return NO; }
- (BOOL)uiSystemsClientGlobalConfigEnableModernButtonsForNative { return NO; }
- (BOOL)uiSystemsClientGlobalConfigEnableModernButtonsForNativeLongTail { return NO; }
- (BOOL)uiSystemsClientGlobalConfigEnableModernTabsForNative { return NO; }
- (BOOL)uiSystemsClientGlobalConfigIosEnableSnackbarModernization { return NO; }
// Disable Rounded Content - YTNoModernUI
- (BOOL)iosDownloadsPageRoundedThumbs { return NO; }
- (BOOL)iosRoundedSearchBarSuggestZeroPadding { return NO; }
- (BOOL)uiSystemsClientGlobalConfigEnableRoundedThumbnailsForNative { return NO; }
- (BOOL)uiSystemsClientGlobalConfigEnableRoundedThumbnailsForNativeLongTail { return NO; }
- (BOOL)uiSystemsClientGlobalConfigEnableRoundedTimestampForNative { return NO; }
- (BOOL)uiSystemsClientGlobalConfigEnableRoundedDialogForNative { return NO; }
// Disable Darker Dark Mode - YTNoModernUI
- (BOOL)enableDarkerDarkMode { return NO; }
- (BOOL)useDarkerPaletteBgColorForElements { return NO; }
- (BOOL)useDarkerPaletteTextColorForElements { return NO; }
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteTextColorForNative { return NO; }
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteBgColorForNative { return NO; }
// Disable Ambient Mode - YTNoModernUI
- (BOOL)disableCinematicForLowPowerMode { return NO; }
- (BOOL)enableCinematicContainer { return NO; }
- (BOOL)enableCinematicContainerOnClient { return NO; }
- (BOOL)enableCinematicContainerOnTablet { return NO; }
- (BOOL)iosCinematicContainerClientImprovement { return NO; }
- (BOOL)iosEnableGhostCardInlineTitleCinematicContainerFix { return NO; }
- (BOOL)iosUseFineScrubberMosaicStoreForCinematic { return NO; }
- (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; }
- (BOOL)isNewRadioButtonStyleEnabled { return NO; }
- (BOOL)uiSystemsClientGlobalConfigEnableButtonSentenceCasingForNative { return NO; }
%end
%hook YTHotConfig
- (BOOL)liveChatIosUseModernRotationDetectiom { return NO; } // Disable Modern Content (YTHotConfig)
- (BOOL)iosShouldRepositionChannelBar { return NO; }
- (BOOL)enableElementRendererOnChannelCreation { return NO; }
%end
%end
// Hide YouTube Logo
%group gHideYouTubeLogo
%hook YTHeaderLogoController
- (YTHeaderLogoController *)init {
return NULL;
}
%end
%end
// Hide YouTube Heatwaves in Video Player (YouTube v17.19.2-latest) - @level3tjg - https://www.reddit.com/r/jailbreak/comments/v29yvk/
%group gHideHeatwaves
%hook YTInlinePlayerBarContainerView
- (BOOL)canShowHeatwave { return NO; }
%end
%end
# pragma mark - Hide Notification Button && SponsorBlock Button
%hook YTRightNavigationButtons
- (void)layoutSubviews {
%orig;
if (IsEnabled(@"hideNotificationButton_enabled")) {
self.notificationButton.hidden = YES;
}
if (IsEnabled(@"hideSponsorBlockButton_enabled")) {
self.sponsorBlockButton.hidden = YES;
}
}
%end
// YTReExplore: https://github.com/PoomSmart/YTReExplore/
%group gReExplore
static void replaceTab(YTIGuideResponse *response) {
@ -381,6 +481,16 @@ static void replaceTab(YTIGuideResponse *response) {
%end
%end
// Hide Subscriptions Notification Badge
%group gHideSubscriptionsNotificationBadge
%hook YTPivotBarIndicatorView
- (void)didMoveToWindow {
[self setHidden:YES];
%orig();
}
%end
%end
// BigYTMiniPlayer: https://github.com/Galactic-Dev/BigYTMiniPlayer
%group Main
%hook YTWatchMiniBarView
@ -407,12 +517,13 @@ static void replaceTab(YTIGuideResponse *response) {
%end
// YTSpeed - https://github.com/Lyvendia/YTSpeed
%group gYTSpeed
%hook YTVarispeedSwitchController
- (id)init {
id result = %orig;
const int size = 12;
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};
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) {
@ -452,6 +563,7 @@ static void replaceTab(YTIGuideResponse *response) {
%orig;
}
%end
%end
# pragma mark - uYouPlus
// Video Player Options
@ -460,6 +572,15 @@ static void replaceTab(YTIGuideResponse *response) {
- (void)showConfirmAlert { [self confirmAlertDidPressConfirm]; }
%end
// Portrait Fullscreen by Dayanch96
%group gPortraitFullscreen
%hook YTWatchViewController
- (unsigned long long)allowedFullScreenOrientations {
return UIInterfaceOrientationMaskAllButUpsideDown;
}
%end
%end
// Disable snap to chapter
%hook YTSegmentableInlinePlayerBarView
- (void)didMoveToWindow {
@ -481,25 +602,26 @@ static void replaceTab(YTIGuideResponse *response) {
%group gStockVolumeHUD
%hook YTVolumeBarView
- (void)volumeChanged:(id)arg1 {
%orig(nil);
%orig(nil);
}
%end
%hook UIApplication
- (void)setSystemVolumeHUDEnabled:(BOOL)arg1 forAudioCategory:(id)arg2 {
%orig(true, arg2);
%orig(true, arg2);
}
%end
%end
%hook YTDoubleTapToSeekController
- (void)enableDoubleTapToSeek:(BOOL)arg1 {
return IsEnabled(@"doubleTapToSeek_disabled") ? %orig(NO) : %orig;
// Disable Double Tap to Seek
%hook YTMainAppVideoPlayerOverlayViewController
- (BOOL)allowDoubleTapToSeekGestureRecognizer {
return IsEnabled(@"disableDoubleTapToSkip_enabled") ? NO : %orig;
}
%end
// Video Controls Overlay Options
// Hide CC / Autoplay switch
// Hide CC / Autoplay switch / Enable Share Button / Enable Save to Playlist Button
%hook YTMainAppControlsOverlayView
- (void)setClosedCaptionsOrSubtitlesButtonAvailable:(BOOL)arg1 { // hide CC button
return IsEnabled(@"hideCC_enabled") ? %orig(NO) : %orig;
@ -508,6 +630,20 @@ static void replaceTab(YTIGuideResponse *response) {
if (IsEnabled(@"hideAutoplaySwitch_enabled")) {}
else { return %orig; }
}
- (void)setShareButtonAvailable:(BOOL)arg1 {
if (IsEnabled(@"enableShareButton_enabled")) {
%orig(YES);
} else {
%orig(NO);
}
}
- (void)setAddToButtonAvailable:(BOOL)arg1 {
if (IsEnabled(@"enableSaveToButton_enabled")) {
%orig(YES);
} else {
%orig(NO);
}
}
%end
// Hide HUD Messages
@ -531,6 +667,27 @@ static void replaceTab(YTIGuideResponse *response) {
- (BOOL)removeNextPaddleForSingletonVideos { return YES; }
- (BOOL)removePreviousPaddleForSingletonVideos { return YES; }
%end
// %hook YTMainAppControlsOverlayView // this is only used for v16.42.3 (incompatible with YouTube v17.xx.x-newer)
// - (void)layoutSubviews { // hide Next & Previous legacy buttons
// %orig;
// if (IsEnabled(@"hidePreviousAndNextButton_enabled")) {
// MSHookIvar<YTMainAppControlsOverlayView *>(self, "_nextButton").hidden = YES;
// MSHookIvar<YTMainAppControlsOverlayView *>(self, "_previousButton").hidden = YES;
// MSHookIvar<YTTransportControlsButtonView *>(self, "_nextButtonView").hidden = YES;
// MSHookIvar<YTTransportControlsButtonView *>(self, "_previousButtonView").hidden = YES;
// }
// }
// %end
%end
// Hide Dark Overlay Background
%group gHideOverlayDarkBackground
%hook YTMainAppVideoPlayerOverlayView
- (void)setBackgroundVisible:(BOOL)arg1 isGradientBackground:(BOOL)arg2 {
%orig(NO, arg2);
}
%end
%end
// Replace Next & Previous button with Fast forward & Rewind button
@ -541,13 +698,35 @@ static void replaceTab(YTIGuideResponse *response) {
%end
%end
// Bring back the red progress bar - Broken?!
// Hide Shadow Overlay Buttons (Play/Pause, Next, previous, Fast forward & Rewind buttons)
%group gHideVideoPlayerShadowOverlayButtons
%hook YTMainAppControlsOverlayView
- (void)layoutSubviews {
%orig();
MSHookIvar<YTTransportControlsButtonView *>(self, "_previousButtonView").backgroundColor = nil;
MSHookIvar<YTTransportControlsButtonView *>(self, "_nextButtonView").backgroundColor = nil;
MSHookIvar<YTTransportControlsButtonView *>(self, "_seekBackwardAccessibilityButtonView").backgroundColor = nil;
MSHookIvar<YTTransportControlsButtonView *>(self, "_seekForwardAccessibilityButtonView").backgroundColor = nil;
MSHookIvar<YTPlaybackButton *>(self, "_playPauseButton").backgroundColor = nil;
}
%end
%end
// Bring back the Red Progress Bar and Gray Buffer Progress
%group gRedProgressBar
%hook YTInlinePlayerBarContainerView
- (id)quietProgressBarColor {
return IsEnabled(@"redProgressBar_enabled") ? [UIColor redColor] : %orig;
return [UIColor redColor];
}
%end
%hook YTSegmentableInlinePlayerBarView
- (void)setBufferedProgressBarColor:(id)arg1 {
[UIColor colorWithRed:1.00 green:1.00 blue:1.00 alpha:0.90];
}
%end
%end
// Disable the right panel in fullscreen mode
%hook YTColdConfig
- (BOOL)isLandscapeEngagementPanelEnabled {
@ -578,334 +757,6 @@ static void replaceTab(YTIGuideResponse *response) {
}
%end
// Theme Options
// Old dark theme (gray)
%group gOldDarkTheme
%hook YTColdConfig
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteBgColorForNative { return NO; }
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteTextColorForNative { return NO; }
- (BOOL)enableCinematicContainerOnClient { return NO; }
%end
%hook _ASDisplayView
- (void)didMoveToWindow {
%orig;
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = [UIColor clearColor]; }
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = [UIColor clearColor]; }
}
%end
%hook ASCollectionView
- (void)didMoveToWindow {
%orig;
self.superview.backgroundColor = [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0];
}
%end
%hook YTFullscreenEngagementOverlayView
- (void)didMoveToWindow {
%orig;
self.subviews[0].backgroundColor = [UIColor clearColor];
}
%end
%hook YTRelatedVideosView
- (void)didMoveToWindow {
%orig;
self.subviews[0].backgroundColor = [UIColor clearColor];
}
%end
%end
// OLED dark mode by BandarHL
UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:1.0];
%group gOLED
%hook YTCommonColorPalette
- (UIColor *)baseBackground {
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
}
- (UIColor *)brandBackgroundSolid {
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
}
- (UIColor *)brandBackgroundPrimary {
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
}
- (UIColor *)brandBackgroundSecondary {
return self.pageStyle == 1 ? [[UIColor blackColor] colorWithAlphaComponent:0.9] : %orig;
}
- (UIColor *)raisedBackground {
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
}
- (UIColor *)staticBrandBlack {
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
}
- (UIColor *)generalBackgroundA {
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
}
%end
// uYou settings
%hook UITableViewCell
- (void)_layoutSystemBackgroundView {
%orig;
NSString *backgroundViewKey = class_getInstanceVariable(self.class, "_colorView") ? @"_colorView" : @"_backgroundView";
((UIView *)[[self valueForKey:@"_systemBackgroundView"] valueForKey:backgroundViewKey]).backgroundColor = [UIColor blackColor];
}
- (void)_layoutSystemBackgroundView:(BOOL)arg1 {
%orig;
((UIView *)[[self valueForKey:@"_systemBackgroundView"] valueForKey:@"_colorView"]).backgroundColor = [UIColor blackColor];
}
%end
%hook settingsReorderTable
- (void)viewDidLayoutSubviews {
%orig;
self.tableView.backgroundColor = [UIColor blackColor];
}
%end
%hook FRPSelectListTable
- (void)viewDidLayoutSubviews {
%orig;
self.tableView.backgroundColor = [UIColor blackColor];
}
%end
%hook FRPreferences
- (void)viewDidLayoutSubviews {
%orig;
self.tableView.backgroundColor = [UIColor blackColor];
}
%end
%hook YTInnerTubeCollectionViewController
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
return pageStyle == 1 ? [UIColor blackColor] : %orig;
}
%end
// Explore
%hook ASScrollView
- (void)didMoveToWindow {
%orig;
if (isDarkMode()) {
self.backgroundColor = [UIColor clearColor];
}
}
%end
// Your videos
%hook ASCollectionView
- (void)didMoveToWindow {
%orig;
if (isDarkMode() && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
self.superview.backgroundColor = [UIColor blackColor];
}
}
%end
// Sub menu?
%hook ELMView
- (void)didMoveToWindow {
%orig;
if (isDarkMode()) {
self.subviews[0].backgroundColor = [UIColor clearColor];
}
}
%end
// iSponsorBlock
%hook SponsorBlockSettingsController
- (void)viewDidLoad {
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
%orig;
self.tableView.backgroundColor = [UIColor blackColor];
} else { return %orig; }
}
%end
%hook SponsorBlockViewController
- (void)viewDidLoad {
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
%orig;
self.view.backgroundColor = [UIColor blackColor];
} else { return %orig; }
}
%end
// Search View
%hook YTSearchBarView
- (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
}
%end
// History Search view
%hook YTSearchBoxView
- (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
}
%end
// Comment view
%hook YTCommentView
- (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
}
%end
%hook YTCreateCommentAccessoryView
- (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
}
%end
%hook YTCreateCommentTextView
- (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
}
- (void)setTextColor:(UIColor *)color { // fix black text in #Shorts video's comment
return isDarkMode() ? %orig([UIColor whiteColor]) : %orig;
}
%end
%hook YTCommentDetailHeaderCell
- (void)didMoveToWindow {
%orig;
if (isDarkMode()) {
self.subviews[2].backgroundColor = [UIColor blackColor];
}
}
%end
%hook YTFormattedStringLabel // YT is werid...
- (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig([UIColor clearColor]) : %orig;
}
%end
// Live chat comment
%hook YCHLiveChatActionPanelView
- (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
}
%end
%hook YTEmojiTextView
- (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
}
%end
%hook YCHLiveChatView
- (void)didMoveToWindow {
%orig;
if (isDarkMode()) {
self.subviews[1].backgroundColor = [UIColor blackColor];
}
}
%end
%hook YTCollectionView
- (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
}
%end
//
%hook YTBackstageCreateRepostDetailView
- (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
}
%end
// Others
%hook _ASDisplayView
- (void)didMoveToWindow {
%orig;
if (isDarkMode()) {
if ([self.nextResponder isKindOfClass:%c(ASScrollView)]) { self.backgroundColor = [UIColor clearColor]; }
if ([self.accessibilityIdentifier isEqualToString:@"eml.cvr"]) { self.backgroundColor = [UIColor blackColor]; }
if ([self.accessibilityIdentifier isEqualToString:@"eml.live_chat_text_message"]) { self.backgroundColor = [UIColor blackColor]; }
if ([self.accessibilityIdentifier isEqualToString:@"rich_header"]) { self.backgroundColor = [UIColor blackColor]; }
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { self.backgroundColor = [UIColor blackColor]; }
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.cancel.button"]) { self.superview.backgroundColor = [UIColor clearColor]; }
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = [UIColor blackColor]; }
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = [UIColor blackColor]; }
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.guidelines_text"]) { self.superview.backgroundColor = [UIColor blackColor]; }
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_bottom_sheet_container"]) { self.backgroundColor = [UIColor blackColor]; }
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_entry_banner_container"]) { self.backgroundColor = [UIColor blackColor]; }
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.comment_group_detail_container"]) { self.backgroundColor = [UIColor clearColor]; }
}
}
%end
// Open link with...
%hook ASWAppSwitchingSheetHeaderView
- (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig(raisedColor) : %orig;
}
%end
%hook ASWAppSwitchingSheetFooterView
- (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig(raisedColor) : %orig;
}
%end
%hook ASWAppSwitcherCollectionViewCell
- (void)didMoveToWindow {
%orig;
if (isDarkMode()) {
self.backgroundColor = raisedColor;
self.subviews[1].backgroundColor = raisedColor;
self.superview.backgroundColor = raisedColor;
}
}
%end
// Incompatibility with the new YT Dark theme
%hook YTColdConfig
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteBgColorForNative { return NO; }
%end
%end
// OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e
%group gOLEDKB
%hook UIPredictionViewController
- (void)loadView {
%orig;
[self.view setBackgroundColor:[UIColor blackColor]];
}
%end
%hook UICandidateViewController
- (void)loadView {
%orig;
[self.view setBackgroundColor:[UIColor blackColor]];
}
%end
%hook UIKeyboardDockView
- (void)didMoveToWindow {
%orig;
self.backgroundColor = [UIColor blackColor];
}
%end
%hook UIKeyboardLayoutStar
- (void)didMoveToWindow {
%orig;
self.backgroundColor = [UIColor blackColor];
}
%end
%hook UIKBRenderConfig // Prediction text color
- (void)setLightKeyboard:(BOOL)arg1 { %orig(NO); }
%end
%end
// Miscellaneous
// Disable hints - https://github.com/LillieH001/YouTube-Reborn/blob/v4/
%group gDisableHints
@ -927,6 +778,13 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
%end
%end
// Stick Navigation bar
%group gStickNavigationBar
%hook YTHeaderView
- (BOOL)stickyNavHeaderEnabled { return YES; }
%end
%end
// Hide the Chip Bar (Upper Bar) in Home feed
%group gHideChipBar
%hook YTMySubsFilterHeaderView
@ -940,6 +798,14 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
%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 giPhoneLayout
@ -955,12 +821,12 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
%end
%hook UIKBTree
- (long long)nativeIdiom {
return YES;
return NO;
}
%end
%hook UIKBRenderer
- (long long)assetIdiom {
return YES;
return NO;
}
%end
%end
@ -978,59 +844,83 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
// dlopen([[NSString stringWithFormat:@"%@/Frameworks/uYou.dylib", [[NSBundle mainBundle] bundlePath]] UTF8String], RTLD_LAZY);
%init;
if (@available(iOS 16, *)) {
%init(iOS16);
}
if (IsEnabled(@"reExplore_enabled")) {
%init(gReExplore);
}
if (IsEnabled(@"bigYTMiniPlayer_enabled") && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) {
%init(Main);
}
if (IsEnabled(@"hideSubscriptionsNotificationBadge_enabled")) {
%init(gHideSubscriptionsNotificationBadge);
}
if (IsEnabled(@"hidePreviousAndNextButton_enabled")) {
%init(gHidePreviousAndNextButton);
}
if (IsEnabled(@"replacePreviousAndNextButton_enabled")) {
%init(gReplacePreviousAndNextButton);
}
if (oledDarkTheme()) {
%init(gOLED);
if (IsEnabled(@"hideOverlayDarkBackground_enabled")) {
%init(gHideOverlayDarkBackground);
}
if (oldDarkTheme()) {
%init(gOldDarkTheme)
if (IsEnabled(@"hideVideoPlayerShadowOverlayButtons_enabled")) {
%init(gHideVideoPlayerShadowOverlayButtons);
}
if (IsEnabled(@"oledKeyBoard_enabled")) {
%init(gOLEDKB);
if (IsEnabled(@"hidePlayNextInQueue_enabled")) {
%init(gHidePlayNextInQueue);
}
if (IsEnabled(@"disableWifiRelatedSettings_enabled")) {
%init(gDisableWifiRelatedSettings);
}
if (IsEnabled(@"disableHints_enabled")) {
%init(gDisableHints);
}
if (IsEnabled(@"redProgressBar_enabled")) {
%init(gRedProgressBar);
}
if (IsEnabled(@"stickNavigationBar_enabled")) {
%init(gStickNavigationBar);
}
if (IsEnabled(@"hideChipBar_enabled")) {
%init(gHideChipBar);
}
if (IsEnabled(@"ytSpeed_enabled")) {
%init(gYTSpeed);
}
if (IsEnabled(@"portraitFullscreen_enabled")) {
%init(gPortraitFullscreen);
}
if (IsEnabled(@"iPhoneLayout_enabled") && (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad)) {
%init(giPhoneLayout);
}
if (IsEnabled(@"stockVolumeHUD_enabled")) {
%init(gStockVolumeHUD);
}
if (IsEnabled(@"hideYouTubeLogo_enabled")) {
%init(gHideYouTubeLogo);
}
if (IsEnabled(@"hideHeatwaves_enabled")) {
%init(gHideHeatwaves);
}
if (IsEnabled(@"ytNoModernUI_enabled")) {
%init(gYTNoModernUI);
}
// Disable updates
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"automaticallyCheckForUpdates"];
// Don't show uYou's welcome screen cuz it's currently broken (fix #1147)
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"showedWelcomeVC"];
// Disable broken options of uYou
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"disableAgeRestriction"];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"disableAgeRestriction"]; // Disable Age Restriction Disabled - Reason is the same as above.
// Change the default value of some options
NSArray *allKeys = [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys];
if (![allKeys containsObject:@"relatedVideosAtTheEndOfYTVideos"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"relatedVideosAtTheEndOfYTVideos"];
}
if (![allKeys containsObject:@"shortsProgressBar"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"shortsProgressBar"];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"shortsProgressBar"];
}
if (![allKeys containsObject:@"RYD-ENABLED"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"RYD-ENABLED"];