标签:blog io ar os sp on div log bs
+ (BOOL) hasCydia{
return [[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/Cydia.app"];
}
+ (BOOL) hasAPT
{
return [[NSFileManager defaultManager] fileExistsAtPath:@"/private/var/lib/apt/"];
}
+ (BOOL) successCallSystem
{
return (system("ls") == 0) ? YES : NO;
}
+ (bool) testLibEnv
{
char *env = getenv("DYLD_INSERT_LIBRARIES");
NSLog(@"%s", env);
return env != NULL;
}
+ (BOOL) isJailbreak
{
BOOL b0 = [self hasCydia],
b1 = [self hasAPT],
b2 = [self successCallSystem],
b3 = [self testLibEnv];
return b0||b1||b2||b3;
}
标签:blog io ar os sp on div log bs
原文地址:http://www.cnblogs.com/huangzizhu/p/4157134.html