From 0001c86396deefe6e6b27d0a67a892897f3e9dde Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 10 Oct 2024 00:56:30 +0000 Subject: [PATCH 1/5] updated submodules --- Tweaks/YouTubeHeader | 2 +- Tweaks/protobuf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tweaks/YouTubeHeader b/Tweaks/YouTubeHeader index 4ac9135b5b..128c9305d7 160000 --- a/Tweaks/YouTubeHeader +++ b/Tweaks/YouTubeHeader @@ -1 +1 @@ -Subproject commit 4ac9135b5b270647a723bab78c2bb3cbc6acb6a0 +Subproject commit 128c9305d7e796b883d8563b3cb6e7eac7a33ea8 diff --git a/Tweaks/protobuf b/Tweaks/protobuf index 6690ab42d8..60ca6e06d7 160000 --- a/Tweaks/protobuf +++ b/Tweaks/protobuf @@ -1 +1 @@ -Subproject commit 6690ab42d855ea19d9a24cd99b0375910ea772ca +Subproject commit 60ca6e06d78e68854f8b1bd1c644a7f4376f6168 From 957577b4d3c492ab378bcdd706aff2d400898189 Mon Sep 17 00:00:00 2001 From: "aric3435 (INACTIVE)" <78001398+arichornlover@users.noreply.github.com> Date: Wed, 9 Oct 2024 21:24:24 -0500 Subject: [PATCH 2/5] =?UTF-8?q?Update=20buildapp.yml=20dependencies=20?= =?UTF-8?q?=F0=9F=94=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/buildapp.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 409459a2f0..e399fe80fc 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -60,7 +60,7 @@ jobs: steps: - name: Checkout Main - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.1 with: path: main ref: ${{ github.event.inputs.commit_id || github.ref }} @@ -73,7 +73,7 @@ jobs: run: echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH - name: Setup Theos - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.1 with: repository: theos/theos ref: 5bfdc3cb7133ec1cab43182115d902e2b57c9eac @@ -82,7 +82,7 @@ jobs: - name: SDK Caching id: SDK - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.1.1 env: cache-name: iOS-${{ inputs.sdk_version }}-SDK with: @@ -102,7 +102,7 @@ jobs: THEOS: ${{ github.workspace }}/theos - name: Setup Theos Jailed - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.1 with: repository: qnblackcat/theos-jailed ref: master @@ -151,7 +151,7 @@ jobs: - name: Upload Artifact if: ${{ inputs.upload_artifact }} - uses: actions/upload-artifact@v4.3.4 + uses: actions/upload-artifact@v4.4.3 env: UYOU_VERSION: ${{ inputs.uyou_version }} YOUTUBE_VERSION: ${{ steps.prepare_youtube.outputs.youtube_version }} @@ -163,7 +163,7 @@ jobs: - name: Create Release if: ${{ inputs.create_release }} id: create_release - uses: softprops/action-gh-release@v2.0.5 + uses: softprops/action-gh-release@v2.0.8 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} UYOU_VERSION: ${{ inputs.uyou_version }} From 8bcf7610bdf3c0f54a847a9e38d111255ad99c44 Mon Sep 17 00:00:00 2001 From: "aric3435 (INACTIVE)" <78001398+arichornlover@users.noreply.github.com> Date: Thu, 10 Oct 2024 00:24:29 -0500 Subject: [PATCH 3/5] Fix uYouEnhanced Injection (Makefile) for macOS-13 and higher. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 88a25f2f93..6a9d7b461c 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ endif ifndef UYOU_VERSION UYOU_VERSION = 3.0.4 endif +PACKAGE_NAME = $(TWEAK_NAME) PACKAGE_VERSION = $(YOUTUBE_VERSION)-$(UYOU_VERSION) INSTALL_TARGET_PROCESSES = YouTube From ae5558784e008520dd34f4c4d632cba7ab3620c8 Mon Sep 17 00:00:00 2001 From: "aric3435 (INACTIVE)" <78001398+arichornlover@users.noreply.github.com> Date: Thu, 10 Oct 2024 00:38:36 -0500 Subject: [PATCH 4/5] v19.40.4-3.0.4 --- README.md | 60 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index bf63849f5b..b7bb241698 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,14 @@

- Latest Release Badge - Last Commit Badge - Issues Badge + Latest Release Badge + Last Commit Badge + Issues Badge

- Stars Badge - + Stars Badge +

