Skip to content

Instantly share code, notes, and snippets.

@PoomSmart
Created August 21, 2022 12:10
Show Gist options
  • Save PoomSmart/ef5b172fd4c5371764e027bea2613f93 to your computer and use it in GitHub Desktop.
Save PoomSmart/ef5b172fd4c5371764e027bea2613f93 to your computer and use it in GitHub Desktop.
Allow sideloaded iOS YouTube app to sign in by removing device_challenge_request from the sign in payload.
// Credit: https://github.com/qnblackcat/uYouPlus/pull/398
%hook SSOService
+ (id)fetcherWithRequest:(NSMutableURLRequest *)request configuration:(id)configuration {
if ([request isKindOfClass:[NSMutableURLRequest class]] && request.HTTPBody) {
NSError *error = nil;
NSMutableDictionary *body = [NSJSONSerialization JSONObjectWithData:request.HTTPBody options:NSJSONReadingMutableContainers error:&error];
if (!error && [body isKindOfClass:[NSMutableDictionary class]]) {
[body removeObjectForKey:@"device_challenge_request"];
request.HTTPBody = [NSJSONSerialization dataWithJSONObject:body options:kNilOptions error:&error];
}
}
return %orig;
}
%end
@dayanch96
Copy link

Latest YouTube (17.33.2) has new bug: it logs out after restarting app

That’s bcs you need the YouTube sideload fix (logging fix)

https://github.com/jawshoeadan/YTSideloadFix

Thanks, but doesn't work

@dobby1970
Copy link

Strange for me it works on the same version you are

@dayanch96
Copy link

Strange for me it works on the same version you are

Works on 17.32.2 w/o it but doesn't affect on 17.33.2

@dobby1970
Copy link

Strange for me it works on the same version you are

Works on 17.32.2 w/o it but doesn't affect on 17.33.2

Just checked it and you are right! Even with this tweak injected it doos not work

@sevenpastzeero
Copy link

Can this be made into a separate tweak/deb?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment