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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s