Develop for Grayd00r

Take part in the development of Grayd00r project.
You can contribute with your work and ideas.
In this page you can find useful resource to start with.

Join the community
Theming

This quick tutorial provides some tip about to theme iOS without using Winterbaord.

You can simply replace the PNG images you find in the iOS FileSystem accessing to it with iFunbox, maybe applying a lossless compression to reduce its size. Something you need to clean cache deleting files inside /var/mobile/Library/Caches/ and then Respring.

Unfortunately most of UI elements are bundled inside the Artwork bundles: this short guide will show how to set up the required tool on your Mac in order to decrypt and encrypt these files.

  • Install Python 2.7 with this package.

  • Open Terminal on Mac: Launchpad, Other folder, Terminal. We also suggest to drag the icon on the Dock bar because you are going to use it very often.

  • Type sudo pip install pillow -U and press Enter.

  • Download this package and move it in your Home directory (from Finder you can press cmd+shift+H).

  • Double click on it to decopress the archive: you will have a folder called artworkThemer containing some file and folders. The sharedArtworkDecrypted folder includes all PNGs file to be customized. Keep in mind that you can't change the dimension of these images.

Everytime you need to build an updated Artwork bundle:

  • Move inside the artworkTheme folder with this command from Terminal
    cd ~/artworkThemer

  • Run this command to build the new artwork (one line-command):
    ./iOS-artwork.py create -a ./sharedArtworkOriginal/Shared.artwork -d ./sharedArtworkDecrypted -c ./sharedArtworkEncrypted/Shared.artwork

  • Replace the existing Shared.Artwork file in /System/Library/Frameworks/UIKit.framework with the new one that you will find in sharedArtworkEncrypted folder, using iFunbox

Jailbreak

Grayd00r is currently using CInject CLI to apply an untethered jailbreak on your device.

Cinject is a CLI tool by the iPhone Dev Team used to install the Rocky Racoon untethered jailbreak on iOS 5.1.1. The developers describe that the spelling of "racoon" with one C is intentional, as it is named after the com.apple.racoon.plist daemon, which was also exploited in Corona for iOS5.0.1 untether jailbreak. Corona is an anagram of racoon.

iPhoneWiki: Jailbreak Exploits

Documentation about Corona: Pod2g's Blog, PDF

Documentation about Rocky Racoon: PDF Slides

Installation Tool

The Grayd00r installation tool have been developed using the QT Framework and QT Creator. This offers a cross-platform compatibility and the project is easy to compile on any machine, without any kind of configuration.

To contribute to the installation tool source code or compile by your own, you need to download the QT Online installer from the official website and complete the installation on your computer (Windows and OSX).

Download the latest Gray00r release and decompress the archive: you will find the source folder with the QT project inside. Just double click on Greyd00r.pro file to set up the envirnment for development.

The Installation tool is divided in four main phases:

  • Check if the device is eligible for Grayd00r installer

  • Check iTunes installation and device activation status

  • Jaibreak using the CoronaA5 jailbreak as described above

  • Inject the Grayd00r Installer application along with Cydia bundle

  • The user is promted to launch the Installer app to download Grayd00r customization files

App Development

This quick-start guide is provided to help those who want to make application in a jailbreak environment, without relying on XCode and all the problems related to app signing. This tutorial covers the basics to set up your Apple OSX computer in order to use the Theos development tool, that will help you to create projects.

  • Install and open XCode from MacAppStore.

  • Visit this website, download and install MacPort for your OSX version.

  • Open Terminal on Mac: Launchpad, Other folder, Terminal. We also suggest to drag the icon on the Dock bar because you are going to use it very often.

  • Type xcode-select --install and press Enter and follow the instruction to install CommandLine Tool for XCode.

  • Type sudo port install dpkg and press Enter. You will be prompted for your system password for confirmation (you will not see anything while typing)

  • Download this package and move it in your Home directory (from Finder you can press cmd+shift+H).

  • Double click on it to decopress the archive: you will have a folder called theos containing itself a theos and theosProjects folders.

