办法2
检测cydia.app是否存在
struct stat s;
int is_jailbroken=stat("/Applications/Cydia.app", &s);
NSLog(@"-----is_jailbroken=%d----",is_jailbroken);//返回为0说明有Cydia.app,否则-1
或者
struct stat s;
int is_jailbroken=stat("/Library/MobileSubstrate/DynamicLibraries/MobileSubstrate.dylib", &s);
NSLog(@"-----is_jailbroken=%d----",is_jailbroken);
办法3.判断文件大小
struct stat s
stat(“/etc/fstab”,&s);
return s.st_size