Created
May 4, 2017 12:35
-
-
Save AnnieNinaJoyceV/cd5870c36d443aa85a33eea5316875ce to your computer and use it in GitHub Desktop.
Function to check whether the device is Jail broken or not
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
fileprivate func isDeviceJailbroken() -> Bool { | |
let cydiaPath = "/Applications/Cydia.app" //Cydia is an alternative to Apple's App Store for "jailbroken" devices | |
if FileManager.default.fileExists(atPath: cydiaPath) { | |
return true | |
} | |
let protectedPath = "/private/jailbreak.test" | |
do { | |
try "0".write(toFile: protectedPath, atomically: true, encoding: String.Encoding.utf8) | |
return true | |
} catch { | |
return false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment