-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathIPARAppDelegate.m
52 lines (43 loc) · 2.63 KB
/
IPARAppDelegate.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#import "IPARAppDelegate.h"
#import <Foundation/Foundation.h>
#import "./Controllers/IPARLoginScreenViewController.h"
#import "./Utils/IPARUtils.h"
#import "./Controllers/IPARSearchViewController.h"
#import "./Controllers/IPARDownloadViewController.h"
#import "./Controllers/IPARAccountAndCreditsController.h"
#import "./Extensions/IPARConstants.h"
@implementation IPARAppDelegate
- (void)applicationDidFinishLaunching:(UIApplication *)application {
_window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
//[self basicSanity];
if ([[IPARUtils getKeyFromFile:kAuthenticatedKeyFromFile defaultValueIfNil:@"NO"] isEqualToString:@"YES"]) {
IPARSearchViewController *searchVC = [[IPARSearchViewController alloc] init];
UINavigationController *searchNC = [[UINavigationController alloc] initWithRootViewController:searchVC];
IPARDownloadViewController *downloadVC = [[IPARDownloadViewController alloc] init];
UINavigationController *downloadNC = [[UINavigationController alloc] initWithRootViewController:downloadVC];
IPARAccountAndCredits *accountVC = [[IPARAccountAndCredits alloc] init];
UINavigationController *accountNC = [[UINavigationController alloc] initWithRootViewController:accountVC];
UITabBarController *tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers = @[searchNC, downloadNC, accountNC];
self.window.rootViewController = tabBarController;
} else {
_rootViewController = [[UINavigationController alloc] initWithRootViewController:[[IPARLoginScreenViewController alloc] init]];
_window.rootViewController = _rootViewController;
}
[_window makeKeyAndVisible];
}
// Not needed..
// - (void)basicSanity {
// NSString *s = [IPARUtils sha256ForFileAtPath:kIpatoolScriptPath];
// AlertActionBlockWithTextField alertBlockConfirm = ^(UITextField *textField) {
// exit(0);
// };
// if (s == nil) {
// [IPARUtils presentDialogWithTitle:kIPARangerErrorHeadline message:@"ipatool file was not found inside resources directory!" hasTextfield:NO withTextfieldBlock:nil
// alertConfirmationBlock:alertBlockConfirm withConfirmText:@"Exit IPARanger" alertCancelBlock:nil withCancelText:nil presentOn:self];
// } else if (![s isEqualToString:kSha256verification]) {
// [IPARUtils presentDialogWithTitle:kIPARangerErrorHeadline message:@"Could not verify the integrity of files" hasTextfield:NO withTextfieldBlock:nil
// alertConfirmationBlock:alertBlockConfirm withConfirmText:@"Exit IPARanger" alertCancelBlock:nil withCancelText:nil presentOn:self];
// }
// }
@end