GYBootingProtection icon indicating copy to clipboard operation
GYBootingProtection copied to clipboard

A tool for detecting and repairting continuous launch crash of iOS App

Results 5 GYBootingProtection issues
Sort by recently updated
recently updated
newest added

原文: [《连续启动 crash 自修复技术实现与原理解析》](https://github.com/ChenYilong/iOSBlog/issues/18 ) -------------------------------------------- 思路很好,很轻量级。有个实现上可以优化下,可以降低50%以上误报机率,监听用户手动划掉APP这个事件,其中一些特定场景,是可以获取的。另外对API设计的建议。 ## 优化:降低50%以上误报机率 用户主动kill掉APP分为两种情况: * App在前台时用户手动划掉APP的时候 * APP在后台时划掉APP 第一种场景更为常见,可以通过监听`UIApplicationWillTerminateNotification`来捕获该动作,捕获后恢复计数。第二种情况,无法监听到。但也足以降低50%以上的误报机率。 ## 对API设计的几点优化意见 ### 1. 机制状态应当用枚举来做为API透出 该机制当前所处的状态,比如:NeedFix 、isFixing,建议用枚举来做为API透出。比如: ```Objective-C typedef NS_ENUM(NSInteger, BootingProtectionStatus) { BootingProtectionStatusNormal, /**< APP...

delete Library Directory maybe cause NSUserDefault damage

替换`didFinishLaunchingWithOptions`能检查出crash,但是`applicationDidBecomeActive`还是会正常执行,如果`applicationDidBecomeActive`中有代码crash了,那么永远看不到这个alert提示

``` Objective-C /** * 对于代码构建 UI 的项目一般在 didFinishLaunch 方法中初始化 window, * 想在 swizzling 方法中 present alertController 需要自己先初始化 window 并提供一个 rootViewController */ - (void)presentAlertViewController:(UIAlertController *)alertController { if (![self hasStoryboardInfo]) { self.window...