From ff774c6e8a0ee92b443032ff168cac16220b91b5 Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Mon, 1 Apr 2024 17:46:17 -0700 Subject: [PATCH] Premium logo without version spoofer --- Sources/uYouPlus.h | 5 +++++ Sources/uYouPlus.xm | 24 +++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Sources/uYouPlus.h b/Sources/uYouPlus.h index d68b568..9e27478 100644 --- a/Sources/uYouPlus.h +++ b/Sources/uYouPlus.h @@ -59,6 +59,11 @@ - (CGFloat)totalTime; @end +// Enable Premium logo - @bhackel +@interface YTITopbarLogoRenderer : NSObject +@property(readonly, nonatomic) YTIIcon *iconImage; +@end + // uYouPlus @interface YTHeaderLogoController : UIView @property(readonly, nonatomic) long long pageStyle; diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 09f5b33..0879beb 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -133,8 +133,29 @@ BOOL isAd(YTIElementRenderer *self) { %end %end -// YouTube Premium Logo - @arichornlover - this doesn't always function. +// YouTube Premium Logo - @arichornlover - this doesn't always function +// Modern implementation - @bhackel %group gPremiumYouTubeLogo +%hook YTHeaderLogoController + - (void)setTopbarLogoRenderer:(id)renderer { + // Modify the type of the icon before setting the renderer + YTITopbarLogoRenderer *logoRenderer = (YTITopbarLogoRenderer *)renderer; + YTIIcon *iconImage = logoRenderer.iconImage; + iconImage.iconType = 537; // magic number for Premium icon, hopefully it doesnt change. 158 is default logo. + // Use this modified renderer + %orig(logoRenderer); + } + // For when spoofing before 18.34.5 + - (void)setPremiumLogo:(BOOL)isPremiumLogo { + isPremiumLogo = YES; + %orig; + } + - (BOOL)isPremiumLogo { + return YES; + } +%end + +/* %hook YTHeaderLogoController - (void)setPremiumLogo:(BOOL)isPremiumLogo { isPremiumLogo = YES; @@ -162,6 +183,7 @@ BOOL isAd(YTIElementRenderer *self) { } %orig(arg1); } %end +*/ %end // Fix App Group Directory by move it to document directory