Created
August 1, 2013 05:26
-
-
Save vclwei/6128604 to your computer and use it in GitHub Desktop.
Detect iDevice is JailBroken
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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