mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-21 16:02:00 +00:00
Update YouTube-native-share to 0.2.3 & re-added Google Sign In Fix
This commit is contained in:
parent
6300fd4cac
commit
d16a0ec73d
1 changed files with 13 additions and 5 deletions
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
# pragma mark - YouTube patches
|
# pragma mark - YouTube patches
|
||||||
|
|
||||||
/*
|
|
||||||
// Fix Google Sign in by @PoomSmart and @level3tjg (qnblackcat/uYouPlus#684)
|
// Fix Google Sign in by @PoomSmart and @level3tjg (qnblackcat/uYouPlus#684)
|
||||||
|
%group gGoogleSignInPatch
|
||||||
%hook NSBundle
|
%hook NSBundle
|
||||||
- (NSDictionary *)infoDictionary {
|
- (NSDictionary *)infoDictionary {
|
||||||
NSMutableDictionary *info = %orig.mutableCopy;
|
NSMutableDictionary *info = %orig.mutableCopy;
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
*/
|
%end
|
||||||
|
|
||||||
// Workaround for MiRO92/uYou-for-YouTube#12, qnblackcat/uYouPlus#263
|
// Workaround for MiRO92/uYou-for-YouTube#12, qnblackcat/uYouPlus#263
|
||||||
%hook YTDataUtils
|
%hook YTDataUtils
|
||||||
|
|
@ -98,6 +98,7 @@ typedef NS_ENUM(NSInteger, ShareEntityType) {
|
||||||
ShareEntityFieldVideo = 1,
|
ShareEntityFieldVideo = 1,
|
||||||
ShareEntityFieldPlaylist = 2,
|
ShareEntityFieldPlaylist = 2,
|
||||||
ShareEntityFieldChannel = 3,
|
ShareEntityFieldChannel = 3,
|
||||||
|
ShareEntityFieldPost = 6,
|
||||||
ShareEntityFieldClip = 8
|
ShareEntityFieldClip = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -110,6 +111,7 @@ static inline NSString* extractIdWithFormat(GPBUnknownFieldSet *fields, NSIntege
|
||||||
NSString *id = [[NSString alloc] initWithData:[idField.lengthDelimitedList firstObject] encoding:NSUTF8StringEncoding];
|
NSString *id = [[NSString alloc] initWithData:[idField.lengthDelimitedList firstObject] encoding:NSUTF8StringEncoding];
|
||||||
return [NSString stringWithFormat:format, id];
|
return [NSString stringWithFormat:format, id];
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *sourceView) {
|
static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *sourceView) {
|
||||||
GPBMessage *shareEntity = [%c(GPBMessage) deserializeFromString:serializedShareEntity];
|
GPBMessage *shareEntity = [%c(GPBMessage) deserializeFromString:serializedShareEntity];
|
||||||
GPBUnknownFieldSet *fields = shareEntity.unknownFields;
|
GPBUnknownFieldSet *fields = shareEntity.unknownFields;
|
||||||
|
|
@ -138,6 +140,9 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *source
|
||||||
if (!shareUrl)
|
if (!shareUrl)
|
||||||
shareUrl = extractIdWithFormat(fields, ShareEntityFieldVideo, @"https://youtube.com/watch?v=%@");
|
shareUrl = extractIdWithFormat(fields, ShareEntityFieldVideo, @"https://youtube.com/watch?v=%@");
|
||||||
|
|
||||||
|
if (!shareUrl)
|
||||||
|
shareUrl = extractIdWithFormat(fields, ShareEntityFieldPost, @"https://youtube.com/post/%@");
|
||||||
|
|
||||||
if (!shareUrl)
|
if (!shareUrl)
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
|
|
@ -166,7 +171,7 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *source
|
||||||
YTIShareEntityEndpoint *shareEntityEndpoint = [self.command getExtension:shareEntityEndpointDescriptor];
|
YTIShareEntityEndpoint *shareEntityEndpoint = [self.command getExtension:shareEntityEndpointDescriptor];
|
||||||
if (!shareEntityEndpoint.hasSerializedShareEntity)
|
if (!shareEntityEndpoint.hasSerializedShareEntity)
|
||||||
return %orig;
|
return %orig;
|
||||||
if (!showNativeShareSheet(shareEntityEndpoint.serializedShareEntity, self.fromView))
|
if (!showNativeShareSheet(shareEntityEndpoint.serializedShareEntity))
|
||||||
return %orig;
|
return %orig;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
@ -174,7 +179,7 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *source
|
||||||
/* ------------------- iPhone Layout ------------------- */
|
/* ------------------- iPhone Layout ------------------- */
|
||||||
|
|
||||||
%hook ELMPBShowActionSheetCommand
|
%hook ELMPBShowActionSheetCommand
|
||||||
- (void)executeWithCommandContext:(ELMCommandContext*)context handler:(id)_handler {
|
- (void)executeWithCommandContext:(id)_context handler:(id)_handler {
|
||||||
if (!self.hasOnAppear)
|
if (!self.hasOnAppear)
|
||||||
return %orig;
|
return %orig;
|
||||||
GPBExtensionDescriptor *innertubeCommandDescriptor = [%c(YTIInnertubeCommandExtensionRoot) innertubeCommand];
|
GPBExtensionDescriptor *innertubeCommandDescriptor = [%c(YTIInnertubeCommandExtensionRoot) innertubeCommand];
|
||||||
|
|
@ -187,7 +192,7 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *source
|
||||||
YTIUpdateShareSheetCommand *updateShareSheetCommand = [innertubeCommand getExtension:updateShareSheetCommandDescriptor];
|
YTIUpdateShareSheetCommand *updateShareSheetCommand = [innertubeCommand getExtension:updateShareSheetCommandDescriptor];
|
||||||
if (!updateShareSheetCommand.hasSerializedShareEntity)
|
if (!updateShareSheetCommand.hasSerializedShareEntity)
|
||||||
return %orig;
|
return %orig;
|
||||||
if (!showNativeShareSheet(updateShareSheetCommand.serializedShareEntity, context.context.fromView))
|
if (!showNativeShareSheet(updateShareSheetCommand.serializedShareEntity))
|
||||||
return %orig;
|
return %orig;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
@ -331,6 +336,9 @@ static void refreshUYouAppearance() {
|
||||||
|
|
||||||
%ctor {
|
%ctor {
|
||||||
%init;
|
%init;
|
||||||
|
if (IS_ENABLED(@"googleSignInPatch_enabled")) {
|
||||||
|
%init(gGoogleSignInPatch);
|
||||||
|
}
|
||||||
// if (@available(iOS 16, *)) {
|
// if (@available(iOS 16, *)) {
|
||||||
// %init(iOS16);
|
// %init(iOS16);
|
||||||
// }
|
// }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue