is there any updated check for jailbroken devices (in swift or Objective-C)

We have placed the jailbreak check in our iOS application. this check is working fine maximum dvices. we have iPhone XS MAX, with iOS 12.3.2. and the application is not working on that. when we traced out the issue, we came to know that jailbreak check in our application is returning true on that device. while the device is not jailbroken.


current check in swift for **** broken devices is as bellow:

if FileManager.default.fileExists(atPath: "/Applications/*****.app")

|| FileManager.default.fileExists(atPath: "/Library/MobileSubstrate/MobileSubstrate.dylib")

|| FileManager.default.fileExists(atPath: "/bin/bash")

|| FileManager.default.fileExists(atPath: "/usr/sbin/sshd")

|| FileManager.default.fileExists(atPath: "/etc/apt")

|| FileManager.default.fileExists(atPath: "/private/var/lib/apt/")

|| UIApplication.shared.canOpenURL(URL(string:"*****://package/com.example.package")!)

{

return true

}

return false

let stringToWrite = "Jailbreak Test"

do

{

try stringToWrite.write(toFile:"/private/JailbreakTest.txt", atomically:true, encoding:String.Encoding.utf8)

print ("Device is jailbroken")

return true

}catch

{

return false

}

unfortunatly this check is returning true on iPhone X S MAX with iOS 12.3.1. where is the ltens version or jailbroken iOS is 12.1.2.
So please let me know if there is any updated check to verify whether a device is jailbroken or not.

Post not yet marked as solved Up vote post of irfan.awan123 Down vote post of irfan.awan123
1.9k views

Replies

Hi,


Any update on this? This checks are not breaking the Apple Appstore GuideLines also right?


Thanks in Advance

See this post for my thoughts on jailbreak detection.

This checks are not breaking the Apple Appstore GuideLines also right?

I don’t work for App Review, and only they can give you definitive answers about what will or won’t be allowed on the store.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"