mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-01-11 22:40:19 +00:00
Fix YouTube Sign-In Patch crashes (uYouPlusPatches.xm)
This fixes only the crashing, not the functionality of the patch for now. Sorry to disappoint.
This commit is contained in:
parent
a178e631c4
commit
6667b2cf9c
1 changed files with 20 additions and 5 deletions
|
|
@ -2,14 +2,29 @@
|
||||||
|
|
||||||
# pragma mark - YouTube patches
|
# pragma mark - YouTube patches
|
||||||
|
|
||||||
// Fix Google Sign in by @PoomSmart and @level3tjg (qnblackcat/uYouPlus#684)
|
// Fix Google Sign in Patch
|
||||||
%group gGoogleSignInPatch
|
%group gGoogleSignInPatch
|
||||||
%hook NSBundle
|
%hook NSBundle
|
||||||
- (NSDictionary *)infoDictionary {
|
- (NSDictionary *)infoDictionary {
|
||||||
NSMutableDictionary *info = %orig.mutableCopy;
|
NSDictionary *orig = %orig;
|
||||||
if ([self isEqual:NSBundle.mainBundle])
|
if ([self isEqual:NSBundle.mainBundle]) {
|
||||||
info[@"CFBundleIdentifier"] = @"com.google.ios.youtube";
|
NSArray<NSString *> *stack = [NSThread callStackSymbols];
|
||||||
return info;
|
BOOL needsSpoof = NO;
|
||||||
|
for (NSString *frame in stack) {
|
||||||
|
if ([frame containsString:@"GIDSignIn"] ||
|
||||||
|
[frame containsString:@"GTMSessionFetcher"] ||
|
||||||
|
[frame containsString:@"GoogleSignIn"]) {
|
||||||
|
needsSpoof = YES;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (needsSpoof) {
|
||||||
|
NSMutableDictionary *patched = [orig mutableCopy];
|
||||||
|
patched[@"CFBundleIdentifier"] = @"com.google.ios.youtube";
|
||||||
|
return [patched copy];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return orig;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
%end
|
%end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue