avltree9798 / isJailbroken

Detect whether iOS device is jailbroken or not | Jailbreak detection for iOS
GNU General Public License v3.0
87 stars 23 forks source link

Undefined symbol: _isSecurityCheckPassed #7

Closed hanifmhd closed 3 years ago

hanifmhd commented 3 years ago

Hi,

Can you help me? i got error Undefined symbol: _isSecurityCheckPassed when building iOS app. All function of JB.m is the same error undefined symbol

isRunningOnMac();
isJb();
isInjectedWithDynamicLibrary();
isSecurityCheckPassed();
isDebugged();
isFromAppStore();
Screen Shot 2021-03-01 at 10 36 57

Here is my code in AppDelegate.m

#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;
}
hanifmhd commented 3 years ago

it is solved, i add manually JB.m in Build Phase -> Compile Sourcecs

Screen Shot 2021-03-01 at 11 18 24