How to Create a Basic Cydia Tweak Without Coding Knowledge

Have you ever wondered how jailbreak tweaks are made? Maybe you wanted to make one yourself? If yes, then this tutorial is for you. I’ll be explaining everything from installing theos to making a tweak and running it on your jailbroken iPhone or iPad.

Step 1: Installing the Prerequisites

Before we begin making any Cydia tweak, it’s important to install a few packages that will aid and prepare for the process.

Open Cydia and add the following repository: https://coolstar.org/publicrepo/. Then, install the following tweaks and dependencies:

iOS Toolchain

LLVM+clang

Core Utilities

Core Utilities (/bin)

perl

git

make

MTerminal

Step 2: Installing Theos

I’ll be talking about Theos a lot through out this tutorial. In fact, Theos is the tool that allows us to create a tweak of our owns.

Open the MTerminal app on your home screen and type:

su

root password (default is alpine)

passwd

*Your new root password*

*Repeat your new root password*

cd /var

git config –global http.sslVerify “false” (with quotes)

git clone https://github.com/theos/theos

make update theos

cp /usr/local/bin/perl /usr/bin

Step 3: Installing SDK

Open this website on your Safari browser and download the iOS 8.1 SDK (even if you’re on a lower or newer version, use the 8.1 version). Unpack the SDK using your favorite file manager (iFile or Filza) and place it to /var/theos/sdks.

Done! You’re now ready to make tweaks!

Step 4: Create a Theos project

Open MTerminal

Type the following:

su

*Your root password*

cd /var/mobile

/var/theos/bin/nic.pl

You’ll see something like this:

Within the MTerminal screen:

Choose the template iphone/tweak (type 11), name the project.

Type com.YourNickName.YourTweakName in package name

Type your nickname

Hit enter when you see “MobileSubstrate bundle filter”

Hit enter when you see “List of applications to terminate upon installation”

Now, in your file manager, in the home directory, you’ll see a folder named with the name you’ve chosen for your tweak.

Step 5: Understanding hooking

The iOS SpringBoard consists of headers. (You can search for them here). iOS tweaks replace methods in headers by hooking into them. Here’s a hooking example:

So, that’s hooking! Now, you need to learn about methods.

Step 6: Understanding methods

There are 3 main types of methods. These are booleans, doubles, and voids. A method can be found in a header. For example, here is a method from the SBFolder header:

-(BOOL)shouldRemoveWhenEmpty

This method is a boolean. Boolean methods start with -(BOOL) or -(_Bool). Booleans are like switches. They can only have two types: YES and NO. So, let’s modify a boolean.

Modifying booleans is pretty simple, right? Here are some tips to help you understand booleans better:

if the boolean starts with a +, you should write +(BOOL)booleanName, not -(BOOL)booleanName

if the boolean has (_Bool) instead of (BOOL), use it like this: -(_Bool)booleanName

Booleans can only return YES and NO. If you return them to somewhere else, the tweak won’t work.

Step 7: Making a Cydia tweak

Now, let’s write our tweak! We’ll make a simple one, which will stop folders from removing themselves when they’re empty.

Open the tweak directory.

Open the file called makefile.

Change include $THEOS/makefiles/common.mk to include /var/theos/makefiles/common.mk. If the line looks like include theos/makefiles/common.mk, do the same with it.

At the top of the file (before include /var/theos/makefiles/common.mk) add the following line: ARCHS = armv7 armv7s arm64

Open the file called tweak.xm

Delete everything.

The Tweak.xm file is the file which will become a tweak later.

First, let’s hook into SBFolder like this:

%hook SBFolder

%end

Second, let’s modify the method shouldRemoveWhenEmpty to NO, so the folder isn’t removed when it’s empty:

Note: to modify the code, just put the code you want to be used instead of the original into the brackets. But to add code to the original void, first type %orig; inside the brackets and only after the code.

Let’s hide the press home to unlock text!

The method _layoutCallToActionLabel puts the slide to unlock text to the lockscreen. We will disable it like this:

Now, compile the tweak as in example 1 and 2, and try it!

Hooooray, it worked!

If you want to learn more about this process and make even more legit tweaks, I suggest you dive into Objective-C and logos. Developers such as Antique_Dev and LaughingQuoll also have some great tutorials on how to make Cydia tweaks as well.