Everytime you want to start to develop a new application for jailbroken devices, follow the following steps.

  • Move inside the theosProjects folder with this command from Terminal cd ~/theos/theosProjects

  • Create a new project with this command from Terminal: ~/theos/theos/bin/nic.pl

  • Answer to the questions provided by New Instance Creator (NIC): choose 1 to create an Application, give the name of the Application, write com.d00r.[yourAppName] as package name and finally your name as Author.

Your project has been created. Start editing the source that you will find at this location: home, theos, theosProjects, [yourAppName]. The three files that you will have to use for your first projects are just these:

  • In the RootViewController.h declare for example a new label adding this line of code between UIViewController brakets

    UILabel *d00rLabel;

  • In the RootViewController.mm implement the new label adding these lines of code before the braket closure of loadView method

      d00rLabel = [[UILabel alloc]
        initWithFrame:CGRectMake(30,0,self.view.frame.size.width,60)];
      d00rLabel.text = @"Grayd00r";
      d00rLabel.backgroundColor = [UIColor yellowColor];
      [self.view addSubview:d00rLabel];
      
  • In the Makefile add the needed FRAMEWORK in the right line. Add Foundation after UIKit CoreGraphics that you will find.

The final step is building your Debian package to publish on Cydia or install directly on your jailbroken device using iFile.

  • Move inside the theosProjects folder with this command from Terminal
    cd ~/theos/theosProjects/[yourAppName]

  • Force to use the iOS5.1 SDK with this command
    export SYSROOT=~/theos/theos/sdks/iPhoneOS5.1.sdk

  • Compile the application and build the Debian package make package.
    You will find the .deb file inside the project folder.

Mobile Substrate Tweaks

This quick tutorial requires that you already set up theos folder inside your home directory. Please read the first part of the Application Development guide if you don't.

Everytime you want to start to develop a new tweak for jailbroken devices, follow the following steps.

  • Move inside the theosProjects folder with this command from Terminal: cd ~/theos/theosProjects

  • Create a new project with this command from Terminal: ~/theos/theos/bin/nic.pl

  • Answer to the questions provided by New Instance Creator (NIC): choose 5 to create a Tweak, give the name of the Tweak, write com.d00r.[yourTweakName] as package name, your name as Author, add a filter to specify where the tweak should be active (for example com.springboard.com) and finally don' specify any application to terminate just pressing ENTER.

Your project has been created. Start editing the source that you will find at this location: home, theos, theosProjects, [yourTweakName]. The three files that you will have to use for your projects are just these:

  • In the [yourTweakName].plist you will find the filter you specified during the project creation and you can eventually modify it.

  • In the Tweak.xm modify the content of any method to create your tweak. Delete all the content and copy this example

    #import <SpringBoard/SpringBoard.h>
    #import <UIKit/UIKit.h>
    %hook SBApplicationIcon
    -(void)launch{
      UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"d00r Tweak"
        message:@"App starts" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
      [alert show];
      [alert release];
      %orig;
    }
    %end
    
  • In the Makefile write the following line after the TWEAK_NAME row to add the UIKit Framework, or others you need:

    [yourTweakName]_FRAMEWORKS = UIKit

The final step is building your Debian package to publish on Cydia or install directly on your jailbroken device using iFile.

  • Move inside the theosProjects folder with this command from Terminal:
    cd ~/theos/theosProjects/[yourTweakName]

  • Force to use the iOS5.1 SDK with this command
    export SYSROOT=~/theos/theos/sdks/iPhoneOS5.1.sdk

  • Compile the tweak and build the Debian package: make package.
    You will find the .deb file inside the project folder.

Meet the Developers

This project is brought to you by:

Contributors and Credits

But the work of many people is making Grayd00r better and better:

  • iPhone Dev Team, pod2g, planetbeing, saurik, pimskeks, p0sixninja, MuscleNerd and xvolks:
    for cinject tool used as vector for Grayd00r Setup application

  • Gianmarco: graphic designer for icons

  • Saeed Rezvan: UI theming

  • Ashikase: for providing ShowCase source code

  • Ryan Petrich: inspired notification center tweak providing the FastBlurredNotificationCenter source code

  • iHeli0s: for his Safari-UniBar tweak

Discuss with the community