This document contains code snippets to check if a device is jailbroken using several techniques: checking for the existence of files and folders associated with jailbreaking like Cydia.app or /private/var/lib/apt/; checking if the stat function has been hooked by comparing the library it points to; checking if the MobileSubstrate dylib is loaded; checking the DYLD_INSERT_LIBRARIES environment variable. If any of the checks return true, it is determined that the device is jailbroken.