系统是10.3.3 iphone5c
使用theos进行了一个最简单的hook, 但是没法确认是否成功了, 因为nslog也不输出, alert也不弹…
代码看起来也没错啊, 日志也找不到在哪 在Mac上用console也看不到日志
也安装了 ondeviceconsole…我都怀疑是否执行了, 但是也没法跟踪到.
有没有人可以提供下思路如何来确定这个事呢?
代码如下:
%hook SpringBoard
-(void)applicationDidFinishLaunching:(id)application
{
%orig;
UIAlertView *alert1 = [[UIAlertView alloc] initWithTitle:@"Test"
message:@"Testy test"
delegate:@"self"
cancelButtonTitle:@"Cancel"
otherButtonTitles:nil];
[alert1 show];
[alert1 release];
UIAlertController *alert2 = [UIAlertController alertControllerWithTitle:@"test" message:@"wangyu!!!!" preferredStyle:UIAlertControllerStyleAlert];
[alert2 addAction:[UIAlertAction actionWithTitle:@"sss" style:UIAlertActionStyleCancel handler:nil]];
[[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController:alert2 animated:YES completion:nil];
%log();
NSLog(@"wangyudebug");
printf("wangyudebug");
}
%end