+ [self yieldToSelector:@selector(system) withObject:@"http://www.hipsterwave.com/tag/cydia/"];
+
+ [self setStatusBarShowsProgress:NO];
+ [self removeProgressHUD:hud_];
+ hud_ = nil;
+
+ if (ExecFork() == 0) {
+ execlp("launchctl", "launchctl", "stop", "com.apple.SpringBoard", NULL);
+ perror("launchctl stop");
+ }
+
+ return;
+ }
+
+ if (Role_ == nil)
+ [self askForSettings];
+
+ _trace();
+ overlay_ = [[UIView alloc] initWithFrame:[underlay_ bounds]];
+
+ CGRect screenrect = [UIHardware fullScreenApplicationContentRect];
+ book_ = [[CYBook alloc] initWithFrame:CGRectMake(
+ 0, 0, screenrect.size.width, screenrect.size.height - 48
+ ) database:database_];
+
+ [book_ setDelegate:self];
+
+ [overlay_ addSubview:book_];
+
+ NSArray *buttonitems = [NSArray arrayWithObjects:
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"buttonBarItemTapped:", kUIButtonBarButtonAction,
+ @"home-up.png", kUIButtonBarButtonInfo,
+ @"home-dn.png", kUIButtonBarButtonSelectedInfo,
+ [NSNumber numberWithInt:1], kUIButtonBarButtonTag,
+ self, kUIButtonBarButtonTarget,
+ @"Cydia", kUIButtonBarButtonTitle,
+ @"0", kUIButtonBarButtonType,
+ nil],
+
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"buttonBarItemTapped:", kUIButtonBarButtonAction,
+ @"install-up.png", kUIButtonBarButtonInfo,
+ @"install-dn.png", kUIButtonBarButtonSelectedInfo,
+ [NSNumber numberWithInt:2], kUIButtonBarButtonTag,
+ self, kUIButtonBarButtonTarget,
+ UCLocalize("SECTIONS"), kUIButtonBarButtonTitle,
+ @"0", kUIButtonBarButtonType,
+ nil],
+
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"buttonBarItemTapped:", kUIButtonBarButtonAction,
+ @"changes-up.png", kUIButtonBarButtonInfo,
+ @"changes-dn.png", kUIButtonBarButtonSelectedInfo,
+ [NSNumber numberWithInt:3], kUIButtonBarButtonTag,
+ self, kUIButtonBarButtonTarget,
+ UCLocalize("CHANGES"), kUIButtonBarButtonTitle,
+ @"0", kUIButtonBarButtonType,
+ nil],
+
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"buttonBarItemTapped:", kUIButtonBarButtonAction,
+ @"manage-up.png", kUIButtonBarButtonInfo,
+ @"manage-dn.png", kUIButtonBarButtonSelectedInfo,
+ [NSNumber numberWithInt:4], kUIButtonBarButtonTag,
+ self, kUIButtonBarButtonTarget,
+ UCLocalize("MANAGE"), kUIButtonBarButtonTitle,
+ @"0", kUIButtonBarButtonType,
+ nil],
+
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"buttonBarItemTapped:", kUIButtonBarButtonAction,
+ @"search-up.png", kUIButtonBarButtonInfo,
+ @"search-dn.png", kUIButtonBarButtonSelectedInfo,
+ [NSNumber numberWithInt:5], kUIButtonBarButtonTag,
+ self, kUIButtonBarButtonTarget,
+ UCLocalize("SEARCH"), kUIButtonBarButtonTitle,
+ @"0", kUIButtonBarButtonType,
+ nil],
+ nil];
+
+ toolbar_ = [[UIToolbar alloc]
+ initInView:overlay_
+ withFrame:CGRectMake(
+ 0, screenrect.size.height - ButtonBarHeight_,
+ screenrect.size.width, ButtonBarHeight_
+ )
+ withItemList:buttonitems
+ ];
+
+ [toolbar_ setDelegate:self];
+ [toolbar_ setBarStyle:1];
+ [toolbar_ setButtonBarTrackingMode:2];
+
+ int buttons[5] = {1, 2, 3, 4, 5};
+ [toolbar_ registerButtonGroup:0 withButtons:buttons withCount:5];
+ [toolbar_ showButtonGroup:0 withDuration:0];
+
+ for (int i = 0; i != 5; ++i)
+ [[toolbar_ viewWithTag:(i + 1)] setFrame:CGRectMake(
+ i * 64 + 2, 1, 60, ButtonBarHeight_
+ )];
+
+ [toolbar_ showSelectionForButton:1];
+ [overlay_ addSubview:toolbar_];
+
+ [UIKeyboard initImplementationNow];
+ CGSize keysize = [UIKeyboard defaultSize];
+ CGRect keyrect = {{0, [overlay_ bounds].size.height}, keysize};
+ keyboard_ = [[UIKeyboard alloc] initWithFrame:keyrect];
+ [overlay_ addSubview:keyboard_];
+
+ [underlay_ addSubview:overlay_];
+
+ [self reloadData];
+
+ [self sectionsView];
+ changes_ = [[ChangesView alloc] initWithBook:book_ database:database_];
+ search_ = [[SearchView alloc] initWithBook:book_ database:database_];
+
+ manage_ = (ManageView *) [[self
+ _pageForURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"manage" ofType:@"html"]]
+ withClass:[ManageView class]
+ ] retain];
+
+#if RecyclePackageViews
+ details_ = [[NSMutableArray alloc] initWithCapacity:4];
+ [details_ addObject:[self _packageView]];
+ [details_ addObject:[self _packageView]];
+#endif
+
+ PrintTimes();
+
+ _setHomePage(self);