Updating extensions for iOS 9

From iPhone Development Wiki
Revision as of 04:00, 15 October 2015 by Uroboro (talk | contribs) (Entitlements and Cycript errors.)

Let's collect knowledge like we did with Updating extensions for iOS 8 and Updating extensions for iOS 7 - paste in your notes and share what you've learned, and somebody else will organize it later. :) If you want to ask questions and share tips over chat with other developers, see How to use IRC for how to connect to #theos and #iphonedev.

Hey developer, you can add your knowledge here! Yes, you! Make an account and edit this page!

It's also helpful to double-check the statements here and add more info! These are notes and drafts from early research - feel free to update them.

If you want to see what's been recently updated on this page, you can use the wiki's history feature to compare the revisions (to look at the diff) since the last time you visited this page.

Compiling ldid on El Capitan

Not quite iOS 9, but still something to be aware of: El Capitan does not include OpenSSL, which ldid requires to compile. In order to get OpenSSL and modify ldid's make script to use it, follow these steps.

  • Install Homebrew if you haven't already.
  • Install OpenSSL through Homebrew:
   brew install openssl
  • Clone ldid as normal.
  • Download this modded make.sh and replace the old one with this one.
  • Make as normal:
   ./make.sh

What has changed in iOS 9? (Classes, frameworks, etc.)

Compilation changes

Code must now be compiled with

   -Wl,-segalign,4000

This LDFLAG can be used to compile for older iOS versions as it had to be a multiple of 1000.

If using Theos, add it like so:

   XXX_LDFLAGS += -Wl,-segalign,4000

If using Xcode, add a new entry to Other linker flags containing "-Wl,-segalign,4000" to the build settings of your project or target.

Source: saurik's tweet

Entitlements

Some tweaks interacting with BackBoardServices now require an entitlement and will fail with the following error if it's not present on the binary:

xbs/Sources/BackBoardServices/SpringBoard-3296.10.2/megatrond/SystemAppService/BKSSystemApplicationClient.m:32
Oct 14 21:29:57 iPhone SpringBoard[1860] <Error>: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Client lacks entitlement com.apple.backboard.client’

Use ldid to sign your tweak with the following entitlement XML file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.backboard.client</key>
	<true/>
</dict>
</plist>

Which tools and other preexisting things are still working on iOS 9? Which ones don't work?

  • Cycript fails with the following error:
dyld: Library not loaded: /usr/lib/libapr-1.0.dylib
  Referenced from: /usr/bin/cycript
  Reason: no suitable image found.  Did find:
    /usr/lib/libapr-1.0.dylib: mmap() error 22 at address=0x0013F000, size=0x00001000 segment=__DATA in Segment::map() mapping /usr/lib/libapr-1.0.dylib
    /usr/lib/libapr-1.0.dylib: mmap() error 22 at address=0x00163000, size=0x00001000 segment=__DATA in Segment::map() mapping /usr/lib/libapr-1.0.dylib
Trace/BPT trap: 5

No fixes for the time of this writing.