首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >越狱探测机构无法检测越狱装置

越狱探测机构无法检测越狱装置
EN

Stack Overflow用户
提问于 2020-07-02 12:12:52
回答 1查看 829关注 0票数 1

在我的应用程序中,我想检测设备是否被越狱。如果它是越狱,它不应该允许用户使用应用程序。我添加了一个要检测的函数,但它没有检测越狱设备。

附加代码以供参考

JailbrokenDetector.swift

代码语言:javascript
复制
func isJailBroked() -> Bool {
    let pathsArray = ["/bin/bash", "/usr/sbin/sshd", "/etc/apt", "/private/var/lib/apt/", "/Applications/Cydia.app", "/Library/MobileSubstrate/MobileSubstrate.dylib", "/Library/SBSettings/Themes/", "/System/Library/LaunchDaemons/com.saurik.Cydia.Startup.plist/", "/private/var/lib/cydia/private/var/mobile/Library/SBSettings/Themes/", "/var/cache/apt/", "/var/lib/cydia/", "/var/log/syslog/", "/var/tmp/cydia.log/", "/bin/bash/", "/bin/sh/", "/usr/sbin/sshd/", "/usr/bin/sshd/", "/usr/libexec/sftp-server/", "/etc/ssh/sshd_config/", "/etc/apt/", "/Applications/Cydia.app/", "/Applications/WinterBoard.app/", "/Applications/SBSettings.app/", "//private/var/lib/cydia/private/var/mobile/Library/SBSettings/Themes/", "/usr/libexec/ssh-keysign/", "/Applications/blackra1n.app", "/Applications/FakeCarrier.app", "/Applications/Icy.app", "/Applications/IntelliScreen.app", "/Applications/MxTube.app", "/Applications/RockApp.app", "/Library/MobileSubstrate/DynamicLibraries/LiveClock.plist", "/Library/MobileSubstrate/DynamicLibraries/Veency.plist", "/private/var/stash", "/private/var/tmp/cydia.log", "/System/Library/LaunchDaemons/com.ikey.bbot.plist"]
    
    for pathString in pathsArray {
        if FileManager.default.fileExists(atPath: pathString) {
            return true
        }
    }
            
    let dummyString = “Testing”
    
    do {
        try dummyString.write(toFile:"/private/JailbreakTest.txt", atomically:true, encoding:String.Encoding.utf8)
        return true
    } catch {
        return false
    }

  if (UIApplication.shared.canOpenURL(URL(string: "cydia://package/com.example.package")!) || UIApplication.shared.canOpenURL(URL(string: "Cydia://")!) || UIApplication.shared.canOpenURL(URL(string: "cydia://")!)) {
        return true
    }
    
    if self.canOpen(path: "/Applications/Cydia.app") ||
        self.canOpen(path: "/Library/MobileSubstrate/MobileSubstrate.dylib") ||
        self.canOpen(path: "/bin/bash") ||
        self.canOpen(path: "/usr/sbin/sshd") ||
        self.canOpen(path: "/etc/apt") ||
        self.canOpen(path: "/usr/bin/ssh") {
        return true
    }
}

在附录.m中(Obj c)

代码语言:javascript
复制
if ([JailbrokenDetector isDeviceJailBroken]) {
    exit(0);
    return NO;
}
EN

回答 1

Stack Overflow用户

发布于 2020-07-03 23:30:27

截至iOS,14个应用程序无法在其自己的包之外执行这些fs检查,因此上面的方法将无法工作。

另外,越狱检测是不值得的,这种检查最多只能用6行就可以修补,这是一场失败的战斗,人们需要停止战斗。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62696078

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档