From ad68078f4fee436837fef6fcb21b78471cef1030 Mon Sep 17 00:00:00 2001 From: "aric3435 (OLD ACCOUNT)" <78001398+arichornlover@users.noreply.github.com> Date: Sat, 21 Sep 2024 19:50:56 -0500 Subject: [PATCH 1/3] Fix YouTube Native Share Fixed by jkhsjdhjs --- Sources/uYouPlusPatches.xm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Sources/uYouPlusPatches.xm b/Sources/uYouPlusPatches.xm index df8935a..0a031f9 100644 --- a/Sources/uYouPlusPatches.xm +++ b/Sources/uYouPlusPatches.xm @@ -102,27 +102,27 @@ typedef NS_ENUM(NSInteger, ShareEntityType) { ShareEntityFieldClip = 8 }; -static inline NSString* extractIdWithFormat(GPBUnknownFieldSet *fields, NSInteger fieldNumber, NSString *format) { - if (![fields hasField:fieldNumber]) +static inline NSString* extractIdWithFormat(GPBUnknownFields *fields, NSInteger fieldNumber, NSString *format) { + NSArray *fieldArray = [fields fields:fieldNumber]; + if (!fieldArray) return nil; - GPBUnknownField *idField = [fields getField:fieldNumber]; - if ([idField.lengthDelimitedList count] != 1) + if ([fieldArray count] != 1) return nil; - NSString *id = [[NSString alloc] initWithData:[idField.lengthDelimitedList firstObject] encoding:NSUTF8StringEncoding]; + NSString *id = [[NSString alloc] initWithData:[fieldArray firstObject].lengthDelimited encoding:NSUTF8StringEncoding]; return [NSString stringWithFormat:format, id]; } static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *sourceView) { GPBMessage *shareEntity = [%c(GPBMessage) deserializeFromString:serializedShareEntity]; - GPBUnknownFieldSet *fields = shareEntity.unknownFields; + GPBUnknownFields *fields = [[%c(GPBUnknownFields) alloc] initFromMessage:shareEntity]; NSString *shareUrl; - if ([fields hasField:ShareEntityFieldClip]) { - GPBUnknownField *shareEntityClip = [fields getField:ShareEntityFieldClip]; - if ([shareEntityClip.lengthDelimitedList count] != 1) + NSArray *shareEntityClip = [fields fields:ShareEntityFieldClip]; + if (shareEntityClip) { + if ([shareEntityClip count] != 1) return NO; - GPBMessage *clipMessage = [%c(GPBMessage) parseFromData:[shareEntityClip.lengthDelimitedList firstObject] error:nil]; - shareUrl = extractIdWithFormat(clipMessage.unknownFields, 1, @"https://youtube.com/clip/%@"); + GPBMessage *clipMessage = [%c(GPBMessage) parseFromData:[shareEntityClip firstObject].lengthDelimited error:nil]; + shareUrl = extractIdWithFormat([[%c(GPBUnknownFields) alloc] initFromMessage:clipMessage], 1, @"https://youtube.com/clip/%@"); } if (!shareUrl) @@ -163,7 +163,7 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *source /* -------------------- iPad Layout -------------------- */ -%group gYouTubeNativeShare // YouTube Native Share Option - 0.2.3 - Supports YouTube v17.33.2-v19.34.2 +// %group gYouTubeNativeShare // YouTube Native Share Option - 0.2.3 - Supports YouTube v17.33.2-v19.34.2 %hook YTAccountScopedCommandResponderEvent - (void)send { GPBExtensionDescriptor *shareEntityEndpointDescriptor = [%c(YTIShareEntityEndpoint) shareEntityEndpoint]; @@ -198,7 +198,7 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *source return %orig; } %end -%end +// %end // From b05ef4e76dd5704efa5b707430c18567e24cb5cd Mon Sep 17 00:00:00 2001 From: "aric3435 (OLD ACCOUNT)" <78001398+arichornlover@users.noreply.github.com> Date: Sat, 21 Sep 2024 21:30:48 -0500 Subject: [PATCH 2/3] Update uYouPlusPatches.xm --- Sources/uYouPlusPatches.xm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/uYouPlusPatches.xm b/Sources/uYouPlusPatches.xm index 0a031f9..a62276a 100644 --- a/Sources/uYouPlusPatches.xm +++ b/Sources/uYouPlusPatches.xm @@ -395,9 +395,11 @@ static void refreshUYouAppearance() { if (IS_ENABLED(@"googleSignInPatch_enabled")) { %init(gGoogleSignInPatch); } +/* if (IS_ENABLED(@"youtubeNativeShare_enabled")) { %init(gYouTubeNativeShare); } +*/ // if (@available(iOS 16, *)) { // %init(iOS16); // } From 14ea4aaae4d17ea39463106859dccb77a08885d2 Mon Sep 17 00:00:00 2001 From: "aric3435 (OLD ACCOUNT)" <78001398+arichornlover@users.noreply.github.com> Date: Sat, 21 Sep 2024 22:48:59 -0500 Subject: [PATCH 3/3] Update uYouPlusPatches.h --- Sources/uYouPlusPatches.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/uYouPlusPatches.h b/Sources/uYouPlusPatches.h index ecf630a..82e2a9f 100644 --- a/Sources/uYouPlusPatches.h +++ b/Sources/uYouPlusPatches.h @@ -6,7 +6,7 @@ #import #import "Tweaks/protobuf/objectivec/GPBDescriptor.h" #import "Tweaks/protobuf/objectivec/GPBUnknownField.h" -#import "Tweaks/protobuf/objectivec/GPBUnknownFieldSet.h" +#import "Tweaks/protobuf/objectivec/GPBUnknownFields.h" #import "uYouPlus.h" @interface PlayerManager : NSObject