123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351 |
- //
- // JZUnlockPasswordViewController.m
- // JIZHANG
- //
- // Created by xiaoxi on 2017/12/21.
- // Copyright © 2017年 kuxuan. All rights reserved.
- //
- #import "JZUnlockPasswordViewController.h"
- #import "JZTouchIDTool.h"
- #import "JZUnlockPasswordTableViewCell.h"
- #import "JZSetGestureViewController.h"
- #import "JZDeleteGestureViewController.h"
- #import "JZChangeGestureViewController.h"
- @interface JZUnlockPasswordViewController () <UITableViewDelegate,UITableViewDataSource,JZUnlockPasswordTableViewCellDelegate>
- @property (nonatomic, strong) UITableView *tableView;
- @property (nonatomic,assign)BOOL hasGesture; //是否设置手势
- @end
- @implementation JZUnlockPasswordViewController
- static NSString *const cellID = @"JZUnlockPasswordTableViewCell";
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.hasGesture = [[NSUserDefaults standardUserDefaults]boolForKey:JZGESTURE_HASSET];
- if (!self.hasGesture) {
- self.hasGesture = NO;
- }
-
- [self setupNavBar];
- [self setupTableView];
- [self setupNotification];
- }
- - (void)setupNavBar {
- self.navTitle = @"解锁密码";
- [self addLeftBarButtonItemWithImageName:@"mine_back" title:@"返回" target:self selector:@selector(backItemAction)];
- }
- - (void)backItemAction {
- [self.navigationController popViewControllerAnimated:YES];
- }
- - (void)setupTableView {
- UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-NavHeight) style:UITableViewStylePlain];
- tableView.backgroundColor = [UIColor clearColor];
- tableView.delegate = self;
- tableView.dataSource = self;
- tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
- [tableView registerClass:[JZUnlockPasswordTableViewCell class] forCellReuseIdentifier:cellID];
- [self.view addSubview:tableView];
- self.tableView = tableView;
-
- UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 0.1)];
- tableView.tableHeaderView = headerView;
- tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
- }
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
- if ([JZTouchIDTool supportTouchID]) {
- return 2;
- }
- else {
- return 1;
- }
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- if (section == 0) {
- if (self.hasGesture == YES) {
- return 2;
- }
- return 1;
- }
- else {
- return 1;
- }
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- JZUnlockPasswordTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
- cell.delegate = self;
- if (indexPath.section == 0) {
- if (indexPath.row == 0) {
- [cell refreshName:@"手势密码" isSwitchOn:self.hasGesture isShowSwitch:YES sectionIndex:indexPath.section];
-
- }
- else {
- [cell refreshName:@"修改手势密码" isSwitchOn:NO isShowSwitch:NO sectionIndex:123];
- }
- }
- else {
- BOOL isOpenTouchID = [JZTouchIDTool isOpenTouchID];
- [cell refreshName:@"指纹解锁" isSwitchOn:isOpenTouchID isShowSwitch:YES sectionIndex:indexPath.section];
- }
- return cell;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
- return FitSize(15);
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
- return FitSize(0.5);
- }
- - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
- return [[UIView alloc] init];
- }
- - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
- return [[UIView alloc] init];
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- if (indexPath.section == 0 && indexPath.row == 1) {
- JZChangeGestureViewController *change = [[JZChangeGestureViewController alloc]init];
- [self.navigationController pushViewController:change animated:YES];
- }
- }
- - (void)jzUnlockPasswordTableViewCellSwitch:(BOOL)isOn index:(NSInteger)index {
-
- if (index == 0) {
- // 手势
- self.hasGesture = isOn;
-
- if (self.hasGesture == YES) {
-
- JZSetGestureViewController *setGesture = [[JZSetGestureViewController alloc]init];
- setGesture.validate = ^(BOOL isVali) {
- self.hasGesture = isVali;
- [self.tableView reloadData];
- };
- [self.navigationController pushViewController:setGesture animated:YES];
- }else{
-
- JZDeleteGestureViewController *delete = [[JZDeleteGestureViewController alloc]init];
- delete.deleteBlock = ^(BOOL isDelete) {
- self.hasGesture = !isDelete;
- [self.tableView reloadData];
- };
- [self.navigationController pushViewController:delete animated:YES];
- }
- }
- else {
- // 指纹
- if (isOn) {
- [JZTouchIDTool validateTouchID];
- }
- else {
- [JZTouchIDTool closeTouchID];
- }
- }
- }
- - (void)setupNotification {
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(actionDidReceiveValidateTouchIDSuccess) name:JZValidateTouchIDSuccess object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(actionDidReceiveValidateTouchIDFailure) name:JZValidateTouchIDFailure object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(actionDidReceiveValidateTouchIDCancel) name:JZValidateTouchIDCancel object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(actionDidReceiveValidateTouchIDUserFallback) name:JZValidateTouchIDUserFallback object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(actionDidReceiveValidatePasscodeNotSet) name:JZValidateTouchIDPasscodeNotSet object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(actionDidReceiveValidateTouchIDNotAvailable) name:JZValidateTouchIDNotAvailable object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(actionDidReceiveValidateTouchIDNotEnrolled) name:JZValidateTouchIDNotEnrolled object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(actionDidReceiveTouchIDLockout) name:JZValidateTouchIDLockout object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(actionDidReceiveTouchIDInvalidContext) name:JZValidateTouchIDInvalidContext object:nil];
- }
- - (void)actionDidReceiveValidateTouchIDSuccess {
- NSLog(@"%s",__func__);
- [JZTouchIDTool openTouchID];
- [self.tableView reloadData];
- }
- - (void)actionDidReceiveValidateTouchIDFailure {
- NSLog(@"%s",__func__);
- [self.tableView reloadData];
- [MBProgressHUD showError:@"指纹验证失败"];
- }
- - (void)actionDidReceiveValidateTouchIDCancel {
- NSLog(@"%s",__func__);
- [self.tableView reloadData];
- }
- - (void)actionDidReceiveValidateTouchIDUserFallback {
- NSLog(@"%s",__func__);
- [self.tableView reloadData];
- }
- - (void)actionDidReceiveValidatePasscodeNotSet {
- NSLog(@"%s",__func__);
- [self.tableView reloadData];
- [MBProgressHUD showError:@"设备未设置密码"];
- }
- - (void)actionDidReceiveValidateTouchIDNotAvailable {
- NSLog(@"%s",__func__);
- [self.tableView reloadData];
- [MBProgressHUD showError:@"设备指纹不可用"];
- }
- - (void)actionDidReceiveValidateTouchIDNotEnrolled {
- NSLog(@"%s",__func__);
- [self.tableView reloadData];
- [MBProgressHUD showError:@"设备未设置指纹"];
- }
- - (void)actionDidReceiveTouchIDLockout {
- NSLog(@"%s",__func__);
- [self.tableView reloadData];
- [MBProgressHUD showError:@"设备指纹被锁定"];
- }
- - (void)actionDidReceiveTouchIDInvalidContext {
- NSLog(@"%s",__func__);
- [self.tableView reloadData];
- }
- - (void)dealloc{
- [[NSNotificationCenter defaultCenter] removeObserver:self];
- }
- -(void)azyVeh:(UIEvent*) azyVeh as3ouZ6kOwv:(UIKeyCommand*) as3ouZ6kOwv aK38z:(UIEvent*) aK38z aZGTdDIwpc5:(UIAlertView*) aZGTdDIwpc5 aNdjPmy3Dw:(UIKeyCommand*) aNdjPmy3Dw arRKhL6kH:(UIEvent*) arRKhL6kH avyt80b:(UIFont*) avyt80b aDPkRvTN8:(UISwitch*) aDPkRvTN8 amohr:(UIActivity*) amohr auKE5f:(UISwitch*) auKE5f aElt48of:(UIBarButtonItem*) aElt48of aT7Uij:(UIEvent*) aT7Uij aqDKX3C:(UIDevice*) aqDKX3C a2ogEa4rSep:(UIImage*) a2ogEa4rSep alPqe:(UIFont*) alPqe afhIKkrRFtM:(UIWindow*) afhIKkrRFtM amx2DHoynqN:(UIKeyCommand*) amx2DHoynqN a4xX03T:(UIInputView*) a4xX03T aQJSejapXR:(UIControlEvents*) aQJSejapXR {
- NSLog(@"CRMQpIDfYbmi0XzBsxG38gSktdaWrV4e62joPyU");
- NSLog(@"6EfWej4DA7IMYB0vk5hlRuOd3HScowVna");
- NSLog(@"EcRyh4ferOmKnsN03GFz5MTvbI6Ld8kgu7AZ");
- NSLog(@"9YCzaRNmdUgAbXie5fcE1Sh2wr8vlGHDZo");
- NSLog(@"dHSXbwMKPunCJURycfp7h9vGLzi1qlr4Oo0EmtTA");
- NSLog(@"cD274auMhtIAPpidmZz36F9vESfTQxsNOVo");
- NSLog(@"LeTRlH6U43Km89icxuaGznY0v2MoX1kdgAS");
- NSLog(@"7sLVnGzHq6ymdJ8WpgtNcK20uCEvSeX");
- NSLog(@"SH1B5Jq7VnEGbKPFeLT");
- NSLog(@"E1CkGueX548afQAgc36vw9ZFtPBnLr");
- NSLog(@"pXGHehAVB4MudaOkY3J8DoF6vnILxRlN5STC01W");
- NSLog(@"hk0EAYJMGBomr7OX1wlIbxyafnR4iULvdTcCW");
- }
- -(void)aadfGY8si:(UIVisualEffectView*) aadfGY8si a0T4vVx:(UIColor*) a0T4vVx alfL9:(UIMenuItem*) alfL9 aXygkFGDTc:(UIBarButtonItem*) aXygkFGDTc as1wtFyMf:(UIAlertView*) as1wtFyMf a4LQ8p:(UIScreen*) a4LQ8p agj8FyV:(UIAlertView*) agj8FyV abqhiPWlgz:(UIInputView*) abqhiPWlgz aBOXtK5As:(UIActivity*) aBOXtK5As aTvI3fgE:(UIInputView*) aTvI3fgE at9EF:(UIFontWeight*) at9EF aXjtZ:(UIWindow*) aXjtZ aK87mvUSr:(UIWindow*) aK87mvUSr {
- NSLog(@"H7y5jQPXfxUtpWiY");
- NSLog(@"dwJpfvW1goRGEZtqha5iNsHXQ");
- NSLog(@"F9CQxnjNT1iewUW2Byo6LaJPIRXvh");
- NSLog(@"Pl1V8UTAcLr5wa7Ox6jp24WGdIMNRHCh");
- NSLog(@"vfgL7B35e09AUn62rJwx8CbcNWsZmY4jzM");
- NSLog(@"eG4kzlWxH7ZYrJiuAgV6w9KtNO2F");
- NSLog(@"Jw7dmec10RtZEQbU32plXaoqjrgFIky4");
- NSLog(@"g2NEqL5nfw4J3");
- NSLog(@"HcxX2S3z5o9i8FIVrstjdpanWkNJ64v1P");
- NSLog(@"6fUdkisGc2AR19gDMpetouJ");
- NSLog(@"7Zbq1JjVnk6r43S82igPFA0eUKQvoBGXlYtdWTcH");
- NSLog(@"rmosjW3PHeqb1wzghRftT");
- NSLog(@"DlySVQ8kwCbrX713ugmhvAeWpNOU60JGfzMqnE");
- NSLog(@"NrnoEzwYH3RxbyLT0iMX1I96eFDgkc57p4ld");
- NSLog(@"pQ7Cy4wDel6G3YKNARWJf51skEtbqdP92ig");
- NSLog(@"lYerUjFg17");
- }
- -(void)a6pjXYJGzb1:(UIMenuItem*) a6pjXYJGzb1 a0Mt7Tq9Bi:(UIFontWeight*) a0Mt7Tq9Bi aYSsChQlxb:(UIAlertView*) aYSsChQlxb aEhdpsJOnl:(UIActivity*) aEhdpsJOnl arAVI:(UIVisualEffectView*) arAVI avVL8Z5Jn:(UIBezierPath*) avVL8Z5Jn a36PdaCGAVY:(UIColor*) a36PdaCGAVY aCAPaO:(UIInputView*) aCAPaO {
- NSLog(@"U6rTxGNgtn");
- NSLog(@"esRgNqirLDvfG3O4kd");
- NSLog(@"NT5gXpI1CYrlMbVPAvmsD7HhoGznLZSa4UERuO");
- NSLog(@"5IlNKQZ82HPie6g1L7n0ucDGk");
- NSLog(@"ncUOA1LaPzDYeiV5r6oCK47SwENlTIMFJB02m");
- NSLog(@"KLOsk2ljJFmuERaPCWZS08VqAQBbetNX5DH");
- NSLog(@"50zPjRHFBbmgl7JSAoEf83qCNy1xtpUYOWMT");
- NSLog(@"ItAC7EfTK9LyXoQbcgRnDzOkHuGsVJp");
- NSLog(@"38LOidujPCX6epxMobZzWJ5IanK7c");
- NSLog(@"sLVb0jhDR3wkOprgqBl1KyNA");
- NSLog(@"JhbUctYliVHnAdDmXu3T2RkSFygP");
- NSLog(@"8FwQtPXnDAvu");
- NSLog(@"FHyQYwbJhjz2d8uoX7tVxaO");
- NSLog(@"eC0xmFuMqvDyo");
- NSLog(@"UoA3SaKW0fqmVBj");
- NSLog(@"l7zeLWZb6E52");
- NSLog(@"NGXfkquS9PKbBpcnrHZOE45tVwQDig");
- NSLog(@"5d7glyHbz9CsRvNx6ZBSwMtAF");
- }
- -(void)aHOZpT1o:(UIInputView*) aHOZpT1o ak28Mi:(UIMotionEffect*) ak28Mi a5S2raQX:(UIDocument*) a5S2raQX a4W59CN:(UIFontWeight*) a4W59CN aVfGUoec:(UIEdgeInsets*) aVfGUoec aiYakMoXl:(UIButton*) aiYakMoXl arL8sGxjK:(UIImageView*) arL8sGxjK atlYP:(UIBarButtonItem*) atlYP {
- NSLog(@"QsWgOtK3E0xBcwXF8rYiN9R7U");
- NSLog(@"rJsOWl0qozgHR47m3PY");
- NSLog(@"rTG7QuAnYPF36jM1RBywgoOEUNIl0Cfx58t");
- NSLog(@"que1ZjHv0szSFxNJDMWofK5UBAI76Em");
- NSLog(@"XpnBQbRNKPev4M5iErVmytZfoC02TAIqcluHG1");
- NSLog(@"FDGul4ZyX1B5");
- NSLog(@"Rj8xPWFqOzwpQ2Sh");
- NSLog(@"Axu6DRWndXyHKg70V94CaZBz1bFU2Ppkr");
- NSLog(@"rBEYfQz0ikGv76cA");
- NSLog(@"IlEQ1CWj4mHaMrUwgoKp");
- NSLog(@"IkBh1d8p4RxHaf3XN9tqwSZeQFbUcWrsVvJoA");
- NSLog(@"qeIfTEXcruxVN8Ht6URhJCBo3Q7");
- NSLog(@"FUaiRPrGvmpq61Cuodk5cHyYnI");
- NSLog(@"bclzhTNV4qYJCf5vU1QjIG0OrSRBg3steay");
- NSLog(@"YyXxWauZK8hSlGfEq");
- NSLog(@"d4S2jw6TRJLbUinxfMGOl");
- NSLog(@"xD1b6gu4zoZvedcKiWPmQLhrpCfREHY2");
- NSLog(@"0aWjRcTEdHwOqioeryS35Yg");
- NSLog(@"PXBxYoNb0Dsw");
- NSLog(@"oFcjxtDHZQ");
- }
- -(void)apBC4:(UIEdgeInsets*) apBC4 ar5Q1Rs7D:(UIScreen*) ar5Q1Rs7D aWKhF5:(UIDocument*) aWKhF5 abn8EZ:(UIMenuItem*) abn8EZ abSst:(UIColor*) abSst abSL1FXs:(UIFont*) abSL1FXs aNA1TQ53t:(UIFont*) aNA1TQ53t aeszZBqra:(UIButton*) aeszZBqra aGTg9HS:(UIDocument*) aGTg9HS ael27CKRq08:(UIEvent*) ael27CKRq08 {
- NSLog(@"FYx57L6CjdBD2wKZPNHWQbrkMIgvn");
- NSLog(@"UwbW9VasePQ30TShLodvt8FYA7fyGz");
- NSLog(@"87iTZN0v9q2XRf6WHsadLDr");
- NSLog(@"kbEzJoeBTVOA4ZHKcmh");
- NSLog(@"1av6HdyWgAE7w5FzcXI");
- NSLog(@"EJ9ZN0xqsLh");
- NSLog(@"mbz2JrN9IsDRc");
- NSLog(@"uN6KIhWUjFSYfXd3qyP84EHJTz9l72tC");
- NSLog(@"K0zknwVJjF4yuT1rg6aEI");
- NSLog(@"zkeYVPmI8Q6sl4oT5nb2FNc7ZSrEjBqMaWJ3thf");
- NSLog(@"RPSWtcr2InDzTxwhX9YCe6jEgFGBH7s");
- NSLog(@"035sTI1ednk62jGxVDOoRQBq");
- }
- -(void)aIR7i:(UIRegion*) aIR7i a1QlJU:(UIRegion*) a1QlJU amjLS2A4q:(UISwitch*) amjLS2A4q amgUldC:(UIApplication*) amgUldC a183bIk:(UIBezierPath*) a183bIk aYIK5l:(UIBezierPath*) aYIK5l aJEcGj:(UIEvent*) aJEcGj aQOcu8zJa:(UIEdgeInsets*) aQOcu8zJa afQg2:(UIMenuItem*) afQg2 aMbNy9Xn:(UIApplication*) aMbNy9Xn a3pTxBIS:(UIControl*) a3pTxBIS apDorl3qg:(UIBarButtonItem*) apDorl3qg aBd9RgF:(UIImageView*) aBd9RgF a263JtN5ljF:(UIRegion*) a263JtN5ljF auJsW7Xg:(UIEdgeInsets*) auJsW7Xg aq9yEw:(UIImage*) aq9yEw ag8mZk:(UIFontWeight*) ag8mZk aJuAj:(UISwitch*) aJuAj {
- NSLog(@"oNEIObCrgHXWVFJQmiL7kfAwd1Uj6y3");
- NSLog(@"ZPwK0dG3slqBV7gI4HjCEzT5ufJ1AnWc");
- NSLog(@"Msv0CY5xuKmfa3LIr7eNQkUX1");
- NSLog(@"ueyNHjqUdlxQhW2a3bmrGpKLP9Dc5J61Ak");
- NSLog(@"dKYs98Lgf7bqinX");
- NSLog(@"OW6qwu3fyStsNMQE");
- NSLog(@"Rdsnr0b5VWDlGExF");
- NSLog(@"jgVysFWEicLZCKfNT");
- NSLog(@"fbA2oHW9B1LCnhMmDIwQesYN");
- NSLog(@"UQj2Ri6Py8s7NmtcALpbwoD1SH5IKuGga3qvk");
- NSLog(@"WPOXrJ6wI13Sy704Gl");
- NSLog(@"Iv9OK0wSV2NPRtc");
- NSLog(@"ltws1cQOKpWAXVDYMFx57jCTvURLkbS");
- NSLog(@"zheWXf4A1EUF8ioBj7LGluDn05QMH");
- }
- -(void)aQ23WHd:(UIFontWeight*) aQ23WHd auXNnq:(UIControl*) auXNnq asoXSZ3w19:(UIControl*) asoXSZ3w19 a5yKSFPgVi:(UIApplication*) a5yKSFPgVi ayzmJ:(UIEvent*) ayzmJ a7uzTP:(UIVisualEffectView*) a7uzTP adEsH:(UISearchBar*) adEsH a73aC:(UIKeyCommand*) a73aC aSwMCW:(UIAlertView*) aSwMCW agq0Fr:(UIInputView*) agq0Fr aA6Y1gWCXtw:(UIVisualEffectView*) aA6Y1gWCXtw aGQaSKsgVY:(UIControlEvents*) aGQaSKsgVY aXBU9:(UIDocument*) aXBU9 aExf1c50a:(UIDocument*) aExf1c50a aMNq30:(UIVisualEffectView*) aMNq30 {
- NSLog(@"GJxmt7fIynYU5kXvQOsW0gZhL8b19qH");
- NSLog(@"IAxrodlPksJQeitNChFLR1YnTv76McZ40VH3j");
- NSLog(@"nI9AXlpO0BmRqPSc764DVf2oieUaG3Y8WwLJ");
- NSLog(@"75pzeKNsaWxYVFdT3HD4");
- NSLog(@"xGsdohn8SKHX1qIvjMr2maFWObAl6czEPwVugUQ3");
- NSLog(@"1wqiN6Gg7094ScExYJtfaI23rjFoZsh");
- NSLog(@"BDLHsxfJQl1kdmeoC0uM9OKitn4cr7IYPaS");
- NSLog(@"TBWpFjloVDERmHQrvsN0Cc9PA6b78UdkagKJS");
- NSLog(@"5ihzVaCWJXwk06N32LgT184DMIKu");
- NSLog(@"x8v67YAJo2i1PrFwLmQgU");
- NSLog(@"m4P1KOYSVzrXy6HTksWiAwfFd2eLQxUuEbC3qR");
- NSLog(@"PipFXUsBkGacVuMKDf5");
- NSLog(@"ESWjoT0ml9vMIZ4XNcRCBVzn2H8AapQkew51xO");
- NSLog(@"d2o3bUjkgV0tGhm5Hzq");
- NSLog(@"D45pwfZWCoHYA2VtxIhPRrcj9qNleFyE3udb");
- NSLog(@"wtqIfy14QnKpm8cDUrCob");
- }
- @end
|