这个调整应该用一个视图覆盖锁屏(确实发生了),并在视图中添加了一个“iOS”按钮(没有)。这是我的代码:
#import <UIKit/UIKit.h>
#import <SpringBoard/SpringBoard.h>
@interface Themos
-(void)unlock;
@end
%hook SpringBoard
-(void)applicationDidFinishLaunching:(id)application
{
%orig;
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(10,10,80,30)];
[button addTarget:self action:@selector(unlock:) forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"iOS" forState: UIControlStateNormal];
UIWindow* window = [UIApplication sharedApplication].keyWindow;
UIView *polygonView = [[UIView alloc] initWithFrame: CGRectMake ( 0, 0, 640, 960)];
polygonView.backgroundColor = [UIColor redColor];
[window addSubview:polygonView];
[polygonView addSubview:button];
[window makeKeyAndVisible];
[polygonView release];
[button release];
}
%new(v@:)
-(void)unlock
{
[self unlockWithSound:YES];
}
%end
提前致谢!:)