Update YTLitePlus.xm #433
1 changed files with 74 additions and 0 deletions
|
|
@ -170,6 +170,80 @@ BOOL isSelf() {
|
||||||
%end
|
%end
|
||||||
%end
|
%end
|
||||||
|
|
||||||
|
// Disable YouTube Plus incompatibility warning popup - @bhackel
|
||||||
|
%hook UIViewController
|
||||||
|
|
||||||
|
- (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion {
|
||||||
|
if ([NSStringFromClass([viewControllerToPresent class]) isEqualToString:@"HelperVC"]) {
|
||||||
|
// look for UIWindows of the sus type and hide them
|
||||||
|
NSArray<UIWindow *> *windows = [UIApplication sharedApplication].windows;
|
||||||
|
for (UIWindow *window in windows) {
|
||||||
|
// Check the class name of the window
|
||||||
|
if ([NSStringFromClass([window class]) isEqualToString:@"YTMainWindow"]) {
|
||||||
|
NSLog(@"bhackel Skipping UIWindow with class YTMainWindow: %@", window);
|
||||||
|
window.userInteractionEnabled = YES;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
NSLog(@"bhackel Yeeting UIWindow %@", window);
|
||||||
|
window.hidden = YES;
|
||||||
|
window.userInteractionEnabled = NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%orig(viewControllerToPresent, flag, completion);
|
||||||
|
}
|
||||||
|
|
||||||
|
%end
|
||||||
|
|
||||||
|
|
||||||
|
%hook UIView
|
||||||
|
- (void)willMoveToWindow:(UIWindow *)newWindow {
|
||||||
|
// yeet yeet
|
||||||
|
UIResponder *responder = self;
|
||||||
|
while (responder) {
|
||||||
|
responder = [responder nextResponder];
|
||||||
|
if ([responder isKindOfClass:NSClassFromString(@"HelperVC")]) {
|
||||||
|
// View belongs to HelperVC, now proceed with getting the UIButton
|
||||||
|
NSLog(@"bhackel Found HelperVC (1/5): %@", responder);
|
||||||
|
|
||||||
|
if ([self.subviews count] > 4 && [[self.subviews objectAtIndex:4] isKindOfClass:[UIButton class]]) {
|
||||||
|
NSLog(@"bhackel Found UIButton (2/5): %@", [self.subviews objectAtIndex:4]);
|
||||||
|
UIButton *button = [self.subviews objectAtIndex:4];
|
||||||
|
|
||||||
|
// Access the _targetActions ivar using KVC (Key-Value Coding)
|
||||||
|
NSArray *targetActions = [button valueForKey:@"_targetActions"];
|
||||||
|
|
||||||
|
if ([targetActions count] > 0) {
|
||||||
|
NSLog(@"bhackel Found targetActions (3/5): %@", targetActions);
|
||||||
|
id controlTargetAction = [targetActions objectAtIndex:0];
|
||||||
|
|
||||||
|
// Use KVC to get the _actionHandler (which is of type UIAction)
|
||||||
|
UIAction *actionHandler = [controlTargetAction valueForKey:@"_actionHandler"];
|
||||||
|
|
||||||
|
if (actionHandler && [actionHandler isKindOfClass:[UIAction class]]) {
|
||||||
|
NSLog(@"bhackel Found actionHandler (4/5): %@", actionHandler);
|
||||||
|
// Access the handler property of UIAction
|
||||||
|
void (^handlerBlock)(void) = [actionHandler valueForKey:@"handler"];
|
||||||
|
|
||||||
|
// Invoke the handler block
|
||||||
|
if (handlerBlock) {
|
||||||
|
NSLog(@"bhackel Found handlerBlock (5/5): %@", handlerBlock);
|
||||||
|
handlerBlock(); // Call the block
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prevent the view from being added to the window
|
||||||
|
[self removeFromSuperview];
|
||||||
|
return; // Exit early to prevent further processing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%orig(newWindow); // Call the original method if the view doesn't belong to HelperVC
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
// A/B flags
|
// A/B flags
|
||||||
%hook YTColdConfig
|
%hook YTColdConfig
|
||||||
- (BOOL)respectDeviceCaptionSetting { return NO; } // YouRememberCaption: https://poomsmart.github.io/repo/depictions/youremembercaption.html
|
- (BOOL)respectDeviceCaptionSetting { return NO; } // YouRememberCaption: https://poomsmart.github.io/repo/depictions/youremembercaption.html
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue