在我的应用程序中,我想检测设备是否越狱。如果越狱,它不应该允许用户使用应用程序。我添加了一个功能来检测,但它不检测越狱的设备
附上代码以供参考
- 越狱探测器.swift*
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
}
}
- 在Appdelegate.m(对象c)中 *
if ([JailbrokenDetector isDeviceJailBroken]) {
exit(0);
return NO;
}
2条答案
按热度按时间hgqdbh6s1#
从iOS 14开始,应用程序无法在其自己的捆绑包之外执行这些文件系统检查,因此您使用的上述方法将不起作用。
此外,越狱检测是不值得的,该检查可以修补不工作,只有6行最多,这是一个失败的战斗,人们需要停止战斗。
qlckcl4x2#
真的,是不值得一试,越狱/调整开发人员非常有才华,可以绕过所有越狱检测器,我越狱,我绕过每一个应用程序,我甚至不明白为什么你试图阻止我们使用你的应用程序.