From 5ee37a88cfdfcc6a43969a67e950e829f600ef53 Mon Sep 17 00:00:00 2001 From: aricloverEXTRA <157071384+aricloverEXTRA@users.noreply.github.com> Date: Thu, 26 Feb 2026 16:23:04 -0600 Subject: [PATCH] Update uYouPlusPatches.xm --- Sources/uYouPlusPatches.xm | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/Sources/uYouPlusPatches.xm b/Sources/uYouPlusPatches.xm index ab572a7..f9aa795 100644 --- a/Sources/uYouPlusPatches.xm +++ b/Sources/uYouPlusPatches.xm @@ -1,20 +1,39 @@ #import "uYouPlusPatches.h" +#define YT_BUNDLE_ID @"com.google.ios.youtube" +#define YT_NAME @"YouTube" + # pragma mark - YouTube patches // Fix Google Sign in Patch %group gGoogleSignInPatch %hook NSBundle ++ (NSBundle *)bundleWithIdentifier:(NSString *)identifier { + if ([identifier isEqualToString:YT_BUNDLE_ID]) + return NSBundle.mainBundle; + return %orig(identifier); +} +- (NSString *)bundleIdentifier { + return [self isEqual:NSBundle.mainBundle] ? YT_BUNDLE_ID : %orig; +} - (NSDictionary *)infoDictionary { - NSDictionary *orig = %orig; - if ([self isEqual:NSBundle.mainBundle]) { - NSMutableDictionary *patched = [orig mutableCopy]; - if (patched) { - patched[@"CFBundleIdentifier"] = @"com.google.ios.youtube"; - return [patched copy]; - } - } - return orig; + NSDictionary *dict = %orig; + if (![self isEqual:NSBundle.mainBundle]) + return %orig; + NSMutableDictionary *info = [dict mutableCopy]; + if (info[@"CFBundleIdentifier"]) info[@"CFBundleIdentifier"] = YT_BUNDLE_ID; + if (info[@"CFBundleDisplayName"]) info[@"CFBundleDisplayName"] = YT_NAME; + if (info[@"CFBundleName"]) info[@"CFBundleName"] = YT_NAME; + return info; +} +- (id)objectForInfoDictionaryKey:(NSString *)key { + if (![self isEqual:NSBundle.mainBundle]) + return %orig; + if ([key isEqualToString:@"CFBundleIdentifier"]) + return YT_BUNDLE_ID; + if ([key isEqualToString:@"CFBundleDisplayName"] || [key isEqualToString:@"CFBundleName"]) + return YT_NAME; + return %orig; } %end %end