Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在安装了xCon软件包的IOS中检测越狱手机_Ios_Objective C_Iphone_Xcode_Jailbreak - Fatal编程技术网

在安装了xCon软件包的IOS中检测越狱手机

在安装了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")

我发现有多篇文章解释了检测越狱电话方法的一般方法

其中一个密切的参考是:

但是,在xCon安装的设备上测试时未检测到越狱

任何线索,我们可以如何检测,因为我们有一个金融应用程序,需要被阻止,如果设备是JB,即使xCon安装

非常感谢您的帮助。

  • 快速越狱检查:

    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
        }
        

      类似的问题还没有答案,但我们看到其他金融应用程序能够检测到:正如您链接到的帖子所述,这是不可能的。您的应用程序甚至可以在开始运行之前进行修补。你怎么可能防范这种情况呢?类似的问题还没有答案,但我们看到其他金融应用程序能够检测到:正如你链接到的帖子中所述,这是不可能的。您的应用程序甚至可以在开始运行之前进行修补。你怎么可能防范这种情况呢?