0

I would like to know how to make a basic "Hello, World!" MobileSubstrate tweak.

Hamid Pourjam
  • 20,441
  • 9
  • 58
  • 74

3 Answers3

2

Getting Started will help you setup the environment for developing. This IPF will help you understand building your tweak/app, and you can look at my github for code examples.

EvilPenguin
  • 535
  • 6
  • 9
0

I wrote an answer in another thread which apparently was pretty much liked by some people; have a look at it here.

Still, @EvilPenguin's answer is entirely right, mine just explains a couple of things here and there, but it ends up redirecting you to the same place.

Community
  • 1
  • 1
Matoe
  • 2,742
  • 6
  • 33
  • 52
0
#import <SpringBoard/SpringBoard.h> // for SBScreenFlash
%hook SBAwayLockBar
-(void)unlock // the method you’re hooking
{
 %orig;
[[%c(SBScreenFlash) sharedInstance] flash];
}
%end

If you unlock your Device using the Slider it'll screenshot your Screen. Its not a good Tweak, but it was all you asked for.

 #import <SpringBoard/SpringBoard.h> // for SBScreenFlash
    %hook SBAwayLockBar
    -(void)unlock // the method you’re hooking
    {
     %orig;
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hello World!" message:@"my first Tweak" delegate:nil cancelButtonTitle:@"Cool" otherButtonTitles:nil];
[alert show];
[alert release];
    }
    %end

This will prompt an alertview to you saying hello world ;) Have fun

Janosch Hübner
  • 1,584
  • 25
  • 44