How could mobile developers prevent bypassing certificate pinning with tools such as SSL Kill Switch?

From the github readme for the iOS SSL Kill Switch project:

Once installed on a jailbroken device, iOS SSL Kill Switch patches low-level SSL functions within the Secure Transport API

So your question basically boils down to: "How do I prevent my app from being infected with malware on a rooted / jailbroken device?". In short: you don't. This is why you don't root your device!


There are obfuscation tricks you can do to make this harder; for example write your own in-house SSL / TLS library (terrible, horrible idea, don't do this!), and then include this crypto in your compiled program so that there's no dependency on the OS's crypto libraries. Now you're immune to a hack in the OS's crypto layer, but if the attacker is targeting your app specifically then there's nothing to stop them, so you're not preventing an attack like this, just making it more difficult.


Another trick I've heard of is for the app to try to detect if it's running on a rooted device, and refuse to run if it is. That said, if you google "bypass jailbreak detection" you'll see that there is a constant game of whack-a-mole going on between hackers and developers where the hackers are getting increasingly clever at hiding the jailbreak. I don't recommend playing this game.


There is no point in trying to prevent this. Technically I guess you could slow down an attacker by implementing your own crypto (SSL Kill Switch modifies the OS-provided crypto functions) but even that will eventually get cracked given enough time and effort.

If you don't control the hardware, your software has no chances. Just live with it and let people do whatever they want on their device.