Skip to content
Merged
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,23 @@ - (NSDictionary *) pm_return_empty_dictionary {
return @{};
}

// Endfield UIAlertController hook
- (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");
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 +189,14 @@ + (void) load {

// canResizeToFitContent
// [objc_getClass("UIWindow") swizzleInstanceMethod:@selector(canResizeToFitContent) withMethod:@selector(pm_return_true)];

// Block UIAlertController presentation to bypass Endfield jailbreak message
NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier];
if ([bundleID isEqualToString:@"com.gryphline.endfield.ios"] ||
[bundleID isEqualToString:@"com.hypergryph.endfield"]) {
[self debugLogger:@"loading UIAlertController bypass"];
[objc_getClass("UIViewController") swizzleInstanceMethod:@selector(presentViewController:animated:completion:) withMethod:@selector(pm_endfield_presentViewController:animated:completion:)];
}
}

+ (void) loadJailbreakBypass {
Expand Down