Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions PlayTools/MysticRunes/PlayShadow.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#import <UIKit/UIKit.h>
#import <PlayTools/PlayTools-Swift.h>

__attribute__((visibility("hidden")))
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down