I am making an iPhone tweak that will place a respring slider below the power off one. I have found the proper class, I have overridden it and I managed to insert a button that resprings the device when clicked. However, I need to substitute that button with a "Slide to respring" bar, just like the "Slide to power off" above it. How can I do that? Thanks in advance! :)
EDIT: Here's my source code:
#import "substrate.h"
#import <UIKit/UIKit.h>
@interface MultiBar
-(void)action;
@end
static UIButton *button;
static UIView *lockView;
%hook SBPowerDownView
-(void)finishedAnimatingIn
{
lockView = MSHookIvar<UIView *>(self, "_dimView");
button = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
[button addTarget:self action:@selector(action) forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"Respring" forState:UIControlStateNormal];
button.frame = CGRectMake(80,100,160,40);
[lockView addSubview:button];
[button release];
%orig;
}
%new(v@:)
-(void)action
{
[[UIApplication sharedApplication] relaunchSpringBoard];
}
%end