Open kingcos opened 6 years ago
func isJailed() -> Bool { // Check env vars return (getenv("DYLD_INSERT_LIBRARIES") != nil) }
func isJailed() -> Bool { // Check files let paths = [ "/Applications/Cydia.app", "/Library/MobileSubstrate/MobileSubstrate.dylib", "/var/lib/cydia", "/var/lib/apt", "/var/cache/apt", "/etc/apt", "/bin/bash", "/bin/sh", "/usr/sbin/sshd", "/usr/libexec/ssh-keysig", // iOS 9.0.1 Jailbroken device may not have this, either "/etc/ssh/sshd_config", "/private/var/lib/apt/", ] for path in paths { return FileManager.default.fileExists(atPath: path) } return false }
func isJailed() -> Bool { // Check Cydia URL return UIApplication.shared.canOpenURL(URL(string: "cydia://package/com.example.package")!) }
Solution