From 754e3e9c98083ec17861ff001bea7679f6f10aff Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Wed, 3 Jul 2024 15:47:53 -0500 Subject: [PATCH 1/6] =?UTF-8?q?Fix=20=E2=80=9CYTShareRequestViewController?= =?UTF-8?q?=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/uYouPlusPatches.xm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/uYouPlusPatches.xm b/Sources/uYouPlusPatches.xm index d68616a..2f078c5 100644 --- a/Sources/uYouPlusPatches.xm +++ b/Sources/uYouPlusPatches.xm @@ -151,8 +151,12 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity) { /* %hook YTShareRequestViewController - (id)initWithService:(id)_service parentResponder:(id)_parentResponder { - // disable the default share sheet behavior and force the app to call [YTAccountScopedCommandRouter handleCommand] - return NULL; + id result = %orig; + // disable the default share sheet behavior and force the app to call [YTAccountScopedCommandRouter handleCommand] if available + if ([_parentResponder respondsToSelector:@selector(handleCommand:entry:fromView:sender:completionBlock:)]) { + [_parentResponder handleCommand:nil entry:nil fromView:nil sender:nil completionBlock:nil]; + } + return result; } %end */ From ef338016e897b5f6e1d2fc0dfba92710f99ccabe Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Thu, 4 Jul 2024 05:39:37 -0500 Subject: [PATCH 2/6] Added Legacy uYouEnhanced AltSource Repo - supports iOS 14 For Reddit post: https://www.reddit.com/r/sideloaded/s/oYCQnRpONG and mainly for Trollstore members! --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ad339e7..2823f9e 100644 --- a/README.md +++ b/README.md @@ -287,7 +287,9 @@ - **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 + + - 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.21.2-3.0.4)](https://tinyurl.com/2wea84xd) - It will take a while to install because AltStore needs to download the IPA first. From 661b7ddc5225071da34cce5e1bb9c30c164f92e6 Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Thu, 4 Jul 2024 05:50:00 -0500 Subject: [PATCH 3/6] Update uYouPlusPatches.xm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also let me remind y’all that uYouEnhanced isn’t discontinued. Saying this as of July 4th 2024. --- Sources/uYouPlusPatches.xm | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Sources/uYouPlusPatches.xm b/Sources/uYouPlusPatches.xm index 2f078c5..7430664 100644 --- a/Sources/uYouPlusPatches.xm +++ b/Sources/uYouPlusPatches.xm @@ -12,16 +12,6 @@ } %end -// 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 @@ -175,7 +165,6 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity) { } %end - /* ------------------- iPhone Layout ------------------- */ %hook ELMPBShowActionSheetCommand @@ -351,4 +340,7 @@ static void refreshUYouAppearance() { // Disable uYou's playback speed controls (prevent crash on video playback https://github.com/therealFoxster/uYouPlus/issues/2#issuecomment-1894912963) // [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"showPlaybackRate"]; + + // Disable uYou's adblock + [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"removeYouTubeAds"]; } From 7f5a231f462340dd6846e58459f22a449ad10739 Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Thu, 4 Jul 2024 06:13:56 -0500 Subject: [PATCH 4/6] Updated `Disable Modern Flags` Option (19.23.3+) Support has been added for newer YouTube versions so it will remove App Modernization better. --- Sources/uYouPlus.xm | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 4c67bd3..91a3465 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -664,15 +664,31 @@ static int contrastMode() { - (BOOL)cxClientEnableModernizedActionSheet { return NO; } - (BOOL)enableClientShortsSheetsModernization { return NO; } - (BOOL)enableTimestampModernizationForNative { return NO; } -- (BOOL)modernizeElementsTextColor { return NO; } -- (BOOL)modernizeElementsBgColor { return NO; } +- (BOOL)mainAppCoreClientEnableModernIaFeedStretchBottom { return NO; } +- (BOOL)mainAppCoreClientEnableModernIaFrostedBottomBar { return NO; } +- (BOOL)mainAppCoreClientEnableModernIaFrostedPivotBar { return NO; } +- (BOOL)mainAppCoreClientEnableModernIaFrostedPivotBarUpdatedBackdrop { return NO; } +- (BOOL)mainAppCoreClientEnableModernIaFrostedTopBar { return NO; } +- (BOOL)mainAppCoreClientEnableModernIaOpacityPivotBar { return NO; } +- (BOOL)mainAppCoreClientEnableModernIaTopAndBottomBarIconRefresh { return NO; } +- (BOOL)mainAppCoreClientEnableModernizedBedtimeReminderU18DefaultSettings { return NO; } +- (BOOL)modernizeCameoNavbar { return NO; } - (BOOL)modernizeCollectionLockups { return NO; } +- (BOOL)modernizeCollectionLockupsShowVideoCount { return NO; } +- (BOOL)modernizeElementsBgColor { return NO; } +- (BOOL)modernizeElementsTextColor { return NO; } +- (BOOL)postsCreatorClientEnableModernButtonsUi { return NO; } +- (BOOL)pullToFullModernEdu { return NO; } +- (BOOL)showModernMiniplayerRedesign { return NO; } - (BOOL)uiSystemsClientGlobalConfigEnableModernButtonsForNative { return NO; } - (BOOL)uiSystemsClientGlobalConfigIosEnableModernTabsForNative { return NO; } -- (BOOL)uiSystemsClientGlobalConfigIosEnableEpUxUpdates { return NO; } -- (BOOL)uiSystemsClientGlobalConfigIosEnableSheetsUxUpdates { return NO; } +- (BOOL)uiSystemsClientGlobalConfigIosEnableEpUxUpdates { return NO; } // Deprecated +- (BOOL)uiSystemsClientGlobalConfigIosEnableSheetsUxUpdates { return NO; } // Deprecated - (BOOL)uiSystemsClientGlobalConfigIosEnableSnackbarModernization { return NO; } +- (BOOL)uiSystemsClientGlobalConfigModernizeNativeBgColor { return NO; } +- (BOOL)uiSystemsClientGlobalConfigModernizeNativeTextColor { return NO; } // Disable Rounded Content +- (BOOL)enableIosFloatingMiniplayerRoundedCornerRadius { return YES; } - (BOOL)iosDownloadsPageRoundedThumbs { return NO; } - (BOOL)iosRoundedSearchBarSuggestZeroPadding { return NO; } - (BOOL)uiSystemsClientGlobalConfigEnableRoundedDialogForNative { return NO; } From 39781009723bbbb1c87d2863455fe146ff57d61f Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Thu, 4 Jul 2024 06:42:42 -0500 Subject: [PATCH 5/6] Updated `Hide Fullscreen Button` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a replacement since the previous implementation breaks PoomSmart’s 1.2.0+ YouQuality tweak. --- Sources/uYouPlus.xm | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 91a3465..6ccf1dc 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -682,8 +682,6 @@ static int contrastMode() { - (BOOL)showModernMiniplayerRedesign { return NO; } - (BOOL)uiSystemsClientGlobalConfigEnableModernButtonsForNative { return NO; } - (BOOL)uiSystemsClientGlobalConfigIosEnableModernTabsForNative { return NO; } -- (BOOL)uiSystemsClientGlobalConfigIosEnableEpUxUpdates { return NO; } // Deprecated -- (BOOL)uiSystemsClientGlobalConfigIosEnableSheetsUxUpdates { return NO; } // Deprecated - (BOOL)uiSystemsClientGlobalConfigIosEnableSnackbarModernization { return NO; } - (BOOL)uiSystemsClientGlobalConfigModernizeNativeBgColor { return NO; } - (BOOL)uiSystemsClientGlobalConfigModernizeNativeTextColor { return NO; } @@ -1041,8 +1039,9 @@ static int contrastMode() { } %end +/* // LEGACY VERSION ⚠️ -// Hide Fullscreen Button - @arichornlover - PoomSmart's Newer Version of the *YouQuality* tweak breaks when enabling this +// Hide Fullscreen Button - @arichornlover - PoomSmart's 1.2.0+ Versions of the *YouQuality* tweak makes the button invisible when enabling this %hook YTInlinePlayerBarContainerView - (void)layoutSubviews { %orig; @@ -1059,15 +1058,18 @@ static int contrastMode() { } } %end +*/ // NEW VERSION -// Hide Fullscreen Button - @arichornlover - UNTESTED! -// %hook YTInlinePlayerBarContainerView -// - (BOOL)fullscreenButtonDisabled { return YES; } -// - (BOOL)canShowFullscreenButton { return NO; } -// - (BOOL)canShowFullscreenButtonExperimental { return NO; } -// - (void)setFullscreenButtonDisabled:(BOOL) // this line should remain disabled for now. -// %end +// Hide Fullscreen Button - @arichornlover +%group gHideFullscreenButton +%hook YTInlinePlayerBarContainerView +- (BOOL)fullscreenButtonDisabled { return YES; } +- (BOOL)canShowFullscreenButton { return NO; } +- (BOOL)canShowFullscreenButtonExperimental { return NO; } +// - (void)setFullscreenButtonDisabled:(BOOL) // Uncomment and might implement this if needed - @arichornlover +%end +%end // Hide HUD Messages %hook YTHUDMessageView @@ -1674,6 +1676,9 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide if (IS_ENABLED(@"portraitFullscreen_enabled")) { %init(gPortraitFullscreen); } + if (IS_ENABLED(@"disableFullscreenButton_enabled")) { + %init(gHideFullscreenButton); + } if (IS_ENABLED(@"hideFullscreenActions_enabled")) { %init(hideFullscreenActions); } From 4214d03d3be2b3448bf3a3e79db63abf96661e4a Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Fri, 5 Jul 2024 04:57:16 -0500 Subject: [PATCH 6/6] Improved `Copy Settings` & `Paste Settings` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also fixes crashing when interacting with the buttons when having “replaceCopyandPasteButtons_enabled” enabled. --- Sources/uYouPlusSettings.xm | 41 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index b1af9ce..0c985e0 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -201,21 +201,19 @@ extern NSBundle *uYouPlusBundle(); selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { if (IS_ENABLED(@"replaceCopyandPasteButtons_enabled")) { // Export Settings functionality - NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; + NSURL *tempFileURL = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:@"exported_settings.txt"]]; NSMutableString *settingsString = [NSMutableString string]; for (NSString *key in copyKeys) { - if ([userDefaults objectForKey:key]) { - NSString *value = [userDefaults objectForKey:key]; + id value = [[NSUserDefaults standardUserDefaults] objectForKey:key]; + if (value) { [settingsString appendFormat:@"%@: %@\n", key, value]; } } - if (settingsString.length > 0) { - UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.text"] inMode:UIDocumentPickerModeExportToService]; + [settingsString writeToURL:tempFileURL atomically:YES encoding:NSUTF8StringEncoding error:nil]; + UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithURL:tempFileURL inMode:UIDocumentPickerModeExportToService]; documentPicker.delegate = (id)self; documentPicker.allowsMultipleSelection = NO; - [UIApplication.sharedApplication.keyWindow.rootViewController presentViewController:documentPicker animated:YES completion:nil]; - } - return YES; + [settingsViewController presentViewController:documentPicker animated:YES completion:nil]; } else { // Copy Settings functionality (default behavior) NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; @@ -245,7 +243,7 @@ extern NSBundle *uYouPlusBundle(); UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.text"] inMode:UIDocumentPickerModeImport]; documentPicker.delegate = (id)self; documentPicker.allowsMultipleSelection = NO; - [UIApplication.sharedApplication.keyWindow.rootViewController presentViewController:documentPicker animated:YES completion:nil]; + [settingsViewController presentViewController:documentPicker animated:YES completion:nil]; return YES; } else { // Paste Settings functionality (default behavior) @@ -262,7 +260,7 @@ extern NSBundle *uYouPlusBundle(); NSString *value = components[1]; [[NSUserDefaults standardUserDefaults] setObject:value forKey:key]; } - } + } [settingsViewController reloadData]; SHOW_RELAUNCH_YT_SNACKBAR; } @@ -1395,18 +1393,23 @@ extern NSBundle *uYouPlusBundle(); [settingsViewController setSectionItems:sectionItems forCategory:uYouPlusSection title:@"uYouEnhanced" titleDescription:LOC(@"TITLE DESCRIPTION") headerHidden:YES]; } -// File Manager (Paste Settings) +// File Manager (Import Settings .txt) - (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray *)urls { if (urls.count > 0) { - NSString *fileContents = [NSString stringWithContentsOfURL:urls.firstObject encoding:NSUTF8StringEncoding error:nil]; - NSArray *lines = [fileContents componentsSeparatedByString:@"\n"]; - for (NSString *line in lines) { - NSArray *components = [line componentsSeparatedByString:@": "]; - if (components.count == 2) { - NSString *key = components[0]; - NSString *value = components[1]; - [[NSUserDefaults standardUserDefaults] setObject:value forKey:key]; + NSURL *fileURL = urls.firstObject; + NSString *fileContents = [NSString stringWithContentsOfURL:fileURL encoding:NSUTF8StringEncoding error:nil]; + if (fileContents.length > 0) { + NSArray *lines = [fileContents componentsSeparatedByString:@"\n"]; + for (NSString *line in lines) { + NSArray *components = [line componentsSeparatedByString:@": "]; + if (components.count == 2) { + NSString *key = components[0]; + NSString *value = components[1]; + [[NSUserDefaults standardUserDefaults] setObject:value forKey:key]; + } } + YTSettingsViewController *settingsViewController = [self valueForKey:@"_settingsViewControllerDelegate"]; + [settingsViewController reloadData]; } } }