isRunningOnMac();
isJb();
isInjectedWithDynamicLibrary();
isSecurityCheckPassed();
isDebugged();
isFromAppStore();
#import "JB.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#if DEBUG
InitializeFlipper(application);
#endif
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"ABC"
initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[RNSplashScreen show];
// Jailbreak detection, if it is true, show alert, then exit app
if (!isSecurityCheckPassed()) {
UIAlertController *alertController = [UIAlertController
alertControllerWithTitle:@"Jailbroken device is detected"
message:@"Sorry, you cannot use this app as we have detected that your device has been jailbroken."
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
exit(1);
}];
[alertController addAction:cancelAction];
[self.window.rootViewController presentViewController:alertController animated:YES completion:nil];
}
return YES;
}