-(BOOL) isJailbroken
{
#if TARGET_IPHONE_SIMULATOR
return NO;
#else
FILE *f = fopen("/bin/bash", "r");
if (errno == ENOENT)
{
// device is NOT jailbroken
fclose(f);
NSLog(@"no");
return NO;
}
else {
// device IS jailbroken
fclose(f);
NSLog(@"yes");
return YES;
}
#endif
}