Skip to content

Instantly share code, notes, and snippets.

@vclwei
Created August 1, 2013 05:26
Show Gist options
  • Save vclwei/6128604 to your computer and use it in GitHub Desktop.
Save vclwei/6128604 to your computer and use it in GitHub Desktop.
Detect iDevice is JailBroken
@interface UIDevice (Helper)  
- (BOOL)isJailbroken;  
@end
@implementation UIDevice (Helper)  
- (BOOL)isJailbroken {  
  BOOL jailbroken = NO;  
  NSString *cydiaPath = @"/Applications/Cydia.app";  
  NSString *aptPath = @"/private/var/lib/apt/";  
  if ([[NSFileManager defaultManager] fileExistsAtPath:cydiaPath]) {  
    jailbroken = YES;  
  }  
  if ([[NSFileManager defaultManager] fileExistsAtPath:aptPath]) {  
    jailbroken = YES;  
  }  
  return jailbroken;  
}  
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment