Skip to content

Part 1: I need a Tweak

derv edited this page Sep 6, 2016 · 3 revisions

This is the story of my first jailbreak tweak. Some details have been left out.

DISCLAIMER

Bypassing your company's security blocks is an easy way to get FIRED. You need to decide if your jailbreak is worth your job.

Introduction

I was on iOS 9.0.2. Eventually I got locked out of my Exchange email server for not upgrading. I didn't want to lose my jailbreak.

I was able to restore access to my emails by spoofing the iOS version for my device:

WARNING: DO NOT DO THIS

  1. Edit /System/Library/CoreServices/SystemVersion.plist file
  2. Set the systemVersion to 9.3.3 and buildVersion to 13G34 (Mappings from iOS version to buildVersion can be found on wikipedia)
  3. Reboot Phone. Hope it doesn't brick.
  4. AppStore, Cydia, and everything else stop working correctly. Afraid to update Apps/Tweaks for fear of bricking phone / losing functionality.

Then the 9.3.3 jailbreak came out. So I just restored/upgraded/re-jailbroke on 9.3.3 and everything was fine for a month.

Then The Pegasus Spyware was circulating, and suddenly 9.3.3 was outdated, so I had to upgrade to 9.3.5 or lose Exchange access again.

Instead of upgrading to 9.3.5 and losing my jailbreak, I looked for tweaks that would spoof the Exchange client on my phone to "pretend" I was already on 9.3.5.

The hunt is on

First, I searched /r/jailbreak for any exchange-related tweaks, found nothing except one or two posts asking the same questions I had.

Then I remembered Flex 2 (BigBoss), a tweak which allows you to hook into Libraries and change functionality for apps. This can be used to bypass jailbreak detection in some apps.

I searched /r/flextweak for exchange, didn't find anything.

Time to get creative

I ponied up the $4 for Flex 2 and started digging. I searched Flex 2's "Tweak Cloud" for other tweaks people have created and not finding anything...

At this point, I realized I probably have to make my own tweak.

I looked at some guides on creating my own tweak in Flex 2.

I assumed I needed to override the systemVersion and buildVersion (defined in UIDevice) similar to when I edited the SystemVersion.plist file, but this did not work for me; I still couldn't access email, and now the app was crashing when opening email messages.

Flex 2 provides a class-dump of all the libraries used by applications with the ability to override that functionality. E.g. a class named "UserManager" has a method "getUser" that you can override to return any user you want, like "Steve Jobs".

But Flex 2's methods for searching are abysmal: I had to go search inside every Library and every Class of each library for user, agent, version, or anything else related to the system user agent... not knowing if this is even what I should be looking for!

I needed to know exactly what was happening in the background of the MobileMail application. Ideally, FLEX would allow me to see currently-running instances of the classes it found in the class-dump, and allow me to view the class properties and call the class methods. And I needed a way to search through the internal code of the iOS operating system.

Clone this wiki locally