想做一个启动弹窗 按照教程做出来闪退。 是微信的弹窗代码 。 通用弹窗hook怎么写。求指教。。iOS逆向。theos
这是我在一个文章中看到的 实现代码 是微信的。 我应该怎么修改 才能实现 所有app 通用启动弹窗呢
@interface MMUIViewController: UIViewController
- (void)helloWorld;
@end
%hook MMUIViewController
- (void)viewDidAppear:(_Bool)arg1 {
%orig;
[self helloWorld];
}
%new
- (void)helloWorld {
UIAlertController *alertController =({
UIAlertController *al = [UIAlertController alertControllerWithTitle:@"标题" message:@"这是一些信息" preferredStyle:UIAlertControllerStyleAlert];
[al addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:nil]];
al;
});
[self presentViewController:alertController animated:YES completion:nil];
}
%end