3

I came across the following post about iOS jailbreak detection:

How do I detect that an iOS app is running on a jailbroken phone?

I would like to understand how to do what one poster suggested: GregH suggested bundling an unsigned / incorrectly signed executable inside of a signed executable and seeing if it could be successfully (sub-)executed on the device. My question is how does one get one app to execute another within itself? Especially in a way that a non-jailbroken device would complain / throw an error. I imagine getting it inside the other app is easy enough though: just build one app and put it in the directory of the other. If this is naive, though, I would also like to know how to do that properly.

I understand any solution would not be approved to the App Store.

Community
  • 1
  • 1
David
  • 31
  • 2

1 Answers1

0

This approach seems pretty pointless to me. On the one hand, you're likely to get rejected from the App Store, because your app has to be a single executable and bundling an additional executable is easily detectable by the reviewers. On the other hand, this would be trivial to circumvent. Someone with a jailbroken phone could simply replace your embedded executable with some garbage that wouldn't even run on a jailbroken phone...

omz
  • 53,243
  • 5
  • 129
  • 141
  • Disregarding both of those factors (not really sure what you mean by the second one, though), I'm still interested in how one would do it. – David May 12 '11 at 20:08
  • You can't with public API. If you just want to experiment, the easiest would probably be to use NSTask. The headers are private on iOS, but you could copy them from the Mac OS X SDK. – omz May 12 '11 at 20:17
  • I tried running /bin/bash on a jailbroken device and it gave exception NSInternalInconsistencyexception, saying it could not fork and giving errno 1. Not sure why. My guess would be that my non-jailbroken app doesn't have the permission to create new processes. What do you think? – David May 12 '11 at 20:55