检测iphone设备是否越狱


如何查看是否越狱?最简单的方法就是查看你设备上是否多了越狱的目录

detectDevice.h
@interface UIDevice (Helper)  
- (BOOL)isJailbroken;  
@end &n
bsp;
detectDevice.m
@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

然后在

你可能感兴趣的:(检测iphone设备是否越狱)