If I want my app to behave differently on a jailbroken iPhone, how would I go about determining this?
BOOL isJailbroken() { #if TARGET_IPHONE_SIMULATOR return NO; #else FILE *f = fopen("/bin/bash", "r"); if (errno == ENOENT) { // device is NOT jailbroken fclose(f); return NO; } else { // device IS jailbroken fclose(f); return YES; } #endif }