diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index da22006..224a281 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -151,7 +151,7 @@ jobs: - name: Upload Artifact if: ${{ inputs.upload_artifact }} - uses: actions/upload-artifact@v4.3.3 + uses: actions/upload-artifact@v4.3.4 env: UYOU_VERSION: ${{ inputs.uyou_version }} YOUTUBE_VERSION: ${{ steps.prepare_youtube.outputs.youtube_version }} diff --git a/Makefile b/Makefile index 0344d6a..d81b76c 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ MODULES = jailed endif ifndef YOUTUBE_VERSION -YOUTUBE_VERSION = 19.23.3 +YOUTUBE_VERSION = 19.28.1 endif ifndef UYOU_VERSION UYOU_VERSION = 3.0.4 diff --git a/README.md b/README.md index 2823f9e..8665164 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +# How to fix the "remote: Repository not found." Error (buildapp.yml) ⚠️ +In order to simply fix this problem go to **Actions** and then go to **Update Submodules** and right as soon as you get there then trigger the **Run Workflow** + +Also please know that I can't trigger actions when my account is flagged so I can't update them on uYouEnhanced myself. + +# uYouEnhanced

UYOUPLUS_LOGO diff --git a/Sources/uYouPlus.h b/Sources/uYouPlus.h index bf8c680..c444b6c 100644 --- a/Sources/uYouPlus.h +++ b/Sources/uYouPlus.h @@ -1,53 +1,58 @@ #import -#import -#import +#import #import -#import +#import #import -#import -#import +#import +#import #import - -#import "uYouPlusThemes.h" // Hide "Buy Super Thanks" banner (_ASDisplayView) -#import // Activate FLEX -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import // Fixes uYou crash when trying to play video (#1422) - -// Hide buttons under the video player by @PoomSmart +#import +#import #import #import -#import - -// YouTube-X -#import -#import #import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import "uYouPlusThemes.h" // uYouPlus Themes #define LOC(x) [tweakBundle localizedStringForKey:x value:nil table:nil] #define IS_ENABLED(k) [[NSUserDefaults standardUserDefaults] boolForKey:k] @@ -58,12 +63,8 @@ #define LOWCONTRASTMODE_CUTOFF_VERSION @"17.38.10" // LowContrastMode (v17.33.2-17.38.10) // Always show remaining time in video player - @bhackel -@interface YTPlayerBarController : NSObject -@property(nonatomic, strong) YTInlinePlayerBarContainerView *playerBar; -@end -@interface YTInlinePlayerBarContainerView (uYouEnhanced) -@property(nonatomic, assign) BOOL shouldDisplayTimeRemaining; -@end +// 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 // IAmYouTube @interface SSOConfiguration : NSObject @@ -85,12 +86,10 @@ // Hide Home Tab - @bhackel @interface YTPivotBarItemViewAccessibilityControl : UIControl @end -@interface YTPivotBarItemView (uYouEnhanced) -@property (nonatomic, strong) YTPivotBarItemViewAccessibilityControl *hitTarget; -@end +// YTPivotBarItemView Header has been moved to https://github.com/arichornloverALT/YouTubeHeader/blob/main/YTPivotBarItemView.h // YTTapToSeek - https://github.com/bhackel/YTTapToSeek -// Header has been moved to https://github.com/arichornlover/YouTubeHeader/blob/main/YTMainAppVideoPlayerOverlayViewController.h +// YTMainAppVideoPlayerOverlayViewController Header has been moved to https://github.com/arichornloverALT/YouTubeHeader/blob/main/YTMainAppVideoPlayerOverlayViewController.h // Enable Premium logo - @bhackel @interface YTITopbarLogoRenderer : NSObject @@ -98,36 +97,12 @@ @end // Hide Premium Promo in You tab - @bhackel -@interface YTIIconThumbnailRenderer : GPBMessage -@property (nonatomic, strong) YTIIcon *icon; -- (BOOL)hasIcon; -@end -@interface YTICompactListItemThumbnailSupportedRenderers : GPBMessage -@property (nonatomic, strong) YTIIconThumbnailRenderer *iconThumbnailRenderer; -- (BOOL)hasIconThumbnailRenderer; -@end -@interface YTICompactListItemRenderer : GPBMessage -@property (nonatomic, strong) YTICompactListItemThumbnailSupportedRenderers *thumbnail; -@property (nonatomic, strong) YTIFormattedString *title; -- (BOOL)hasThumbnail; -- (BOOL)hasTitle; -@end -@interface YTIIcon (uYouEnhanced) -- (BOOL)hasIconType; -@end -@interface YTICompactLinkRenderer : GPBMessage -@property (nonatomic, strong) YTIIcon *icon; -@property (nonatomic, strong) YTIFormattedString *title; -@property (nonatomic, strong) YTICompactListItemThumbnailSupportedRenderers *thumbnail; -- (BOOL)hasIcon; -- (BOOL)hasThumbnail; -@end -@interface YTIItemSectionSupportedRenderers (uYouEnhanced) -@property(readonly, nonatomic) YTICompactLinkRenderer *compactLinkRenderer; -@property(readonly, nonatomic) YTICompactListItemRenderer *compactListItemRenderer; -- (BOOL)hasCompactLinkRenderer; -- (BOOL)hasCompactListItemRenderer; -@end +// YTIIconThumbnailRenderer Header has been moved to https://github.com/arichornloverALT/YouTubeHeader/blob/main/YTIIconThumbnailRenderer.h +// YTICompactListItemThumbnailSupportedRenderers Header has been moved to https://github.com/arichornloverALT/YouTubeHeader/blob/main/YTICompactListItemThumbnailSupportedRenderers.h +// YTICompactListItemRenderer Header has been moved to https://github.com/arichornloverALT/YouTubeHeader/blob/main/YTICompactListItemRenderer.h +// YTIIcon Header has been moved to https://github.com/arichornloverALT/YouTubeHeader/blob/main/YTIIcon.h +// YTICompactLinkRenderer Header has been moved to https://github.com/arichornloverALT/YouTubeHeader/blob/main/YTICompactLinkRenderer.h +// YTIItemSectionSupportedRenderers Header has been moved to https://github.com/arichornloverALT/YouTubeHeader/blob/main/YTIItemSectionSupportedRenderers.h @interface YTAppCollectionViewController : YTInnerTubeCollectionViewController - (void)uYouEnhancedFakePremiumModel:(YTISectionListRenderer *)model; @end @@ -136,16 +111,18 @@ @end // Disable Pull to Full for landscape videos - @bhackel -@interface YTWatchPullToFullController : NSObject -@property(nonatomic, strong) YTWatchViewController *playerViewSource; -@end -@interface YTWatchViewController (uYouEnhanced) -@property(nonatomic, strong) YTWatchPullToFullController *pullToFullController; -- (NSUInteger) allowedFullScreenOrientations; +// YTWatchPullToFullController Header has been moved to https://github.com/PoomSmart/YouTubeHeader/blob/main/YTWatchPullToFullController.h + // Fullscreen to the Right (uYouEnhanced Version) - @arichornlover +@interface YTWatchViewController (uYouEnhanced) - (UIInterfaceOrientationMask) supportedInterfaceOrientations; - (UIInterfaceOrientation) preferredInterfaceOrientationForPresentation; -- (void)forceRightFullscreenOrientation; +@end + +// Center YouTube Logo (Custom Version) - @arichornlover +@interface YTNavigationBarTitleView (uYouEnhanced) +@property (nonatomic, strong) UIView *customView; +- (void)alignCustomViewToCenterOfWindow; @end // uYouPlus @@ -153,9 +130,6 @@ @property(readonly, nonatomic) long long pageStyle; @end -@interface YTNavigationBarTitleView : UIView -@end - @interface YTChipCloudCell : UIView @end @@ -195,17 +169,16 @@ // Buttons @interface YTRightNavigationButtons : UIView - (id)_viewControllerForAncestor; -@property(readonly, nonatomic) YTQTMButton *searchButton; -@property(readonly, nonatomic) YTQTMButton *notificationButton; -@property(strong, nonatomic) YTQTMButton *sponsorBlockButton; -@property(strong, nonatomic) YTQTMButton *uYouPlusButton; +@property (readonly, nonatomic) NSArray *dynamicButtons; +@property (readonly, nonatomic) NSArray *visibleButtons; +@property (readonly, nonatomic) NSArray *buttons; +@property (readonly, nonatomic) YTQTMButton *searchButton; +@property (readonly, nonatomic) YTQTMButton *notificationButton; +@property (strong, nonatomic) YTQTMButton *sponsorBlockButton; +@property (strong, nonatomic) YTQTMButton *settingsButton; +- (void)setDynamicButtons:(NSArray *)buttons; - (void)setLeadingPadding:(CGFloat)arg1; -- (void)uYouPlusRootOptionsAction; -@end - -@interface YTISlimMetadataButtonSupportedRenderers : NSObject -- (id)slimButton_buttonRenderer; -- (id)slimMetadataButtonRenderer; +- (void)settingsAction; @end // YTSpeed @@ -220,9 +193,7 @@ - (void)internalSetRate; @end -@interface MLPlayerStickySettings (uYouPlus) -- (void)setRate:(float)rate; -@end +// MLPlayerStickySettings Header has been moved to https://github.com/arichornloverALT/YouTubeHeader/blob/main/MLPlayerStickySettings.h @interface MLPlayerEventCenter : NSObject - (void)broadcastRateChange:(float)rate; diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 6ccf1dc..bd9f160 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -53,6 +53,23 @@ NSBundle *tweakBundle = uYouPlusBundle(); } %end +// Fix App Group Directory by move it to document directory +%hook NSFileManager +- (NSURL *)containerURLForSecurityApplicationGroupIdentifier:(NSString *)groupIdentifier { + if (groupIdentifier != nil) { + NSArray *paths = [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask]; + NSURL *documentsURL = [paths lastObject]; + return [documentsURL URLByAppendingPathComponent:@"AppGroup"]; + } + return %orig(groupIdentifier); +} +%end + +// Remove App Rating Prompt in YouTube (for Sideloaded - iOS 14+) - @arichornlover +%hook SKStoreReviewController ++ (void)requestReview { } +%end + // Enable Alternate Icons - @arichornlover %hook UIApplication - (BOOL)supportsAlternateIcons { @@ -130,6 +147,8 @@ NSBundle *tweakBundle = uYouPlusBundle(); } %end NSString *getAdString(NSString *description) { + if ([description containsString:@"ad_layout"]) + return @"ad_layout"; if ([description containsString:@"brand_promo"]) return @"brand_promo"; if ([description containsString:@"carousel_footered_layout"]) @@ -176,12 +195,12 @@ static __strong NSData *cellDividerData; } if (!cellDividerData) return %orig; if ([self respondsToSelector:@selector(hasCompatibilityOptions)] && self.hasCompatibilityOptions && self.compatibilityOptions.hasAdLoggingData) { - // HBLogInfo(@"YTX adLogging 1 %@", cellDividerData); + HBLogDebug(@"YTX adLogging 1 %@", cellDividerData); return cellDividerData; } NSString *adString = getAdString(description); if (adString) { - // HBLogInfo(@"YTX getAdString 1 %@ %@", adString, cellDividerData); + HBLogDebug(@"YTX getAdString 1 %@ %@", adString, cellDividerData); return cellDividerData; } return %orig; @@ -198,13 +217,13 @@ static __strong NSData *cellDividerData; YTIItemSectionSupportedRenderers *firstObject = [sectionRenderer.contentsArray firstObject]; YTIElementRenderer *elementRenderer = firstObject.elementRenderer; if ([elementRenderer respondsToSelector:@selector(hasCompatibilityOptions)] && elementRenderer.hasCompatibilityOptions && elementRenderer.compatibilityOptions.hasAdLoggingData) { - // HBLogInfo(@"YTX adLogging 2 %@", elementRenderer); + HBLogDebug(@"YTX adLogging 2 %@", elementRenderer); return YES; } NSString *description = [elementRenderer description]; NSString *adString = getAdString(description); if (adString) { - // HBLogInfo(@"YTX getAdString 2 %@ %@", adString, elementRenderer); + HBLogDebug(@"YTX getAdString 2 %@ %@", adString, elementRenderer); return YES; } return NO; @@ -233,36 +252,27 @@ static __strong NSData *cellDividerData; %end %end -%group gCenterYouTubeLogo +// Center YouTube Logo - @arichornlover +%group gCenterYouTubeLogo %hook YTNavigationBarTitleView - (void)setShouldCenterNavBarTitleView:(BOOL)center { - %orig(YES); + %orig(center); + if (center) { + [self alignCustomViewToCenterOfWindow]; + } } - (BOOL)shouldCenterNavBarTitleView { return YES; } +%new; - (void)alignCustomViewToCenterOfWindow { + CGRect frame = self.customView.frame; + frame.origin.x = (self.window.frame.size.width - frame.size.width) / 2; + self.customView.frame = frame; } %end %end -// Fix App Group Directory by move it to document directory -%hook NSFileManager -- (NSURL *)containerURLForSecurityApplicationGroupIdentifier:(NSString *)groupIdentifier { - if (groupIdentifier != nil) { - NSArray *paths = [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask]; - NSURL *documentsURL = [paths lastObject]; - return [documentsURL URLByAppendingPathComponent:@"AppGroup"]; - } - return %orig(groupIdentifier); -} -%end - -// Remove App Rating Prompt in YouTube (for Sideloaded - iOS 14+) - @arichornlover -%hook SKStoreReviewController -+ (void)requestReview { } -%end - // YTMiniPlayerEnabler: https://github.com/level3tjg/YTMiniplayerEnabler/ %hook YTWatchMiniBarViewController - (void)updateMiniBarPlayerStateFromRenderer { @@ -301,7 +311,7 @@ static __strong NSData *cellDividerData; - (BOOL)enableModularPlayerBarController { return NO; } // fixes some of the iSponorBlock problems - (BOOL)mainAppCoreClientEnableCairoSettings { return IS_ENABLED(@"newSettingsUI_enabled"); } // New grouped settings UI - (BOOL)enableIosFloatingMiniplayer { return IS_ENABLED(@"floatingMiniplayer_enabled"); } // Floating Miniplayer -- (BOOL)enableIosFloatingMiniplayerSwipeUpToExpand { return IS_ENABLED(@"floatingMiniplayer_enabled"); } // Floating Miniplayer - Fix Swipe Up Animation +- (BOOL)enableIosFloatingMiniplayerSwipeUpToExpand { return IS_ENABLED(@"floatingMiniplayer_enabled"); } // Floating Miniplayer - (BOOL)enableIosFloatingMiniplayerRepositioning { return IS_ENABLED(@"floatingMiniplayer2_enabled"); } // Floating Miniplayer (Repositioning Support, Removes Swiping Up Gesture) %end @@ -578,7 +588,7 @@ static __strong NSData *cellDividerData; } %end -// Classic Video Player - 17.33.2+ (Restores the functionality from the YT v16.xx.x Video Player) - @arichornlover +// Classic Video Player (Restores the v16.xx.x Video Player Functionality) - @arichornlover // To-do: disabling "Precise Video Scrubbing" https://9to5google.com/2022/06/29/youtube-precise-video-scrubbing/ %group gClassicVideoPlayer %hook YTColdConfig @@ -766,7 +776,7 @@ static int contrastMode() { %end // YTTapToSeek - https://github.com/bhackel/YTTapToSeek -%group YTTTS_Tweak +%group gYTTapToSeek %hook YTInlinePlayerBarContainerView - (void)didPressScrubber:(id)arg1 { %orig; @@ -851,6 +861,17 @@ static int contrastMode() { %end %end +// Fullscreen to the Right (iPhone-exclusive) - @arichornlover & @bhackel +// WARNING: Please turn off the “Portrait Fullscreen” and "iPad Layout" Options while the option "Fullscreen to the Right" is enabled below. +%group gFullscreenToTheRight +%hook YTWatchViewController +- (UIInterfaceOrientationMask)allowedFullScreenOrientations { + UIInterfaceOrientationMask orientations = UIInterfaceOrientationMaskLandscapeRight; + return orientations; +} +%end +%end + // Disable Double tap to skip chapter - @bhackel %hook YTDoubleTapToSeekController - (void)didTwoFingerDoubleTap:(id)arg1 { @@ -968,7 +989,7 @@ static int contrastMode() { %hook YTWatchPullToFullController - (BOOL)shouldRecognizeOverscrollEventsFromWatchOverscrollController:(id)arg1 { // Get the current player orientation - YTWatchViewController *watchViewController = self.playerViewSource; + YTWatchViewController *watchViewController = (YTWatchViewController *)self.playerViewSource; NSUInteger allowedFullScreenOrientations = [watchViewController allowedFullScreenOrientations]; // Check if the current player orientation is portrait if (allowedFullScreenOrientations == UIInterfaceOrientationMaskAllButUpsideDown @@ -1067,7 +1088,16 @@ static int contrastMode() { - (BOOL)fullscreenButtonDisabled { return YES; } - (BOOL)canShowFullscreenButton { return NO; } - (BOOL)canShowFullscreenButtonExperimental { return NO; } -// - (void)setFullscreenButtonDisabled:(BOOL) // Uncomment and might implement this if needed - @arichornlover +// - (void)setFullscreenButtonDisabled:(BOOL) // Might implement this if useful - @arichornlover +- (void)layoutSubviews { + %orig; + if (self.exitFullscreenButton && !self.exitFullscreenButton.hidden) { + self.exitFullscreenButton.hidden = YES; + } + if (self.enterFullscreenButton && !self.enterFullscreenButton.hidden) { + self.enterFullscreenButton.hidden = YES; + } +} %end %end @@ -1084,7 +1114,6 @@ static int contrastMode() { return IS_ENABLED(@"hideChannelWatermark_enabled") ? NO : %orig; } %end -// Hide Channel Watermark (for Backwards Compatibility) %hook YTAnnotationsViewController - (void)loadFeaturedChannelWatermark { if (IS_ENABLED(@"hideChannelWatermark_enabled")) {} @@ -1136,7 +1165,7 @@ static int contrastMode() { %end %end -// Hide Video Title (in Fullscreen) - @arichornlover +// Hide Video Title when in Fullscreen - @arichornlover %hook YTMainAppControlsOverlayView - (BOOL)titleViewHidden { return IS_ENABLED(@"hideVideoTitle_enabled") ? YES : %orig; @@ -1334,7 +1363,7 @@ static int contrastMode() { static BOOL findCell(ASNodeController *nodeController, NSArray *identifiers) { for (id child in [nodeController children]) { if ([child isKindOfClass:%c(ELMNodeController)]) { - NSArray *elmChildren = [(ELMNodeController *)child children]; + NSArray *elmChildren = [(ELMNodeController * _Nullable)child children]; for (ELMComponent *elmChild in elmChildren) { for (NSString *identifier in identifiers) { if ([[elmChild description] containsString:identifier]) @@ -1344,8 +1373,8 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide } if ([child isKindOfClass:%c(ASNodeController)]) { - ASDisplayNode *childNode = ((ASNodeController *)child).node; // ELMContainerNode - NSArray *yogaChildren = childNode.yogaChildren; + ASDisplayNode *childNode = ((ASNodeController * _Nullable)child).node; // ELMContainerNode + NSArray *yogaChildren = childNode.yogaChildren; for (ASDisplayNode *displayNode in yogaChildren) { if ([identifiers containsObject:displayNode.accessibilityIdentifier]) return YES; @@ -1361,7 +1390,7 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide %hook ASCollectionView // This stopped working on May 14th 2024 due to a Server-Side Change from YouTube. -- (CGSize)sizeForElement:(ASCollectionElement *)element { +- (CGSize)sizeForElement:(ASCollectionElement * _Nullable)element { if ([self.accessibilityIdentifier isEqualToString:@"id.video.scrollable_action_bar"]) { ASCellNode *node = [element node]; ASNodeController *nodeController = [node controller]; @@ -1570,7 +1599,7 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide %end %end -// Hide Videos in Fullscreen - @arichornlover +// Hide Videos when in Fullscreen - @arichornlover %group gNoVideosInFullscreen %hook YTFullScreenEngagementOverlayView - (void)setRelatedVideosView:(id)view { @@ -1594,9 +1623,9 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide // iPhone Layout - @LillieH1000 & @arichornlover %group giPhoneLayout %hook UIDevice -- (long long)userInterfaceIdiom { - return NO; -} +- (UIUserInterfaceIdiom)userInterfaceIdiom { + return UIUserInterfaceIdiomPhone; +} %end %hook UIStatusBarStyleAttributes - (long long)idiom { @@ -1605,12 +1634,20 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide %end %hook UIKBTree - (long long)nativeIdiom { - return YES; + if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) { + return NO; + } else { + return YES; + } } %end %hook UIKBRenderer - (long long)assetIdiom { - return NO; + if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) { + return NO; + } else { + return YES; + } } %end %end @@ -1676,6 +1713,9 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide if (IS_ENABLED(@"portraitFullscreen_enabled")) { %init(gPortraitFullscreen); } + if (IS_ENABLED(@"fullscreenToTheRight_enabled")) { + %init(gFullscreenToTheRight); + } if (IS_ENABLED(@"disableFullscreenButton_enabled")) { %init(gHideFullscreenButton); } @@ -1743,7 +1783,7 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide %init(gDisableLiveChatSection); } if (IS_ENABLED(@"YTTapToSeek_enabled")) { - %init(YTTTS_Tweak); + %init(gYTTapToSeek); } if (IS_ENABLED(@"hidePremiumPromos_enabled")) { %init(gHidePremiumPromos); diff --git a/Sources/uYouPlusPatches.h b/Sources/uYouPlusPatches.h index 6dcac73..0e65c38 100644 --- a/Sources/uYouPlusPatches.h +++ b/Sources/uYouPlusPatches.h @@ -1,5 +1,6 @@ #import #import +#import #import #import #import "Tweaks/protobuf/objectivec/GPBDescriptor.h" @@ -75,6 +76,14 @@ @property (nonatomic, assign, readwrite) BOOL hasOnAppear; @end +@interface ELMContext : NSObject +@property (nonatomic, strong, readwrite) UIView *fromView; +@end + +@interface ELMCommandContext : NSObject +@property (nonatomic, strong, readwrite) ELMContext *context; +@end + @interface YTIUpdateShareSheetCommand @property (nonatomic, assign, readwrite) BOOL hasSerializedShareEntity; @property (nonatomic, copy, readwrite) NSString *serializedShareEntity; @@ -85,6 +94,11 @@ + (GPBExtensionDescriptor*)innertubeCommand; @end +@interface YTAccountScopedCommandResponderEvent +@property (nonatomic, strong, readwrite) YTICommand *command; +@property (nonatomic, strong, readwrite) UIView *fromView; +@end + @interface YTIShareEntityEndpoint @property (nonatomic, assign, readwrite) BOOL hasSerializedShareEntity; @property (nonatomic, copy, readwrite) NSString *serializedShareEntity; diff --git a/Sources/uYouPlusPatches.xm b/Sources/uYouPlusPatches.xm index 7430664..7540250 100644 --- a/Sources/uYouPlusPatches.xm +++ b/Sources/uYouPlusPatches.xm @@ -2,6 +2,7 @@ # pragma mark - YouTube patches +/* // Fix Google Sign in by @PoomSmart and @level3tjg (qnblackcat/uYouPlus#684) %hook NSBundle - (NSDictionary *)infoDictionary { @@ -11,6 +12,17 @@ return info; } %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; } @@ -98,8 +110,7 @@ static inline NSString* extractIdWithFormat(GPBUnknownFieldSet *fields, NSIntege NSString *id = [[NSString alloc] initWithData:[idField.lengthDelimitedList firstObject] encoding:NSUTF8StringEncoding]; return [NSString stringWithFormat:format, id]; } - -static BOOL showNativeShareSheet(NSString *serializedShareEntity) { +static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *sourceView) { GPBMessage *shareEntity = [%c(GPBMessage) deserializeFromString:serializedShareEntity]; GPBUnknownFieldSet *fields = shareEntity.unknownFields; NSString *shareUrl; @@ -107,7 +118,7 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity) { if ([fields hasField:ShareEntityFieldClip]) { GPBUnknownField *shareEntityClip = [fields getField:ShareEntityFieldClip]; if ([shareEntityClip.lengthDelimitedList count] != 1) - return FALSE; + return NO; GPBMessage *clipMessage = [%c(GPBMessage) parseFromData:[shareEntityClip.lengthDelimitedList firstObject] error:nil]; shareUrl = extractIdWithFormat(clipMessage.unknownFields, 1, @"https://youtube.com/clip/%@"); } @@ -128,47 +139,42 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity) { shareUrl = extractIdWithFormat(fields, ShareEntityFieldVideo, @"https://youtube.com/watch?v=%@"); if (!shareUrl) - return FALSE; + return NO; - UIActivityViewController *activityViewController = [[UIActivityViewController alloc]initWithActivityItems:@[shareUrl] applicationActivities:nil]; - [[%c(YTUIUtils) topViewControllerForPresenting] presentViewController:activityViewController animated:YES completion:^{}]; - return TRUE; + UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[shareUrl] applicationActivities:nil]; + activityViewController.excludedActivityTypes = @[UIActivityTypeAssignToContact, UIActivityTypePrint]; + + UIViewController *topViewController = [%c(YTUIUtils) topViewControllerForPresenting]; + + if (activityViewController.popoverPresentationController) { + activityViewController.popoverPresentationController.sourceView = topViewController.view; + activityViewController.popoverPresentationController.sourceRect = [sourceView convertRect:sourceView.bounds toView:topViewController.view]; + } + + [topViewController presentViewController:activityViewController animated:YES completion:nil]; + + return YES; } - /* -------------------- iPad Layout -------------------- */ -/* -%hook YTShareRequestViewController -- (id)initWithService:(id)_service parentResponder:(id)_parentResponder { - 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 -*/ - -%hook YTAccountScopedCommandRouter -- (BOOL)handleCommand:(id)command entry:(id)_entry fromView:(id)_fromView sender:(id)_sender completionBlock:(id)_completionBlock { +%hook YTAccountScopedCommandResponderEvent +- (void)send { GPBExtensionDescriptor *shareEntityEndpointDescriptor = [%c(YTIShareEntityEndpoint) shareEntityEndpoint]; - if (![command hasExtension:shareEntityEndpointDescriptor]) + if (![self.command hasExtension:shareEntityEndpointDescriptor]) return %orig; - YTIShareEntityEndpoint *shareEntityEndpoint = [command getExtension:shareEntityEndpointDescriptor]; - if(!shareEntityEndpoint.hasSerializedShareEntity) + YTIShareEntityEndpoint *shareEntityEndpoint = [self.command getExtension:shareEntityEndpointDescriptor]; + if (!shareEntityEndpoint.hasSerializedShareEntity) return %orig; - if (!showNativeShareSheet(shareEntityEndpoint.serializedShareEntity)) + if (!showNativeShareSheet(shareEntityEndpoint.serializedShareEntity, self.fromView)) return %orig; - return TRUE; } %end /* ------------------- iPhone Layout ------------------- */ %hook ELMPBShowActionSheetCommand -- (void)executeWithCommandContext:(id)_context handler:(id)_handler { +- (void)executeWithCommandContext:(ELMCommandContext*)context handler:(id)_handler { if (!self.hasOnAppear) return %orig; GPBExtensionDescriptor *innertubeCommandDescriptor = [%c(YTIInnertubeCommandExtensionRoot) innertubeCommand]; @@ -181,11 +187,13 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity) { YTIUpdateShareSheetCommand *updateShareSheetCommand = [innertubeCommand getExtension:updateShareSheetCommandDescriptor]; if (!updateShareSheetCommand.hasSerializedShareEntity) return %orig; - if (!showNativeShareSheet(updateShareSheetCommand.serializedShareEntity)) + if (!showNativeShareSheet(updateShareSheetCommand.serializedShareEntity, context.context.fromView)) return %orig; } %end +// + // iOS 16 uYou crash fix - @level3tjg: https://github.com/qnblackcat/uYouPlus/pull/224 // %group iOS16 // %hook OBPrivacyLinkButton @@ -340,7 +348,4 @@ 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"]; } diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index 0c985e0..76dd5c5 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -470,7 +470,7 @@ extern NSBundle *uYouPlusBundle(); LOC(@"HIDE_FULLSCREEN_ACTION_BUTTONS_DESC"), @"hideFullscreenActions_enabled", ({ - if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { // Show alert if the option is not compatible with iPad UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"iPad Compatibility Issue" message:@"This option is only compatible with iPhone devices." preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]; diff --git a/Sources/update-submodules-template.txt b/Sources/update-submodules-template.txt index 217789e..5b6e316 100644 --- a/Sources/update-submodules-template.txt +++ b/Sources/update-submodules-template.txt @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4.1.4 + uses: actions/checkout@v4.1.7 - name: Set up Git run: | @@ -20,11 +20,11 @@ jobs: - name: Add uYouEnhanced submodules run: | -# git submodule add https://github.com/PoomSmart/FLEXing.git Tweaks/FLEXing git submodule add https://github.com/dayanch96/uYouLocalization.git Tweaks/uYouLocalization - git submodule add https://github.com/arichornlover/YTHoldForSpeed.git Tweaks/YTHoldForSpeed - git submodule add https://github.com/arichornlover/YouGroupSettings.git Tweaks/YouGroupSettings - git submodule add https://github.com/arichornlover/YouTimeStamp.git Tweaks/YouTimeStamp + git submodule add https://github.com/arichornloverALT/YTHoldForSpeed.git Tweaks/YTHoldForSpeed + git submodule add https://github.com/arichornloverALT/YouGroupSettings.git Tweaks/YouGroupSettings + git submodule add https://github.com/arichornloverALT/YouTimeStamp.git Tweaks/YouTimeStamp + git submodule add https://github.com/protocolbuffers/protobuf.git Tweaks/protobuf git add . git commit -m "added uYouEnhanced submodules" git push origin @@ -84,7 +84,6 @@ jobs: - name: Make .bundle files run: | cd Bundles - ln -s ../Tweaks/MrBeastify/layout/Library/Application\ Support/MrBeastify.bundle MrBeastify.bundle ln -s ../Tweaks/uYouLocalization/layout/Library/Application\ Support/uYouLocalization.bundle uYouLocalization.bundle ln -s ../Tweaks/YTHoldForSpeed/layout/Library/Application\ Support/YTHoldForSpeed.bundle YTHoldForSpeed.bundle ln -s ../Tweaks/YouGroupSettings/layout/Library/Application\ Support/YouGroupSettings.bundle YouGroupSettings.bundle @@ -98,7 +97,6 @@ jobs: # - name: Delete .bundle files # run: | # cd Bundles -# rm -f MrBeastify.bundle # rm -f uYouLocalization.bundle # rm -f YTHoldForSpeed.bundle # rm -f YouGroupSettings.bundle