+ (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;
}
时间: 2024-11-13 00:13:55