From c70f454ffb75ef2b043f4aa8efef90560c587919 Mon Sep 17 00:00:00 2001 From: thea <108613931+nyathea@users.noreply.github.com> Date: Sat, 24 Jan 2026 19:14:34 -0600 Subject: [PATCH 1/2] Add UIAlertController dismiss bypass for Endfield jailbreak detection --- PlayTools/MysticRunes/PlayShadow.m | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/PlayTools/MysticRunes/PlayShadow.m b/PlayTools/MysticRunes/PlayShadow.m index 8e2d5160..2dd0001d 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,30 @@ - (NSDictionary *) pm_return_empty_dictionary { return @{}; } +// Endfield UIAlertController hook - adds Dismiss button to all alerts +- (void)pm_endfield_viewDidAppear:(BOOL)animated { + [self pm_endfield_viewDidAppear:animated]; + + UIAlertController *alertController = (UIAlertController *)self; + + // Check if this alert already has a dismiss action + for (UIAlertAction *action in alertController.actions) { + if ([action.title isEqualToString:@"Dismiss"]) { + return; + } + } + + // Add a dismiss button to allow bypassing jailbreak detection alerts + UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:@"Dismiss" + style:UIAlertActionStyleCancel + handler:^(UIAlertAction * _Nonnull action) { + [alertController dismissViewControllerAnimated:YES completion:nil]; + }]; + [alertController addAction:dismissAction]; + + NSLog(@"PC-DEBUG: [PlayShadow] Added Dismiss button to UIAlertController for Endfield"); +} + // Class methods + (void) pm_return_2_with_completion_handler:(void (^)(NSInteger))completionHandler { @@ -171,6 +196,13 @@ + (void) load { // canResizeToFitContent // [objc_getClass("UIWindow") swizzleInstanceMethod:@selector(canResizeToFitContent) withMethod:@selector(pm_return_true)]; + + // Endfield: Add dismiss button to UIAlertController for jailbreak bypass + NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier]; + if ([bundleID isEqualToString:@"com.gryphline.endfield.ios"]) { + [self debugLogger:@"Endfield detected, loading UIAlertController bypass"]; + [objc_getClass("UIAlertController") swizzleInstanceMethod:@selector(viewDidAppear:) withMethod:@selector(pm_endfield_viewDidAppear:)]; + } } + (void) loadJailbreakBypass { From b179b31f4ea87efc570b6aabeb62eb881e111838 Mon Sep 17 00:00:00 2001 From: thea <108613931+nyathea@users.noreply.github.com> Date: Sat, 24 Jan 2026 19:23:27 -0600 Subject: [PATCH 2/2] Block UIAlertController silently instead of adding dismiss button --- PlayTools/MysticRunes/PlayShadow.m | 36 +++++++++++++----------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/PlayTools/MysticRunes/PlayShadow.m b/PlayTools/MysticRunes/PlayShadow.m index 2dd0001d..0761e5df 100644 --- a/PlayTools/MysticRunes/PlayShadow.m +++ b/PlayTools/MysticRunes/PlayShadow.m @@ -117,28 +117,22 @@ - (NSDictionary *) pm_return_empty_dictionary { return @{}; } -// Endfield UIAlertController hook - adds Dismiss button to all alerts -- (void)pm_endfield_viewDidAppear:(BOOL)animated { - [self pm_endfield_viewDidAppear:animated]; - - UIAlertController *alertController = (UIAlertController *)self; - - // Check if this alert already has a dismiss action - for (UIAlertAction *action in alertController.actions) { - if ([action.title isEqualToString:@"Dismiss"]) { - 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; } - // Add a dismiss button to allow bypassing jailbreak detection alerts - UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:@"Dismiss" - style:UIAlertActionStyleCancel - handler:^(UIAlertAction * _Nonnull action) { - [alertController dismissViewControllerAnimated:YES completion:nil]; - }]; - [alertController addAction:dismissAction]; - - NSLog(@"PC-DEBUG: [PlayShadow] Added Dismiss button to UIAlertController for Endfield"); + // Otherwise, present normally + [self pm_endfield_presentViewController:viewControllerToPresent animated:flag completion:completion]; } // Class methods @@ -197,11 +191,11 @@ + (void) load { // canResizeToFitContent // [objc_getClass("UIWindow") swizzleInstanceMethod:@selector(canResizeToFitContent) withMethod:@selector(pm_return_true)]; - // Endfield: Add dismiss button to UIAlertController for jailbreak bypass + // 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("UIAlertController") swizzleInstanceMethod:@selector(viewDidAppear:) withMethod:@selector(pm_endfield_viewDidAppear:)]; + [objc_getClass("UIViewController") swizzleInstanceMethod:@selector(presentViewController:animated:completion:) withMethod:@selector(pm_endfield_presentViewController:animated:completion:)]; } }