Skip to content

Instantly share code, notes, and snippets.

@AhmedBafkir
Last active September 24, 2022 08:34
Show Gist options
  • Save AhmedBafkir/0c16b806b3fb233995aa01b93da44f93 to your computer and use it in GitHub Desktop.
Save AhmedBafkir/0c16b806b3fb233995aa01b93da44f93 to your computer and use it in GitHub Desktop.
Fix YouTube sign in for iOS sideloaded > idea by @kkirby
// https://github.com/qnblackcat/uYouPlus/discussions/447#discussioncomment-3672653
%hook SSORPCService
+ (id)URLFromURL:(id)arg1 withAdditionalFragmentParameters:(NSDictionary *)arg2 {
NSURL *orig = %orig;
NSURLComponents *urlComponents = [[NSURLComponents alloc] initWithURL:orig resolvingAgainstBaseURL:NO];
NSMutableArray *newQueryItems = [urlComponents.queryItems mutableCopy];
for (NSURLQueryItem *queryItem in urlComponents.queryItems) {
if ([queryItem.name isEqualToString:@"system_version"]
|| [queryItem.name isEqualToString:@"app_version"]
|| [queryItem.name isEqualToString:@"kdlc"]
|| [queryItem.name isEqualToString:@"kss"]
|| [queryItem.name isEqualToString:@"lib_ver"]
|| [queryItem.name isEqualToString:@"device_model"]) {
[newQueryItems removeObject:queryItem];
}
}
urlComponents.queryItems = [newQueryItems copy];
return urlComponents.URL;
}
%end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment