Dev team implemented a jailbreak detection mechanism. But one of our client reported that his phone had never been jailbroken but still he is not able to run our application. On investigation, we have found that client has installed 'La Terminal - SSH Client' application from app store. Which is causing this issue. On uninstalling this app, our company app is running fine.
Jailbreak Code:
func isDeviceJailBroken() -> Bool {
if UIDevice.current.isSimulator { return false }
let appNames = ["cydia",
"Sileo",
"Icy",
"MxTube",
"RockApp",
"blackra1n",
"SBSettings",
"FakeCarrier",
"WinterBoard",
"IntelliScreen",
"loader",
"FlyJB",
"Zebra",
"WinterBoard",
"Snoop-itConfig",
"Terminal"]
for appName in appNames {
if UIApplication.shared.canOpenURL(URL(string: "\(appName)://")!) {
return true
}
}
return false
}
I thought this SSH client app had Terminal word in its bundle id. Maybe that's why it is causing issue. So I downloaded another app 'Beam Terminal' which has Terminal word in its bundle id. But this time our company app is working.
La Terminal - SSH Client (Error)
https://itunes.apple.com/lookup?id=1629902861
bundleId: com.xibbon.LaTerminal
Beam Terminal (No Error)
https://itunes.apple.com/lookup?id=603488666
bundleId: com.beamwallet.BeamTerminal
Can anybody tell me what's the pattern here?
For starts, those aren't "app names". They're URL schemes. I assume that your dev team has gleaned the URL scheme for each of the apps above, or have they just plugged in the app names in hopes that the app name happens to match the app's URL scheme? It's difficult to know for sure since they are already conflating "app name" with "url scheme", which are two vastly different things.
In any case, it seems likely that the offending app has registered one of the above "app names" as their URL scheme, which is why canOpenURL()
is returning true
.