-
Notifications
You must be signed in to change notification settings - Fork 66
Usage
Make sure that you have installed Theos Jailed before following this guide.
- Extract and decrypt your target app. Save as a .ipa
- Change to the base directory for your tweak (eg.
cd ~/Desktop
) - Run
nic.pl
and choose the jailed template - Enter a name for your tweak
- Enter an absolute or relative path to your decrypted .ipa file
- Change into your new tweak directory (eg.
cd ~/Desktop/mytweak
) - Edit Tweak.xm as necessary
- Optionally create a
Resources
folder, which will be merged with the app bundle. If this directory contains anInfo.plist
, the keys will be merged too - Run
make info
and follow the instructions to create a Provisioning Profile - Run
make package install [PROFILE=<your.bundle.id | file.mobileprovision>]
. OmitPROFILE=...
to use Xcode's Wildcard App ID- Set
TWEAK_NAME_USE_CYCRIPT=1
to be able to remotely attach to Cycript usingcycript -r hostname:31337
- Set
TWEAK_NAME_USE_FISHHOOK=1
to use fishhook (remember to#import <fishhook.h>
as well)
- Set
You can easily inject a tweak available on Cydia into an app of your choice, in only a few steps.
- Download the tweak as a .deb file. To find a website that lets you do this, Google Cydia Updates
- Unpack the .deb file, using the command
dpkg-deb -R file.deb destination
- Extract and decrypt the app targeted by the Cydia tweak. Save as a .ipa
- Create a new Theos project with the
jailed
template, using the decrypted .ipa - Copy the unpacked tweak at
destination/Library/MobileSubstrate/DynamicLibraries/tweak-name.dylib
to the root folder of your project, replacingtweak-name
with the name of the tweak you downloaded - Add
DYLIB = tweak-name.dylib
to the top ofMakefile
- Follow step 8 and 9 of General Usage
Many tweaks require external dependencies. To use one, you must first fix the install name
of the dependency and the libraries it links against.
- Download and extract the dependency .deb, similarly to the tweak
- Follow steps 2 and 3 of Dynamic frameworks
- Run
install_name_tool -id @executable_path/Frameworks/dependency.dylib Resources/Frameworks/dependency.dylib
- Run
otool -L tweak-name.dylib
to see the current linked path to the dependency - Run
install_name_tool -change /current/path/to/dependency.dylib @executable_path/Frameworks/dependency.dylib
Note: Some dependencies (such as uasharedtools
) do not work with jailed devices, and thus tweaks that require them will not work.
External frameworks may be of two types: static and dynamic. To find out which your framework is, run the following command:
file Foo.framework/Foo | grep -q "Mach-O dynamically linked shared library" && echo "Dynamic" || echo "Static"
If you have a .dylib file, follow the instructions in Dynamic frameworks
- Copy the .framework into your project's root directory
- Open
Makefile
in your favourite text editor - Add
TWEAK_NAME_LDFLAGS = -F.
andTWEAK_NAME_CFLAGS = -F.
aboveinclude $(THEOS_MAKE_PATH)/tweak.mk
, replacingTWEAK_NAME
with the name of your tweak - Below the lines you just added, add another line:
TWEAK_NAME_FRAMEWORKS = Foo
. Of course, replace Foo with the name of your framework - If you need to add any libraries, append them to the
LDFLAGS
line. For example, if I wanted to addlibxyz.tbd
to my project, I would change myLDFLAGS
line toTWEAK_NAME_LDFLAGS = -F. -lxyz
- Import your framework in Tweak.xm using
#import <Foo/Foo.h>
- Dynamic frameworks are only supported in iOS 8 and above. Add
TARGET = iphone:gcc:latest:8.0
to the beginning of your makefile
- Create a
Resources
folder in your project's root directory. The contents of this directory will be merged with your target app's root directory - Make a
Frameworks
folder inResources
, and copy your framework into that directory - Follow steps 2 to 6 of Static frameworks, but replace
-F.
with-FResources/Frameworks
in step 3
Note: Dynamic frameworks don't seem to be working correctly right now. I'll update this page with more details once the issue is fixed.
Theos Jailed makes it extremely easy to package a project as an Extensify Exo.
- Run
make package PACKAGE_FORMAT=exo
- The exo will now be packaged as a .zip file in your project's
packages
directory. You can runmake show
to view it