Created
September 18, 2012 16:01
-
-
Save jeffniblack/3743918 to your computer and use it in GitHub Desktop.
main for iOS jailbreak detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int argc, char *argv[]) | |
{ | |
bool lifeIsGood = YES; //assume things will be good | |
//do checks here...finding something bad sets lifeIsGood to NO | |
if ((fork_check()) | |
|| (files_check()) | |
|| (fstab_check()) | |
|| (symbolic_link_check())) { | |
lifeIsGood = NO; | |
} | |
//now setup the run loop | |
@autoreleasepool { | |
if (lifeIsGood) { | |
//standard app delegate | |
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); | |
} else { | |
//the jailbreak app delegate | |
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegateJB class])); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment