在安装了xCon软件包的IOS中检测越狱手机
我发现有多篇文章解释了检测越狱电话方法的一般方法 其中一个密切的参考是: 但是,在xCon安装的设备上测试时未检测到越狱 任何线索,我们可以如何检测,因为我们有一个金融应用程序,需要被阻止,如果设备是JB,即使xCon安装 非常感谢您的帮助。在安装了xCon软件包的IOS中检测越狱手机,ios,objective-c,iphone,xcode,jailbreak,Ios,Objective C,Iphone,Xcode,Jailbreak,我发现有多篇文章解释了检测越狱电话方法的一般方法 其中一个密切的参考是: 但是,在xCon安装的设备上测试时未检测到越狱 任何线索,我们可以如何检测,因为我们有一个金融应用程序,需要被阻止,如果设备是JB,即使xCon安装 非常感谢您的帮助。 快速越狱检查: static func isJailbroken() -> Bool { guard let cydiaUrlScheme = NSURL(string: "cydia://package/com.example.package")
- 快速越狱检查:
static func isJailbroken() -> Bool { guard let cydiaUrlScheme = NSURL(string: "cydia://package/com.example.package") else { return false } if UIApplication.shared.canOpenURL(cydiaUrlScheme as URL) { return false } #if arch(i386) || arch(x86_64) // This is a Simulator not an idevice return false #endif let fileManager = FileManager.default if fileManager.fileExists(atPath: "/Applications/Cydia.app") || fileManager.fileExists(atPath: "/Library/MobileSubstrate/MobileSubstrate.dylib") || fileManager.fileExists(atPath: "/bin/bash") || fileManager.fileExists(atPath: "/usr/sbin/sshd") || fileManager.fileExists(atPath: "/etc/apt") || fileManager.fileExists(atPath: "/usr/bin/ssh") || fileManager.fileExists(atPath: "/private/var/lib/apt") { return true } if canOpen(path: "/Applications/Cydia.app") || canOpen(path: "/Library/MobileSubstrate/MobileSubstrate.dylib") || canOpen(path: "/bin/bash") || canOpen(path: "/usr/sbin/sshd") || canOpen(path: "/etc/apt") || canOpen(path: "/usr/bin/ssh") { return true } let path = "/private/" + NSUUID().uuidString do { try "anyString".write(toFile: path, atomically: true, encoding: String.Encoding.utf8) try fileManager.removeItem(atPath: path) return true } catch { return false } } static func canOpen(path: String) -> Bool { let file = fopen(path, "r") guard file != nil else { return false } fclose(file) return true }
- 快速越狱检查:
static func isJailbroken() -> Bool { guard let cydiaUrlScheme = NSURL(string: "cydia://package/com.example.package") else { return false } if UIApplication.shared.canOpenURL(cydiaUrlScheme as URL) { return false } #if arch(i386) || arch(x86_64) // This is a Simulator not an idevice return false #endif let fileManager = FileManager.default if fileManager.fileExists(atPath: "/Applications/Cydia.app") || fileManager.fileExists(atPath: "/Library/MobileSubstrate/MobileSubstrate.dylib") || fileManager.fileExists(atPath: "/bin/bash") || fileManager.fileExists(atPath: "/usr/sbin/sshd") || fileManager.fileExists(atPath: "/etc/apt") || fileManager.fileExists(atPath: "/usr/bin/ssh") || fileManager.fileExists(atPath: "/private/var/lib/apt") { return true } if canOpen(path: "/Applications/Cydia.app") || canOpen(path: "/Library/MobileSubstrate/MobileSubstrate.dylib") || canOpen(path: "/bin/bash") || canOpen(path: "/usr/sbin/sshd") || canOpen(path: "/etc/apt") || canOpen(path: "/usr/bin/ssh") { return true } let path = "/private/" + NSUUID().uuidString do { try "anyString".write(toFile: path, atomically: true, encoding: String.Encoding.utf8) try fileManager.removeItem(atPath: path) return true } catch { return false } } static func canOpen(path: String) -> Bool { let file = fopen(path, "r") guard file != nil else { return false } fclose(file) return true }