JailBreak Detection | JailBroken Device Detection | iOS | Swift

Izaan Saleem
2 min readMar 25, 2024

Jailbreaking an iOS device refers to the process of removing software restrictions imposed by Apple on its devices, such as iPhones and iPads. This allows users to gain root access to the device’s operating system, install unauthorized apps, customize the user interface, and access features not available on non-jailbroken devices. However, jailbreaking also comes with several drawbacks and risks.

FwkiPwwX0AEzQAd.jpg:large

Pros of Jailbreaking iOS:

  1. Customization: Users can customize the appearance and behavior of their device beyond what Apple allows.
  2. Access to Unofficial Apps: Jailbreaking enables the installation of apps not available on the official App Store.
  3. Enhanced Functionality: Users can access features and settings that are typically restricted by Apple.

Cons of Jailbreaking iOS:

  1. Security Risks: Jailbreaking can expose the device to security vulnerabilities and malware, as users can install apps from untrusted sources.
  2. Instability: Jailbreaking can lead to system instability, crashes, and performance issues, especially with unofficial software modifications.
  3. Voided Warranty: Jailbreaking may void the device’s warranty, as it involves modifying the operating system against Apple’s terms of service.
  4. Incompatibility: Some apps and services may not work correctly on jailbroken devices, as they are designed for the standard iOS environment.

Here’s an example of Swift code to detect if an iOS device is jailbroken:

func isJailBrokenFilesPresentInTheDirectory() -> Bool {
let fileManager = FileManager.default

if fileManager.fileExists(atPath: "/private/var/lib/apt") ||
fileManager.fileExists(atPath: "/Applications/Cydia.app") ||
fileManager.fileExists(atPath: "/Applications/RockApp.app") ||
fileManager.fileExists(atPath: "/Applications/Icy.app") ||
fileManager.fileExists(atPath: "/Applications/WinterBoard.app") ||
fileManager.fileExists(atPath: "/Applications/SBSettings.app") ||
fileManager.fileExists(atPath: "/Applications/blackra1n.app") ||
fileManager.fileExists(atPath: "/Applications/IntelliScreen.app") ||
fileManager.fileExists(atPath: "/Applications/Snoop-itConfig.app") ||
fileManager.fileExists(atPath: "/bin/sh") ||
fileManager.fileExists(atPath: "/usr/libexec/sftp-server") ||
fileManager.fileExists(atPath: "/usr/libexec/ssh-keysign") ||
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: "/System/Library/LaunchDaemons/com.saurik.Cydia.Startup.plist") ||
fileManager.fileExists(atPath: "/System/Library/LaunchDaemons/com.ikey.bbot.plist") ||
fileManager.fileExists(atPath: "/Library/MobileSubstrate/DynamicLibraries/LiveClock.plist") ||
fileManager.fileExists(atPath: "/Library/MobileSubstrate/DynamicLibraries/Veency.plist")
{
return true
} else {
return false
}
}

This code checks for the existence of various files and directories commonly associated with jailbroken devices. Keep in mind that the effectiveness of this method may vary depending on the jailbreak tool and version used.

--

--

Izaan Saleem

iOS Developer | iOS | Swift | XCode | Storyboard | Firebase | Firestore | Realtime | Database