Begin in iOs jailbreak development on your iDevice 3

I made two post (first, second) to begin in iOs jailbreak development on you iDevice. You have some bases and I make a third post to make a new tweak.

This time we will change the action when you press the power button. We will just show a little frame with a custom message.

To begin, you have to create a new tweak project with Theos (instructions in the first post). In this tutorial I put the name PowerInject, but like in the others posts, you can choose the name you want. When you have made this, you can go into iFile and go in the directory of your tweak.

Now open the “Tweak.xm” file. Delete all the text that is in it and copy the following code into this :

#import

%hook SBPoweDownController

-(void)orderFont {
UIAlertView *powerinjectAlert = [[UIAlertView alloc] initWithTitle:@"PowerInject" message:@"You can't power off your iDevice with this method"
delegate:self cancelButtonTitle:nil
otherButtonTitles:@"Awwwww :"(", nil];
[powerInjectAlert show];
[powerInjectAlert release];
}
%end

Go back into the Terminal and compile the tweak. Now when you want to turn off your iDevice with the power button, you can’t and you’ll have a beautiful message 🙂 .

The original code and idea of this tweak are from ReverseEffect.

Advertisements

Begin in iOs jailbreak development on your iDevice 2

I made a post which explain how to make a basic tweak that changes the color of the screenshot. Now, if you have a good knowledge in Objective-c, you can make others (and better) tweaks.

When you want to make a tweak, you hook a system file to inject a new code to be run. You can hook a lot of different files that make a lot of different things. But to hook a file, you have to know his name and the methods that are in it.

The files are in .h, you can find them in /var/sdk/usr/local/include. The most you will normally use are in /var/sdk/usr/local/include/SpringBoard. To open a file, just tap on it and choose “Text editor” or maybe it will be open without asking that. When you are in it, you can see all the methods (-(void)…).

In the first post, we made a tweak that changes the color of the screenshot. The second line of the code was :

%hook SBScreenFlash

Then we put :
-(void)flashColor:(UIColor*)color{

So we were working on the method -(void)flashColor:(UIColor*)color; that you can see in the file SBScreenFlash.h.

Now you can search into the files (the names are really easy to understand, I mean you understand easily what the file do and it’s the same for the metods).

Enjoy jailbreak development.

Begin in iOs jailbreak development on your iDevice 1

You want to begin in iOs jailbreak but you don’t know how? You want to make tweaks and jailbreak apps? You want to do all this things but you don’t have a Mac? So here’s the right place to begin.

Before beginning to read this post, you have to know that it’s better (and recommended) to have a good knowledge in Objective-C if you want to do better tweaks. But you will learn by yourslef too.

Required :

  • A jailbroken iDevice
  • MobileTerminal installed on it
  • iFile installed on it
  • Theos installed on it (tutorial here).
  • Knowledge in Objective-c

Now that you have all these things on your iDevice, we can start.

Now open the MobileTerminal app.
Type : su
Type your ssh password (default password is “alpine” wihtout the “).
Touch the “return” button.
Type : $THEOS/bin/nic.pl
Touch the “return” button.
Now you have to choose what you want to do. In this tutorial we will do a little tweak.
Type : choose phone/tweak (put the number that is between the [ ] )
Touch the “return” button.
Now you choose a project name (BlueFlash for example).
Now the package name (com.devsk0re.blueflash, but you can put your dev name or what you want, but in this form extension.whatyouwant.yourtweakname).
Now you enter the maintainer name (you).
Now type com.apple.springboard.
Your tweak is ready to be written.

Close the MobileTerminal application and open iFile. Go into this directory :
/var/mobile/yourtweakname.
There’s some file. Go into the file called “Tweak.xm”.
Remove all what’s written in it.

Now copy this in the file :
#import

%hook SBScreenFlash

-(void)flashColor:(UIColor*)color {
%orig([UIColor blueColor]);
}

%end

After this, save and close the file “Tweak.xm” and open the file “MakeFile”. If all was done right, you should have the following lines :

inclue theos/makefile/common.mk

TWEAK_NAME = BlueFlash (if you put an other name, there will be the name you choose)
BlueFlash_FILES = Tweak.xm

include $(THEOS_MAKE_PATH)/tweak.mk

Add the following line after BlueFlash_FILES = Tweak.xm :

BlueFlash_FRAMEWORKS = UIKit

Now save the file and go into MobileTerminal. Type “su”, your password and then type :
cd your_folder_name
(You can see your folder name in iFile)

Then type :
make package install

Press the “return” button and wait, it will respring and you will have a blue flash for the screenshot instead of white.