> [!NOTE] @@ -36,7 +36,7 @@ [![Download](https://img.shields.io/badge/Download-blue?style=flat)](#download)
[![Building](https://img.shields.io/badge/Building-blue?style=flat)](#building)
[![Installation](https://img.shields.io/badge/Installation-blue?style=flat)](#installation)
-[![Donations](https://img.shields.io/badge/Donations-blue?style=flat)](#donations)
+[![Support the Developers](https://img.shields.io/badge/Support%20the%20Developers-blue?style=flat)](#support-the-developers)
[![Wiki](https://img.shields.io/badge/Wiki-blue?style=flat)](#wiki)
# Credits @@ -287,38 +287,41 @@ - **Compatibility:** Requires iOS/iPadOS 15.0 or later. - For AltStore user: - - My official AltStore repo: https://therealfoxster.github.io/altsource-viewer/view/?source=https://raw.githubusercontent.com/arichornlover/arichornlover.github.io/main/apps.json + - My official AltStore repo (uYouEnhanced - iOS 15+): https://therealfoxster.github.io/altsource-viewer/view/?source=https://raw.githubusercontent.com/arichornloverALT/arichornloverALT.github.io/main/apps.json - - [Open in AltStore (v19.33.2-3.0.4)](https://tinyurl.com/4n9ed9a9) - It will take a while to install because AltStore needs to download the IPA first. + - My alternative AltStore repo (uYouEnhanced - iOS 14+ - mainly for Trollstore users): https://therealfoxster.github.io/altsource-viewer/view/?source=https://raw.githubusercontent.com/arichornloverALT/arichornloverALT.github.io/main/apps-legacy.json - not sure if i can update this ipa. this IPA will be locked in YouTube Version **19.20.2** + + - [Open in AltStore (v19.40.4-3.0.4)](https://tinyurl.com/44zmcw8t) - It will take a while to install because AltStore needs to download the IPA first.
- Version information (last updated: Sep 29, 2024) + Version information (last updated: Oct 10, 2024) | **Tweaks/App** | **Developer** | **Version** | **Open source** | | - | - | :-: | :-: | -| **YouTube** | Google Inc | 19.33.2 | ✖︎ | +| **YouTube** | Google Inc | 19.40.4 | ✖︎ | | [uYou](https://github.com/MiRO92/uYou-for-YouTube) | [MiRO92](https://twitter.com/miro92) | 3.0.4 | ✖︎ | | **Open in YouTube** | [CokePokes](https://github.com/CokePokes) | 1.2 | [✔︎](https://github.com/CokePokes/YoutubeExtensions) | -| **iSponsorBlock** | [Galactic-Dev](https://github.com/Galactic-Dev) | 1.2.5 | [✔︎](https://github.com/Galactic-Dev/iSponsorBlock) | +| **iSponsorBlock** | [Galactic-Dev](https://github.com/Galactic-Dev) | 1.2.9 | [✔︎](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.1.6 | [✔︎](https://github.com/therealFoxster/DontEatMyContent) | +| **DontEatMyContent** | [therealFoxster](https://github.com/therealFoxster) | 1.1.8 | [✔︎](https://github.com/therealFoxster/DontEatMyContent) | | **YTSpeed** | [Lyvendia](https://github.com/Lyvendia) | 1.0.1 | [✔︎](https://github.com/Lyvendia/YTSpeed) | | **Alderis Color Picker** | [HASHBANG Productions](https://github.com/hbang) | 1.2 | [✔︎](https://github.com/hbang/Alderis) | -| **YTUHD** | [PoomSmart](https://twitter.com/poomsmart) | 1.5.1 | [✔︎](https://github.com/PoomSmart/YTUHD) | -| **YouPiP** | [PoomSmart](https://twitter.com/poomsmart) | 1.8.9 | [✔︎](https://github.com/PoomSmart/YouPiP) | +| **YTUHD** | [PoomSmart](https://twitter.com/poomsmart) | 1.5.5 | [✔︎](https://github.com/PoomSmart/YTUHD) | +| **YouPiP** | [PoomSmart](https://twitter.com/poomsmart) | 1.8.14 | [✔︎](https://github.com/PoomSmart/YouPiP) | | **IAmYouTube** | [PoomSmart](https://twitter.com/poomsmart) | 1.3.0 | [✔︎](https://github.com/PoomSmart/IAmYouTube) | -| **YTABConfig** | [PoomSmart](https://twitter.com/poomsmart) | 1.7.2 | [✔︎](https://github.com/PoomSmart/YTABConfig) | +| **YTABConfig** | [PoomSmart](https://twitter.com/poomsmart) | 1.7.3 | [✔︎](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) | | **YouRememberCaption** | [PoomSmart](https://twitter.com/poomsmart) | 1.0.0 | [✔︎](https://poomsmart.github.io/repo/depictions/youremembercaption.html) | -| **Return YouTube Dislike** | [PoomSmart](https://twitter.com/poomsmart) | 1.11.11 | [✔︎](https://github.com/PoomSmart/Return-YouTube-Dislikes) | -| **YouMute** | [PoomSmart](https://twitter.com/poomsmart) | 1.2.1-3 | [✔︎](https://github.com/PoomSmart/YouMute) | +| **Return YouTube Dislike** | [PoomSmart](https://twitter.com/poomsmart) | 1.12.7 | [✔︎](https://github.com/PoomSmart/Return-YouTube-Dislikes) | +| **YouMute** | [PoomSmart](https://twitter.com/poomsmart) | 1.2.3 | [✔︎](https://github.com/PoomSmart/YouMute) | | **YouQuality** | [PoomSmart](https://twitter.com/poomsmart) | 1.2.1 | [✔︎](https://github.com/PoomSmart/YouQuality) | -| **YTVideoOverlay** | [PoomSmart](https://twitter.com/poomsmart) | 1.1.6 | [✔︎](https://github.com/PoomSmart/YTVideoOverlay) | -| **YTHoldForSpeed** | [joshuaseltzer](https://github.com/joshuaseltzer) | 1.2.0 | [✔︎](https://github.com/joshuaseltzer/YTHoldForSpeed) | +| **YouTube-X** | [PoomSmart](https://twitter.com/poomsmart) | 1.7.3 | [✔︎](https://github.com/PoomSmart/YouTube-X) | +| **YTVideoOverlay** | [PoomSmart](https://twitter.com/poomsmart) | 1.2.0 | [✔︎](https://github.com/PoomSmart/YTVideoOverlay) | +| **YTHoldForSpeed** | [joshuaseltzer](https://github.com/joshuaseltzer) | 1.2.1 | [✔︎](https://github.com/joshuaseltzer/YTHoldForSpeed) | | **LowContrastMode** | [arichornlover](https://github.com/arichornlover) | 1.5.2 | [✔︎](https://github.com/arichornlover/YTLowContrastMode) | | **YouTimeStamp** | [arichornlover](https://github.com/arichornlover) | 1.0.1 | [✔︎](https://github.com/arichornlover/YouTimeStamp) | @@ -332,7 +335,7 @@ | MiRO92 | uYou 3.0 | v18.06.6 - v18.18.2 | iOS 14.0 - iOS 15.8.2 | | MiRO92 | uYou 3.0.1 | v18.19.1 - v18.41.5 | iOS 14.0 - iOS 17.5.1 | | MiRO92 | uYou 3.0.2 / 3.0.3 | v19.06.2 - v19.15.1 | iOS 14.0 - iOS 17.5.1 | -| MiRO92 | uYou 3.0.4 | v19.06.2 - latest | iOS 14.0 - 17.5.1 | +| MiRO92 | uYou 3.0.4 | v19.06.2 - v19.22.6 | iOS 14.0 - 17.5.1 | # Building @@ -343,7 +346,7 @@ or [qnblackcat/Building - Wiki](https://github.com/qnblackcat/uYouPlus/wiki/Buil See [Installation - Wiki](https://github.com/qnblackcat/uYouPlus/wiki/Installation). -# Donations +# Support the developers   @@ -370,18 +373,19 @@ See [Installation - Wiki](https://github.com/qnblackcat/uYouPlus/wiki/Installati # Wiki -See [arichornlover - Wiki](https://github.com/arichornlover/uYouenhanced/wiki/) or [qnblackcat - Wiki](https://github.com/qnblackcat/uYouPlus/wiki/) +See [arichornlover - Wiki](https://github.com/arichornlover/uYouEnhanced/wiki/) or [qnblackcat - Wiki](https://github.com/qnblackcat/uYouPlus/wiki/) ## Lightweight Alternative - YTLitePlus
Read more
-- Change from uYouEnhanced to YTLitePlus (optional) -Hello, this is here to showcase this tweak. I have been seeing the YTLitePlus tweak on Reddit for quite some time now and decided to join in. Before you download the tweak, you should take a look at the pros and cons below to learn more about the tweak. +# Switch from uYouEnhanced to YTLitePlus (optional) + +Hello, this is here to showcase this tweak. I have been seeing the posts about the YTLitePlus tweak on Reddit for quite some time now and decided to add it here. Before you download or check out the tweak, you should take a look at the pros and cons below to learn more about YTLitePlus. -https://github.com/Balackburn/YTLitePlus/releases +https://github.com/YTLitePlus/YTLitePlus/releases **Pros** @@ -389,9 +393,9 @@ https://github.com/Balackburn/YTLitePlus/releases - YTLitePlus provides more features in YTLite & YTLitePlus Sections in Settings that uYouPlus/uYouEnhanced may not have. -- YTLitePlus includes a lightweight version of the App Version Spoofer, making it easier to use. +- YTLitePlus includes a lightweight and simplified version of the App Version Spoofer, making it easier to use. -- YTLitePlus does not cause your device to overheat, unlike uYouEnhanced. +- YTLitePlus does not cause your device to overheat, unlike uYouPlus/uYouEnhanced. - YTLitePlus provides faster video & audio downloading than uYouPlus/uYouEnhanced. @@ -399,5 +403,5 @@ https://github.com/Balackburn/YTLitePlus/releases - Video quality on WiFi option is not available in YTLitePlus. -- Reordering the pivot bar tabs such as ‘Home‘, ‘Shorts‘, ‘Explore‘, ‘Trending‘, Create‘, ‘Subscriptions‘ & ‘You‘ is not available in YTLitePlus. +- Reordering the pivot bar tabs such as `Home`, `Shorts`, `Explore`, `Trending`, `Create`, `Subscriptions` & `You` is not available in YTLitePlus.
From 35e97ea8dd167062f66eda71c5da7fd490e143e0 Mon Sep 17 00:00:00 2001 From: "aric3435 (INACTIVE)" <78001398+arichornlover@users.noreply.github.com> Date: Thu, 10 Oct 2024 00:40:33 -0500 Subject: [PATCH 5/5] Updated a lot of uYouEnhanced Code. (v19.40.4-3.0.4) This release also includes all of the new changes from qnblackcat/uYouPlus. and the App Version Spoofer has finally been updated again! --- Sources/AppIconOptionsController.m | 107 +-- Sources/BigYTMiniPlayer.xm | 2 +- Sources/LowContrastMode.xm | 52 +- Sources/SettingsKeys.h | 9 +- Sources/YTMiniPlayerEnabler.x.bak | 2 +- Sources/YTNoHoverCards.x.bak | 2 +- Sources/YTNoPaidPromo.x.bak | 6 +- Sources/YTReExplore.x | 2 +- Sources/uYouPlus.h | 117 ++++ Sources/uYouPlus.xm | 476 ++++++++------ Sources/uYouPlusPatches.h | 1 + Sources/uYouPlusPatches.xm | 4 +- Sources/uYouPlusSettings.xm | 876 ++++++++++++++----------- Sources/uYouPlusVersionSpoofer.xm | 838 +++++++++++++++-------- Sources/update-submodules-template.txt | 6 + 15 files changed, 1523 insertions(+), 977 deletions(-) diff --git a/Sources/AppIconOptionsController.m b/Sources/AppIconOptionsController.m index d09c3698f9..c080407901 100644 --- a/Sources/AppIconOptionsController.m +++ b/Sources/AppIconOptionsController.m @@ -2,11 +2,9 @@ #import @interface AppIconOptionsController () - @property (strong, nonatomic) UITableView *tableView; @property (strong, nonatomic) NSArray *appIcons; @property (assign, nonatomic) NSInteger selectedIconIndex; - @end @implementation AppIconOptionsController @@ -15,8 +13,6 @@ - (void)viewDidLoad { [super viewDidLoad]; self.title = @"Change App Icon"; - [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName: [UIFont fontWithName:@"YTSans-Bold" size:22], NSForegroundColorAttributeName: [UIColor whiteColor]}]; - self.selectedIconIndex = -1; self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain]; @@ -25,28 +21,11 @@ - (void)viewDidLoad { [self.view addSubview:self.tableView]; self.backButton = [UIButton buttonWithType:UIButtonTypeCustom]; - NSBundle *backIcon = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"uYouPlus" ofType:@"bundle"]]; - UIImage *backImage = [UIImage imageNamed:@"Back.png" inBundle:backIcon compatibleWithTraitCollection:nil]; - backImage = [self resizeImage:backImage newSize:CGSizeMake(24, 24)]; - backImage = [backImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - [self.backButton setTintColor:[UIColor whiteColor]]; - [self.backButton setImage:backImage forState:UIControlStateNormal]; + [self.backButton setImage:[UIImage customBackButtonImage] forState:UIControlStateNormal]; [self.backButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside]; - [self.backButton setFrame:CGRectMake(0, 0, 24, 24)]; UIBarButtonItem *customBackButton = [[UIBarButtonItem alloc] initWithCustomView:self.backButton]; self.navigationItem.leftBarButtonItem = customBackButton; - UIColor *buttonColor = [UIColor colorWithRed:203.0/255.0 green:22.0/255.0 blue:51.0/255.0 alpha:1.0]; - UIImage *resetImage = [UIImage systemImageNamed:@"arrow.clockwise.circle.fill"]; - UIBarButtonItem *resetButton = [[UIBarButtonItem alloc] initWithImage:resetImage style:UIBarButtonItemStylePlain target:self action:@selector(resetIcon)]; - resetButton.tintColor = buttonColor; - - UIImage *saveImage = [UIImage systemImageNamed:@"square.and.arrow.up.fill"]; - UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithImage:saveImage style:UIBarButtonItemStylePlain target:self action:@selector(saveIcon)]; - saveButton.tintColor = buttonColor; - - self.navigationItem.rightBarButtonItems = @[saveButton, resetButton]; - NSString *path = [[NSBundle mainBundle] pathForResource:@"uYouPlus" ofType:@"bundle"]; NSBundle *bundle = [NSBundle bundleWithPath:path]; self.appIcons = [bundle pathsForResourcesOfType:@"png" inDirectory:@"AppIcons"]; @@ -77,14 +56,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell.imageView.image = iconImage; cell.imageView.layer.cornerRadius = 10.0; cell.imageView.clipsToBounds = YES; - cell.imageView.frame = CGRectMake(10, 10, 40, 40); - cell.textLabel.frame = CGRectMake(60, 10, self.view.frame.size.width - 70, 40); - if (indexPath.row == self.selectedIconIndex) { - cell.accessoryType = UITableViewCellAccessoryCheckmark; - } else { - cell.accessoryType = UITableViewCellAccessoryNone; - } + cell.accessoryType = (indexPath.row == self.selectedIconIndex) ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; return cell; } @@ -97,11 +70,6 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath } - (void)resetIcon { - NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"]; - NSMutableDictionary *infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath]; - [infoDict removeObjectForKey:@"ALTAppIcon"]; - [infoDict writeToFile:plistPath atomically:YES]; - [[UIApplication sharedApplication] setAlternateIconName:nil completionHandler:^(NSError * _Nullable error) { if (error) { NSLog(@"Error resetting icon: %@", error.localizedDescription); @@ -109,70 +77,37 @@ - (void)resetIcon { } else { NSLog(@"Icon reset successfully"); [self showAlertWithTitle:@"Success" message:@"Icon reset successfully"]; - dispatch_async(dispatch_get_main_queue(), ^{ - [self.tableView reloadData]; - }); + [self.tableView reloadData]; } }]; } - (void)saveIcon { - if (![UIApplication sharedApplication].supportsAlternateIcons) { - NSLog(@"Alternate icons are not supported on this device."); + if (self.selectedIconIndex < 0) { + [self showAlertWithTitle:@"Error" message:@"No icon selected"]; return; } - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - NSString *selectedIcon = self.selectedIconIndex >= 0 ? self.appIcons[self.selectedIconIndex] : nil; - if (selectedIcon) { - NSString *iconName = [selectedIcon.lastPathComponent stringByDeletingPathExtension]; - - NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"]; - NSMutableDictionary *infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath]; - [infoDict setObject:iconName forKey:@"ALTAppIcon"]; - [infoDict writeToFile:plistPath atomically:YES]; - - [[UIApplication sharedApplication] setAlternateIconName:iconName completionHandler:^(NSError * _Nullable error) { - if (error) { - NSLog(@"Error setting alternate icon: %@", error.localizedDescription); - [self showAlertWithTitle:@"Error" message:@"Failed to set alternate icon"]; - } else { - NSLog(@"Alternate icon set successfully"); - [self showAlertWithTitle:@"Success" message:@"Alternate icon set successfully"]; - dispatch_async(dispatch_get_main_queue(), ^{ - [self.tableView reloadData]; - }); - } - }]; - } else { - NSLog(@"Selected icon path is nil"); - } - }); -} -- (UIImage *)resizeImage:(UIImage *)image toSize:(CGSize)size { - UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale); - [image drawInRect:CGRectMake(0, 0, size.width, size.height)]; - UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - return resizedImage; -} + NSString *selectedIcon = self.appIcons[self.selectedIconIndex]; + NSString *iconName = [selectedIcon.lastPathComponent stringByDeletingPathExtension]; -- (UIImage *)resizeImage:(UIImage *)image newSize:(CGSize)newSize { - UIGraphicsBeginImageContextWithOptions(newSize, NO, [UIScreen mainScreen].scale); - [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; - UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return newImage; + [[UIApplication sharedApplication] setAlternateIconName:iconName completionHandler:^(NSError * _Nullable error) { + if (error) { + NSLog(@"Error setting alternate icon: %@", error.localizedDescription); + [self showAlertWithTitle:@"Error" message:@"Failed to set alternate icon"]; + } else { + NSLog(@"Alternate icon set successfully"); + [self showAlertWithTitle:@"Success" message:@"Alternate icon set successfully"]; + [self.tableView reloadData]; + } + }]; } - (void)showAlertWithTitle:(NSString *)title message:(NSString *)message { - dispatch_async(dispatch_get_main_queue(), ^{ - UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert]; - UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]; - [alert addAction:okAction]; - [self presentViewController:alert animated:YES completion:nil]; - }); + UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]; + [alert addAction:okAction]; + [self presentViewController:alert animated:YES completion:nil]; } - (void)back { diff --git a/Sources/BigYTMiniPlayer.xm b/Sources/BigYTMiniPlayer.xm index d364521ae4..896460d0eb 100644 --- a/Sources/BigYTMiniPlayer.xm +++ b/Sources/BigYTMiniPlayer.xm @@ -25,7 +25,7 @@ %end %ctor { - if (IS_ENABLED(@"bigYTMiniPlayer_enabled") && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) { + if (IS_ENABLED(kBigYTMiniPlayer) && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) { %init(BigYTMiniPlayer); } } diff --git a/Sources/LowContrastMode.xm b/Sources/LowContrastMode.xm index 72e7a4e7a9..0e4c94f30a 100644 --- a/Sources/LowContrastMode.xm +++ b/Sources/LowContrastMode.xm @@ -10,10 +10,13 @@ static BOOL lowContrastMode() { static BOOL customContrastMode() { return IS_ENABLED(@"lowContrastMode_enabled") && contrastMode() == 1; } +// static UIColor *whiteTextColor() { +// return [UIColor whiteColor]; +// } UIColor *lcmHexColor; -%group gLowContrastMode // Low Contrast Mode v1.5.2 (Compatible with only YouTube v17.33.2-v17.38.10) +%group gLowContrastMode // Low Contrast Mode v1.6.0 BETA (Compatible with only YouTube v17.33.2-v17.38.10) %hook UIColor + (UIColor *)whiteColor { // Dark Theme Color return [UIColor colorWithRed: 0.56 green: 0.56 blue: 0.56 alpha: 1.00]; @@ -54,39 +57,51 @@ UIColor *lcmHexColor; %end %hook YTCommonColorPalette - (UIColor *)textPrimary { + NSLog(@"LowContrastMode: textPrimary called"); return self.pageStyle == 1 ? [UIColor whiteColor] : %orig; } - (UIColor *)textSecondary { + NSLog(@"LowContrastMode: textSecondary called"); return self.pageStyle == 1 ? [UIColor whiteColor] : %orig; } - (UIColor *)overlayTextPrimary { + NSLog(@"LowContrastMode: overlayTextPrimary called"); return self.pageStyle == 1 ? [UIColor whiteColor] : %orig; } - (UIColor *)overlayTextSecondary { + NSLog(@"LowContrastMode: overlayTextSecondary called"); return self.pageStyle == 1 ? [UIColor whiteColor] : %orig; } - (UIColor *)iconActive { + NSLog(@"LowContrastMode: iconActive called"); return self.pageStyle == 1 ? [UIColor whiteColor] : %orig; } - (UIColor *)iconActiveOther { + NSLog(@"LowContrastMode: iconActiveOther called"); return self.pageStyle == 1 ? [UIColor whiteColor] : %orig; } - (UIColor *)brandIconActive { + NSLog(@"LowContrastMode: brandIconActive called"); return self.pageStyle == 1 ? [UIColor whiteColor] : %orig; } - (UIColor *)staticBrandWhite { + NSLog(@"LowContrastMode: staticBrandWhite called"); return self.pageStyle == 1 ? [UIColor whiteColor] : %orig; } - (UIColor *)overlayIconActiveOther { + NSLog(@"LowContrastMode: overlayIconActiveOther called"); return self.pageStyle == 1 ? [UIColor whiteColor] : %orig; } - (UIColor *)overlayIconInactive { + NSLog(@"LowContrastMode: overlayIconInactive called"); return self.pageStyle == 1 ? [[UIColor whiteColor] colorWithAlphaComponent:0.7] : %orig; } - (UIColor *)overlayIconDisabled { + NSLog(@"LowContrastMode: overlayIconDisabled called"); return self.pageStyle == 1 ? [[UIColor whiteColor] colorWithAlphaComponent:0.3] : %orig; } - (UIColor *)overlayFilledButtonActive { + NSLog(@"LowContrastMode: overlayFilledButtonActive called"); return self.pageStyle == 1 ? [[UIColor whiteColor] colorWithAlphaComponent:0.2] : %orig; } %end @@ -246,12 +261,21 @@ UIColor *lcmHexColor; [modifiedAttributes setObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName]; %orig(modifiedAttributes, state); } +- (void)setCustomTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state { + NSMutableDictionary *customAttributes = [NSMutableDictionary dictionaryWithDictionary:attributes]; + [customAttributes setObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName]; + %orig(customAttributes, state); +} %end %hook UIButton - (void)setTitleColor:(UIColor *)color forState:(UIControlState)state { color = [UIColor whiteColor]; %orig(color, state); } +- (void)setCustomTitleColor:(UIColor *)color forState:(UIControlState)state { + color = [UIColor whiteColor]; + %orig(color, state); +} %end %hook UIBarButtonItem - (void)setTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state { @@ -259,6 +283,11 @@ UIColor *lcmHexColor; [modifiedAttributes setObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName]; %orig(modifiedAttributes, state); } +- (void)setCustomTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state { + NSMutableDictionary *customAttributes = [NSMutableDictionary dictionaryWithDictionary:attributes]; + [customAttributes setObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName]; + %orig(customAttributes, state); +} %end %hook NSAttributedString - (instancetype)initWithString:(NSString *)str attributes:(NSDictionary *)attrs { @@ -550,7 +579,18 @@ UIColor *lcmHexColor; %end %hook CATextLayer - (void)setTextColor:(CGColorRef)textColor { - %orig([UIColor whiteColor].CGColor); + %orig([[UIColor whiteColor] CGColor]); +} +%end +%hook _ASDisplayView +- (void)setAttributedText:(NSAttributedString *)attributedText { + NSMutableAttributedString *newAttributedString = [attributedText mutableCopy]; + [newAttributedString addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, newAttributedString.length)]; + %orig(newAttributedString); +} +- (void)setTextColor:(UIColor *)textColor { + textColor = [UIColor whiteColor]; + %orig(textColor); } %end %hook ASTextNode @@ -563,20 +603,20 @@ UIColor *lcmHexColor; %end %hook ASTextFieldNode - (void)setTextColor:(UIColor *)textColor { - %orig([UIColor whiteColor]); + %orig([UIColor whiteColor]); } %end %hook ASTextView - (void)setTextColor:(UIColor *)textColor { - %orig([UIColor whiteColor]); + %orig([UIColor whiteColor]); } %end %hook ASButtonNode - (void)setTextColor:(UIColor *)textColor { - %orig([UIColor whiteColor]); + %orig([UIColor whiteColor]); } %end -%hook UIControl // snackbar fix for lcm +%hook UIControl - (UIColor *)backgroundColor { return [UIColor blackColor]; } diff --git a/Sources/SettingsKeys.h b/Sources/SettingsKeys.h index 07274bd1d2..0a74fac11e 100644 --- a/Sources/SettingsKeys.h +++ b/Sources/SettingsKeys.h @@ -1,16 +1,11 @@ #import "uYouPlus.h" +#import "uYouPlusSettings.h" // Keys for "Copy settings" button (for: uYouEnhanced) // In alphabetical order for tweaks after uYouEnhanced NSArray *NSUserDefaultsCopyKeys = @[ // uYouEnhanced - gathered using get_keys.py - @"autoHideHomeBar_enabled", @"bigYTMiniPlayer_enabled", @"centerYouTubeLogo_enabled", @"classicVideoPlayer_enabled", @"disableAmbientMode_enabled", @"disableAnimatedYouTubeLogo_enabled", @"disableChapterSkip_enabled", @"disableCollapseButton_enabled", @"disableFullscreenButton_enabled", @"disableHints_enabled", - @"disableLiveChatSection_enabled", @"disableManageAllHistorySection_enabled", @"disableModernButtons_enabled", @"disableModernFlags_enabled", @"disableNotificationsSection_enabled", @"disablePrivacySection_enabled", @"disablePullToFull_enabled", @"disableRemainingTime_enabled", @"disableResumeToShorts_enabled",@"disableRoundedHints_enabled", @"disableTryNewFeaturesSection_enabled", @"disableVideoQualityPreferencesSection_enabled", @"disableAccountSection_enabled", - @"doubleTapToSeek_disabled", @"enableShareButton_enabled", @"enableSaveToButton_enabled", @"enableVersionSpoofer_enabled", @"fixLowContrastMode_enabled", @"flex_enabled", @"hideAutoplaySwitch_enabled", @"hideBuySuperThanks_enabled", @"hideCC_enabled", @"hideChannelHeaderLinks_enabled", @"hideChannelWatermark_enabled", - @"hideChipBar_enabled", @"hideClipButton_enabled", @"hideCommentSection_enabled", @"hideCommunityPosts_enabled", @"hideConnectButton_enabled", @"hideDownloadButton_enabled", @"hideDoubleTapToSeekOverlay_enabled", @"hideFullscreenActions_enabled", @"hideHeatwaves_enabled", @"hideHomeTab_enabled", @"hideHoverCards_enabled", @"hideHUD_enabled", @"hideModernFlags_enabled", @"hidePaidPromotionCard_enabled", @"hidePlayNextInQueue_enabled", - @"hidePreviewCommentSection_enabled", @"hidePreviousAndNextButton_enabled", @"hideRemixButton_enabled", @"hideReportButton_enabled", @"hideRightPanel_enabled", @"hideShareButton_enabled", @"hideSponsorBlockButton_enabled", @"hideSubcriptions_enabled", @"hideSubscriptionsNotificationBadge_enabled", @"hideThanksButton_enabled", @"hideVideoPlayerShadowOverlayButtons_enabled", @"hideVideoTitle_enabled", @"hideYouTubeLogo_enabled", - @"lowContrastMode_enabled", @"newSettingsUI_enabled", @"noRelatedWatchNexts_enabled", @"noSuggestedVideo_enabled", @"noVideosInFullscreen_enabled", - @"pinchToZoom_enabled", @"portraitFullscreen_enabled", @"redProgressBar_enabled", @"redSubscribeButton_enabled", @"reExplore_enabled", @"shortsQualityPicker_enabled", @"slideToSeek_enabled", @"snapToChapter_enabled", @"stockVolumeHUD_enabled", @"stickNavigationBar_enabled", @"uYouAdBlockingWorkaround_enabled", @"uYouAdBlockingWorkaroundLite_enabled", @"ytMiniPlayer_enabled", @"ytNoModernUI_enabled", @"ytStartupAnimation_enabled", + kReplaceCopyandPasteButtons, kAppTheme, kOLEDKeyboard, kPortraitFullscreen, kFullscreenToTheRight, kSlideToSeek, kYTTapToSeek, kDoubleTapToSeek, kSnapToChapter, kPinchToZoom, kYTMiniPlayer, kStockVolumeHUD, kReplaceYTDownloadWithuYou, kDisablePullToFull, kDisableChapterSkip, kAlwaysShowRemainingTime, kDisableRemainingTime, kEnableShareButton, kEnableSaveToButton, kHideYTMusicButton, kHideAutoplaySwitch, kHideCC, kHideVideoTitle, kDisableCollapseButton, kDisableFullscreenButton, kHideHUD, kHidePaidPromotionCard, kHideChannelWatermark, kHideVideoPlayerShadowOverlayButtons, kHidePreviousAndNextButton, kRedProgressBar, kHideHoverCards, kHideRightPanel, kHideFullscreenActions, kHideSuggestedVideo, kHideHeatwaves, kHideDoubleTapToSeekOverlay, kHideOverlayDarkBackground, kDisableAmbientMode, kHideVideosInFullscreen, kHideRelatedWatchNexts, kHideBuySuperThanks, kHideSubscriptions, kShortsQualityPicker, kRedSubscribeButton, kHideButtonContainers, kHideConnectButton, kHideShareButton, kHideRemixButton, kHideThanksButton, kHideDownloadButton, kHideClipButton, kHideSaveToPlaylistButton, kHideReportButton, kHidePreviewCommentSection, kHideCommentSection, kDisableAccountSection, kDisableAutoplaySection, kDisableTryNewFeaturesSection, kDisableVideoQualityPreferencesSection, kDisableNotificationsSection, kDisableManageAllHistorySection, kDisableYourDataInYouTubeSection, kDisablePrivacySection, kDisableLiveChatSection, kHidePremiumPromos, kHideHomeTab, kLowContrastMode, kClassicVideoPlayer, kFixLowContrastMode, kDisableModernButtons, kDisableRoundedHints, kDisableModernFlags, kYTNoModernUI, kEnableVersionSpoofer, kGoogleSignInPatch, kAdBlockWorkaroundLite, kAdBlockWorkaround, kYouTabFakePremium, kDisableAnimatedYouTubeLogo, kCenterYouTubeLogo, kHideYouTubeLogo, kYTStartupAnimation, kDisableHints, kStickNavigationBar, kHideiSponsorBlockButton, kHideChipBar, kHidePlayNextInQueue, kHideCommunityPosts, kHideChannelHeaderLinks, kiPhoneLayout, kBigYTMiniPlayer, kReExplore, kAutoHideHomeBar, kHideSubscriptionsNotificationBadge, kFixCasting, kNewSettingsUI, kFlex, kGoogleSigninFix, // uYou - https://github.com/MiRO92/uYou-for-YouTube @"showedWelcomeVC", @"hideShortsTab", @"hideCreateTab", @"hideCastButton", @"relatedVideosAtTheEndOfYTVideos", @"removeYouTubeAds", @"backgroundPlayback", @"disableAgeRestriction", @"iPadLayout", @"noSuggestedVideoAtEnd", @"shortsProgressBar", @"hideShortsCells", @"removeShortsCell", @"startupPage", // DEMC - https://github.com/therealFoxster/DontEatMyContent/blob/master/Tweak.h diff --git a/Sources/YTMiniPlayerEnabler.x.bak b/Sources/YTMiniPlayerEnabler.x.bak index 79b8a64303..703e862520 100644 --- a/Sources/YTMiniPlayerEnabler.x.bak +++ b/Sources/YTMiniPlayerEnabler.x.bak @@ -3,7 +3,7 @@ // YTMiniPlayerEnabler: https://github.com/level3tjg/YTMiniplayerEnabler/ %hook YTWatchMiniBarViewController - (void)updateMiniBarPlayerStateFromRenderer { - if (IS_ENABLED(@"ytMiniPlayer_enabled")) {} + if (IS_ENABLED(kYTMiniPlayer)) {} else { return %orig; } } %end diff --git a/Sources/YTNoHoverCards.x.bak b/Sources/YTNoHoverCards.x.bak index 012ed6d1e9..1197ac7217 100644 --- a/Sources/YTNoHoverCards.x.bak +++ b/Sources/YTNoHoverCards.x.bak @@ -3,7 +3,7 @@ // YTNoHoverCards: https://github.com/level3tjg/YTNoHoverCards %hook YTCreatorEndscreenView - (void)setHidden:(BOOL)hidden { - if (IS_ENABLED(@"hideHoverCards_enabled")) + if (IS_ENABLED(kHideHoverCards)) hidden = YES; %orig; } diff --git a/Sources/YTNoPaidPromo.x.bak b/Sources/YTNoPaidPromo.x.bak index 46825e0e8a..9b1ba89a8f 100644 --- a/Sources/YTNoPaidPromo.x.bak +++ b/Sources/YTNoPaidPromo.x.bak @@ -5,18 +5,18 @@ // YTNoPaidPromo: https://github.com/PoomSmart/YTNoPaidPromo %hook YTMainAppVideoPlayerOverlayViewController - (void)setPaidContentWithPlayerData:(id)data { - if (IS_ENABLED(@"hidePaidPromotionCard_enabled")) {} + if (IS_ENABLED(kHidePaidPromotionCard)) {} else { return %orig; } } - (void)playerOverlayProvider:(YTPlayerOverlayProvider *)provider didInsertPlayerOverlay:(YTPlayerOverlay *)overlay { - if ([[overlay overlayIdentifier] isEqualToString:@"player_overlay_paid_content"] && IS_ENABLED(@"hidePaidPromotionCard_enabled")) return; + if ([[overlay overlayIdentifier] isEqualToString:@"player_overlay_paid_content"] && IS_ENABLED(kHidePaidPromotionCard)) return; %orig; } %end %hook YTInlineMutedPlaybackPlayerOverlayViewController - (void)setPaidContentWithPlayerData:(id)data { - if (IS_ENABLED(@"hidePaidPromotionCard_enabled")) {} + if (IS_ENABLED(kHidePaidPromotionCard)) {} else { return %orig; } } %end diff --git a/Sources/YTReExplore.x b/Sources/YTReExplore.x index 070f426640..34f17c5f1c 100644 --- a/Sources/YTReExplore.x +++ b/Sources/YTReExplore.x @@ -38,7 +38,7 @@ static void replaceTab(YTIGuideResponse *response) { %end %ctor { - if (IS_ENABLED(@"reExplore_enabled")) { + if (IS_ENABLED(kReExplore)) { %init(YTReExplore); } } diff --git a/Sources/uYouPlus.h b/Sources/uYouPlus.h index b70c04d47d..325240feec 100644 --- a/Sources/uYouPlus.h +++ b/Sources/uYouPlus.h @@ -12,6 +12,9 @@ #import #import #import +#import +#import +#import #import #import #import @@ -62,6 +65,117 @@ #define DEFAULT_RATE 1.0f // YTSpeed #define LOWCONTRASTMODE_CUTOFF_VERSION @"17.38.10" // LowContrastMode (v17.33.2-17.38.10) +// Keys +// Copy/Paste Settings +static NSString *const kReplaceCopyandPasteButtons = @"replaceCopyandPasteButtons_enabled"; +// App appearance +static NSString *const kAppTheme = @"appTheme"; +static NSString *const kOLEDKeyboard = @"oledKeyBoard_enabled"; +// Video player +static NSString *const kPortraitFullscreen = @"portraitFullscreen_enabled"; +static NSString *const kFullscreenToTheRight = @"fullscreenToTheRight_enabled"; +static NSString *const kSlideToSeek = @"slideToSeek_enabled"; +static NSString *const kYTTapToSeek = @"YTTapToSeek_enabled"; +static NSString *const kDoubleTapToSeek = @"doubleTapToSeek_enabled"; +static NSString *const kSnapToChapter = @"snapToChapter_enabled"; +static NSString *const kPinchToZoom = @"pinchToZoom_enabled"; +static NSString *const kYTMiniPlayer = @"ytMiniPlayer_enabled"; +static NSString *const kStockVolumeHUD = @"stockVolumeHUD_enabled"; +static NSString *const kReplaceYTDownloadWithuYou = @"kReplaceYTDownloadWithuYou_enabled"; +static NSString *const kDisablePullToFull = @"disablePullToFull_enabled"; +static NSString *const kDisableChapterSkip = @"disableChapterSkip_enabled"; +static NSString *const kAlwaysShowRemainingTime = @"alwaysShowRemainingTime_enabled"; +static NSString *const kDisableRemainingTime = @"disableRemainingTime_enabled"; +// Video controls overlay +static NSString *const kEnableShareButton = @"enableShareButton_enabled"; +static NSString *const kEnableSaveToButton = @"enableSaveToButton_enabled"; +static NSString *const kHideYTMusicButton = @"hideYTMusicButton_enabled"; +static NSString *const kHideAutoplaySwitch = @"hideAutoplaySwitch_enabled"; +static NSString *const kHideCC = @"hideCC_enabled"; +static NSString *const kHideVideoTitle = @"hideVideoTitle_enabled"; +static NSString *const kDisableCollapseButton = @"disableCollapseButton_enabled"; +static NSString *const kDisableFullscreenButton = @"disableFullscreenButton_enabled"; +static NSString *const kHideHUD = @"hideHUD_enabled"; +static NSString *const kHidePaidPromotionCard = @"hidePaidPromotionCard_enabled"; +static NSString *const kHideChannelWatermark = @"hideChannelWatermark_enabled"; +static NSString *const kHideVideoPlayerShadowOverlayButtons = @"hideVideoPlayerShadowOverlayButtons_enabled"; +static NSString *const kHidePreviousAndNextButton = @"hidePreviousAndNextButton_enabled"; +static NSString *const kRedProgressBar = @"redProgressBar_enabled"; +static NSString *const kHideHoverCards = @"hideHoverCards_enabled"; +static NSString *const kHideRightPanel = @"hideRightPanel_enabled"; +static NSString *const kHideFullscreenActions = @"hideFullscreenActions_enabled"; +static NSString *const kHideSuggestedVideo = @"hideSuggestedVideo_enabled"; +static NSString *const kHideHeatwaves = @"hideHeatwaves_enabled"; +static NSString *const kHideDoubleTapToSeekOverlay = @"hideDoubleTapToSeekOverlay_enabled"; +static NSString *const kHideOverlayDarkBackground = @"hideOverlayDarkBackground_enabled"; +static NSString *const kDisableAmbientMode = @"disableAmbientMode_enabled"; +static NSString *const kHideVideosInFullscreen = @"hideVideosInFullscreen_enabled"; +static NSString *const kHideRelatedWatchNexts = @"hideRelatedWatchNexts_enabled"; +// Shorts control overlay +static NSString *const kHideBuySuperThanks = @"hideBuySuperThanks_enabled"; +static NSString *const kHideSubscriptions = @"hideSubscriptions_enabled"; +static NSString *const kShortsQualityPicker = @"shortsQualityPicker_enabled"; +// Video player buttons +static NSString *const kRedSubscribeButton = @"redSubscribeButton_enabled"; +static NSString *const kHideButtonContainers = @"hideButtonContainers_enabled"; +static NSString *const kHideConnectButton = @"hideConnectButton_enabled"; +static NSString *const kHideShareButton = @"hideShareButton_enabled"; +static NSString *const kHideRemixButton = @"hideRemixButton_enabled"; +static NSString *const kHideThanksButton = @"hideRemixButton_enabled"; +static NSString *const kHideDownloadButton = @"hideDownloadButton_enabled"; +static NSString *const kHideClipButton = @"hideClipButton_enabled"; +static NSString *const kHideSaveToPlaylistButton = @"hideSaveToPlaylistButton_enabled"; +static NSString *const kHideReportButton = @"hideReportButton_enabled"; +static NSString *const kHidePreviewCommentSection = @"hidePreviewCommentSection_enabled"; +static NSString *const kHideCommentSection = @"hideCommentSection_enabled"; +// App settings overlay +static NSString *const kDisableAccountSection = @"disableAccountSection_enabled"; +static NSString *const kDisableAutoplaySection = @"disableAutoplaySection_enabled"; +static NSString *const kDisableTryNewFeaturesSection = @"disableTryNewFeaturesSection_enabled"; +static NSString *const kDisableVideoQualityPreferencesSection = @"disableVideoQualityPreferencesSection_enabled"; +static NSString *const kDisableNotificationsSection = @"disableNotificationsSection_enabled"; +static NSString *const kDisableManageAllHistorySection = @"disableManageAllHistorySection_enabled"; +static NSString *const kDisableYourDataInYouTubeSection = @"disableYourDataInYouTubeSection_enabled"; +static NSString *const kDisablePrivacySection = @"disablePrivacySection_enabled"; +static NSString *const kDisableLiveChatSection = @"disableLiveChatSection_enabled"; +static NSString *const kHidePremiumPromos = @"hidePremiumPromos_enabled"; +// UI Interface +static NSString *const kHideHomeTab = @"hideHomeTab_enabled"; +static NSString *const kLowContrastMode = @"lowContrastMode_enabled"; +static NSString *const kClassicVideoPlayer = @"classicVideoPlayer_enabled"; +static NSString *const kFixLowContrastMode = @"fixLowContrastMode_enabled"; +static NSString *const kDisableModernButtons = @"disableModernButtons_enabled"; +static NSString *const kDisableRoundedHints = @"disableRoundedHints_enabled"; +static NSString *const kDisableModernFlags = @"disableModernFlags_enabled"; +static NSString *const kYTNoModernUI = @"ytNoModernUI_enabled"; +static NSString *const kEnableVersionSpoofer = @"enableVersionSpoofer_enabled"; +// Miscellaneous +static NSString *const kGoogleSignInPatch = @"googleSignInPatch_enabled"; +static NSString *const kAdBlockWorkaroundLite = @"adBlockWorkaroundLite_enabled"; +static NSString *const kAdBlockWorkaround = @"adBlockWorkaround_enabled"; +static NSString *const kYouTabFakePremium = @"youTabFakePremium_enabled"; +static NSString *const kDisableAnimatedYouTubeLogo = @"disableAnimatedYouTubeLogo_enabled"; +static NSString *const kCenterYouTubeLogo = @"centerYouTubeLogo_enabled"; +static NSString *const kHideYouTubeLogo = @"hideYouTubeLogo_enabled"; +static NSString *const kYTStartupAnimation = @"ytStartupAnimation_enabled"; +static NSString *const kDisableHints = @"disableHints_enabled"; +static NSString *const kStickNavigationBar = @"stickNavigationBar_enabled"; +static NSString *const kHideiSponsorBlockButton = @"hideiSponsorBlockButton_enabled"; +static NSString *const kHideChipBar = @"hideChipBar_enabled"; +static NSString *const kHidePlayNextInQueue = @"hidePlayNextInQueue_enabled"; +static NSString *const kHideCommunityPosts = @"hideCommunityPosts_enabled"; +static NSString *const kHideChannelHeaderLinks = @"hideChannelHeaderLinks_enabled"; +static NSString *const kiPhoneLayout = @"iPhoneLayout_enabled"; +static NSString *const kBigYTMiniPlayer = @"bigYTMiniPlayer_enabled"; +static NSString *const kReExplore = @"reExplore_enabled"; +static NSString *const kAutoHideHomeBar = @"autoHideHomeBar_enabled"; +static NSString *const kHideSubscriptionsNotificationBadge = @"hideSubscriptionsNotificationBadge_enabled"; +static NSString *const kFixCasting = @"fixCasting_enabled"; +static NSString *const kNewSettingsUI = @"newSettingsUI_enabled"; +static NSString *const kFlex = @"flex_enabled"; +// unused (uYouEnhanced) +static NSString *const kGoogleSigninFix = @"googleSigninFix_enabled"; + // Always show remaining time in video player - @bhackel // Header has been moved to https://github.com/PoomSmart/YouTubeHeader/blob/main/YTPlayerBarController.h // Header has been moved to https://github.com/PoomSmart/YouTubeHeader/blob/main/YTInlinePlayerBarContainerView.h @@ -167,6 +281,9 @@ @interface YTPlaybackButton : UIControl @end +@interface HelperVC : UIViewController +@end + @interface YTPlaylistHeaderViewController : UIViewController @property UIButton *downloadsButton; @end diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index ab46f6843d..66b60f1905 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -1,4 +1,5 @@ #import "uYouPlus.h" +#import "uYouPlusPatches.h" // Tweak's bundle for Localizations support - @PoomSmart - https://github.com/PoomSmart/YouPiP/commit/aea2473f64c75d73cab713e1e2d5d0a77675024f NSBundle *uYouPlusBundle() { @@ -16,6 +17,142 @@ NSBundle *uYouPlusBundle() { NSBundle *tweakBundle = uYouPlusBundle(); // +// LEGACY VERSION ⚠️ +// Hide the (Connect / Thanks / Save / Report) Buttons under the Video Player - 17.33.2 and up - @arichornlover (inspired by @PoomSmart's version) +%hook _ASDisplayView +- (void)layoutSubviews { + %orig; + BOOL hideConnectButton = IS_ENABLED(@"hideConnectButton_enabled"); + BOOL hideThanksButton = IS_ENABLED(@"hideThanksButton_enabled"); + BOOL hideSaveToPlaylistButton = IS_ENABLED(@"hideSaveToPlaylistButton_enabled"); + BOOL hideReportButton = IS_ENABLED(@"hideReportButton_enabled"); + + for (UIView *subview in self.subviews) { + if ([subview.accessibilityLabel isEqualToString:@"connect account"]) { + subview.hidden = hideConnectButton; + } else if ([subview.accessibilityLabel isEqualToString:@"Thanks"]) { + subview.hidden = hideThanksButton; + } else if ([subview.accessibilityLabel isEqualToString:@"Save to playlist"]) { + subview.hidden = hideSaveToPlaylistButton; + } else if ([subview.accessibilityLabel isEqualToString:@"Report"]) { + subview.hidden = hideReportButton; + } + } +} +%end + +// UPDATED VERSION +// Hide the (Connect / Share / Remix / Thanks / Download / Clip / Save / Report) Buttons under the Video Player - 17.33.2 and up - @PoomSmart (inspired by @arichornlover) - METHOD BROKE Server-Side on May 14th 2024 +static BOOL findCell(ASNodeController *nodeController, NSArray *identifiers) { + for (id child in [nodeController children]) { + NSLog(@"Child: %@", [child description]); + + if ([child isKindOfClass:%c(ELMNodeController)]) { + NSArray *elmChildren = [(ELMNodeController * _Nullable)child children]; + for (ELMComponent *elmChild in elmChildren) { + for (NSString *identifier in identifiers) { + if ([[elmChild description] containsString:identifier]) { + NSLog(@"Found identifier: %@", identifier); + return YES; + } + } + } + } + + if ([child isKindOfClass:%c(ASNodeController)]) { + ASDisplayNode *childNode = ((ASNodeController * _Nullable)child).node; // ELMContainerNode + NSArray *yogaChildren = childNode.yogaChildren; + for (ASDisplayNode *displayNode in yogaChildren) { + NSLog(@"Yoga Child: %@", displayNode.accessibilityIdentifier); + + if ([identifiers containsObject:displayNode.accessibilityIdentifier]) { + NSLog(@"Found identifier: %@", displayNode.accessibilityIdentifier); + return YES; + } + + if (findCell(child, identifiers)) { + return YES; + } + } + } + } + return NO; +} + +%hook ASCollectionView // This stopped working on May 14th 2024 due to a Server-Side Change from YouTube. +- (CGSize)sizeForElement:(ASCollectionElement * _Nullable)element { + if ([self.accessibilityIdentifier isEqualToString:@"id.video.scrollable_action_bar"]) { + ASCellNode *node = [element node]; + ASNodeController *nodeController = [node controller]; + + if (IS_ENABLED(@"hideShareButton_enabled") && findCell(nodeController, @[@"id.video.share.button"])) { + return CGSizeZero; + } + + if (IS_ENABLED(@"hideRemixButton_enabled") && findCell(nodeController, @[@"id.video.remix.button"])) { + return CGSizeZero; + } + + if (IS_ENABLED(@"hideThanksButton_enabled") && findCell(nodeController, @[@"Thanks"])) { + return CGSizeZero; + } + + if (IS_ENABLED(@"hideClipButton_enabled") && findCell(nodeController, @[@"clip_button.eml"])) { + return CGSizeZero; + } + + if (IS_ENABLED(@"hideDownloadButton_enabled") && findCell(nodeController, @[@"id.ui.add_to.offline.button"])) { + return CGSizeZero; + } + + if (IS_ENABLED(@"hideCommentSection_enabled") && findCell(nodeController, @[@"id.ui.carousel_header"])) { + return CGSizeZero; + } + } + return %orig; +} +%end + +// Replace YouTube's download with uYou's +YTMainAppControlsOverlayView *controlsOverlayView; +%hook YTMainAppControlsOverlayView +- (id)initWithDelegate:(id)arg1 { + controlsOverlayView = %orig; + return controlsOverlayView; +} +%end +%hook YTElementsDefaultSheetController ++ (void)showSheetController:(id)arg1 showCommand:(id)arg2 commandContext:(id)arg3 handler:(id)arg4 { + if (IS_ENABLED(kReplaceYTDownloadWithuYou) && [arg2 isKindOfClass:%c(ELMPBShowActionSheetCommand)]) { + ELMPBShowActionSheetCommand *showCommand = (ELMPBShowActionSheetCommand *)arg2; + NSArray *listOptions = [showCommand listOptionArray]; + for (ELMPBElement *element in listOptions) { + ELMPBProperties *properties = [element properties]; + ELMPBIdentifierProperties *identifierProperties = [properties firstSubmessage]; + // 19.30.2 + if ([identifierProperties respondsToSelector:@selector(identifier)]) { + NSString *identifier = [identifierProperties identifier]; + if ([identifier containsString:@"offline_upsell_dialog"]) { + if ([controlsOverlayView respondsToSelector:@selector(uYou)]) { + [controlsOverlayView uYou]; + } + return; + } + } + // 19.20.2 + NSString *description = [identifierProperties description]; + if ([description containsString:@"offline_upsell_dialog"]) { + if ([controlsOverlayView respondsToSelector:@selector(uYou)]) { + [controlsOverlayView uYou]; + } + return; + } + } + } + %orig; +} +%end + # pragma mark - Other hooks // Activate FLEX @@ -24,7 +161,7 @@ NSBundle *tweakBundle = uYouPlusBundle(); didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { BOOL didFinishLaunching = %orig; - if (IS_ENABLED(@"flex_enabled")) { + if (IS_ENABLED(kFlex)) { [[%c(FLEXManager) performSelector:@selector(sharedManager)] performSelector:@selector(showExplorer)]; } @@ -32,7 +169,7 @@ NSBundle *tweakBundle = uYouPlusBundle(); } - (void)appWillResignActive:(id)arg1 { %orig; - if (IS_ENABLED(@"flex_enabled")) { + if (IS_ENABLED(kFlex)) { [[%c(FLEXManager) performSelector:@selector(sharedManager)] performSelector:@selector(showExplorer)]; } } @@ -77,7 +214,7 @@ NSBundle *tweakBundle = uYouPlusBundle(); } %end -// uYou AdBlock Workaround LITE (This Version will only remove ads from Videos/Shorts!) - @PoomSmart +// uYou AdBlock Workaround LITE (This Version will only remove ads from only Videos/Shorts!) - @PoomSmart %group uYouAdBlockingWorkaroundLite %hook YTHotConfig - (BOOL)disableAfmaIdfaCollection { return NO; } @@ -244,6 +381,27 @@ static NSMutableArray *filteredArray(NSArray *filteredArray(NSArray *filteredArray(NSArray