diff --git a/PlayTools/MysticRunes/PlayShadow.m b/PlayTools/MysticRunes/PlayShadow.m index 8e2d5160..0761e5df 100644 --- a/PlayTools/MysticRunes/PlayShadow.m +++ b/PlayTools/MysticRunes/PlayShadow.m @@ -7,6 +7,7 @@ #import #import +#import #import __attribute__((visibility("hidden"))) @@ -116,6 +117,24 @@ - (NSDictionary *) pm_return_empty_dictionary { return @{}; } +// Endfield UIAlertController hook - silently blocks all alerts +- (void)pm_endfield_presentViewController:(UIViewController *)viewControllerToPresent + animated:(BOOL)flag + completion:(void (^)(void))completion { + // If it's a UIAlertController, silently ignore it + if ([viewControllerToPresent isKindOfClass:[UIAlertController class]]) { + NSLog(@"PC-DEBUG: [PlayShadow] Blocked UIAlertController for Endfield"); + // Call completion handler if provided so the app doesn't hang + if (completion) { + completion(); + } + return; + } + + // Otherwise, present normally + [self pm_endfield_presentViewController:viewControllerToPresent animated:flag completion:completion]; +} + // Class methods + (void) pm_return_2_with_completion_handler:(void (^)(NSInteger))completionHandler { @@ -171,6 +190,13 @@ + (void) load { // canResizeToFitContent // [objc_getClass("UIWindow") swizzleInstanceMethod:@selector(canResizeToFitContent) withMethod:@selector(pm_return_true)]; + + // Endfield: Block UIAlertController presentation for jailbreak bypass + NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier]; + if ([bundleID isEqualToString:@"com.gryphline.endfield.ios"]) { + [self debugLogger:@"Endfield detected, loading UIAlertController bypass"]; + [objc_getClass("UIViewController") swizzleInstanceMethod:@selector(presentViewController:animated:completion:) withMethod:@selector(pm_endfield_presentViewController:animated:completion:)]; + } } + (void) loadJailbreakBypass {