Cydia Tweaks

Have you ever browsed through cydia and wondered, How could I make a cool app such as insert cool app from cydia here. Well, here you learn the basic outline for most tweaks on cydia from the simple UI tweaks to advanced behind the scenes modge podge. To begin you all you need is your mac and an iDevice. Also a few things need to be installed on your system:

(git, curl and perl come default on Mac OS X)

  • git
  • curl
  • perl
  • xcode

Now you need a tool called Theos, follow these steps to get it.

On Your Mac

1.  Open a terminal window and type the following (this sets a variable for your upcoming theos directory).

export THEOS=/opt/theos

2.  Now you need to copy the git for theos into your directory.

git clone git://github.com/DHowett/theos.git $THEOS

3.  Next you need to download ldid into that directory.

curl -s http://dl.dropbox.com/u/3157793/ldid > $THEOS/bin/ldid; chmod +x $THEOS/bin/ldid

 

On Your iDevice (Using iFile or SSH)

  1. Create a file at /etc/apt/sources.list.d/coredev.nl.list containing the following line:
    deb http://coredev.nl/cydia iphone main
  2. Create a file at /etc/apt/sources.list.d/howett.net.list containing the following line:
    deb http://nix.howett.net/theos ./
  3. As root, issue these commands (using either SSH or MobileTerminal):
    apt-get update
    apt-get install perl net.howett.theos
Note: Theos will be installed to /var/theos/ on your device.

 
Create The Project

Now you just need to browse to the directory where you want to make a new project and type in:
$THEOS/bin/nic.pl
This will give you a menu something like this.
$ $THEOS/bin/nic.pl
NIC 1.0 - New Instance Creator
------------------------------
  [1.] iphone/application
  [2.] iphone/library
  [3.] iphone/preference_bundle
  [4.] iphone/tool
  [5.] iphone/tweak
Choose option 5 to make a new cydia tweak. Next it will ask you a few questions about making your new project.
Once you’ve completed the template you will have a new directory as the name of your project with a few files in it. The main important ones are the MAKE file and Tweak.xm. Tweak.xm is the file you will be writing your code insertion methods in and will look along the lines of:
%hook UIAlertView // The class you will override
 -(void)alert { // method to override
    [self setTitle:@"new title"]; // write custom code
    %orig; // Then call original method to finish the original code
 }
%end //end hooking uialertview
   Basically you write out a method for a class you want to modify say UIAlertView. You would type %hook UIAlertView and then type and modify the method you wish to override such as the alert method. Then you can finish the original method by calling %orig or return %orig.

 

Now to compile it in your terminal window, type:
$ sudo make

 

This should compile it after you type in your password and then a new obj folder will be created in your projects root directory, copy the file ending in .dylib from that folder and the .plist file from the root dir to your idevice under the directory:  /Library/MobileSubstrate/DynamicLibraries/
Then respring your device or reboot to enable it.
Alternatively, you can add the following line to your make file.
THEOS_DEVICE_IP = [INSERTDEVICESIPHERE]

 

Then turn on ssh on your idevice and type in your mac terminal window:
$ sudo make package install

 

Finding Classes

To find classes you want to override, install Class Dump from cydia then using ssh or mobileterminal run the following command as root user (Type su and default password is alpine):

$ class-dump -H path/to/your/binary -o /path/where/you/want/your/classheaders

There’s a basic tutorial on the outline of making a cydia tweak, for more examples and tutorials look at my posts soon to come, Thanks for reading and hope this tutorial helped!

11 thoughts on “Cydia Tweaks”

    1. The theme is called “Twenty Eleven 1.3 by the WordPress team”, I’m not sure where I got it but it was somewhere on the wordpress main website.

  1. ______ __ ____ ____ ___
    | __ | / / |_ | |_ | | | _______ ___
    | |__| | / / | | | | | | | ____ | | |
    |____ | / / | | | | | | | | | | |
    | | / / | | | | | |_____ | |____| | | |_____
    |__| /__/ |__| |__| |_______| |_______| |_______|

Leave a Reply to timmay Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>