Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to detect tvOS is jailbroken using swift

Is there any way to detect in tvOS app if the apple tv is jailbroken or not ? Tried same method as used in iPhone to detect jailbroken but it does not work as per the reference link - How do I detect that an iOS app is running on a jailbroken phone?

NSString *filePath = @"/Applications/Cydia.app";
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath])
{
   // do something useful
}

This method does not work, any API specific for tvOS app to detect jailbroken ?

like image 323
Manisha Avatar asked Jun 17 '19 11:06

Manisha


People also ask

Can iOS detect jailbreak?

One key fact that iOS detection for jailbreaking can depend on is figuring out if the app is asking for more resources and app data than allowed by the Apple operating system. The app may also look for other applications like Cydia, available only on jailbroken devices.

How do you know if your iOS is jailbroken?

The easiest way to know if you have a jailbroken iPhone is to check your apps. If your iPhone has the alternative app store Cydia instead of Apple's App Store, that's a clear sign of a jailbroken phone.

What is a jailbroken device detected?

Jailbroken (iOS) or rooted (Android) devices are identified on the Okta Mobility Management page with an icon and label: Jailbroken: Indicates that a user has installed unsupported software on an iOS device.

Can Apple TV be jailbroken?

Once you have jailbreak software running on an Apple TV you can install new apps, services and systems on the Apple TV that make it far more interesting than what Apple offers by default.


1 Answers

You can check if any of these files exist (Cydia stuff):

  • /private/var/lib/cydia
  • /var/cache/apt
  • /var/lib/apt
  • /var/lib/cydia

Many people also install OpenSSH on their jailbroken devices, so check for:

  • /usr/sbin/sshd
  • /usr/bin/sshd

If Cydia is not installed - check the root partition permissions - /.

If you can read/write, the device is most likely jailbroken.

You could also try fork() - the sandbox won't allow it, hence it will succeed in a jailbroken environment.


Note: Keep in mind there's plenty of tools in Cydia and on the Internet to bypass jailbreak checks.

like image 56
Matteo Pacini Avatar answered Oct 01 '22 17:10

Matteo Pacini