+ [self yieldToSelector:@selector(system:) withObject:@"/usr/libexec/cydia/free.sh"];
+
+ [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]];
+ [overlay_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
+
+ CGRect screenrect = [UIHardware fullScreenApplicationContentRect];
+
+ book_ = [[CYBook alloc] initWithFrame:CGRectMake(
+ 0, 0, screenrect.size.width, screenrect.size.height - 48
+ ) database:database_];
+
+ [book_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
+ [overlay_ addSubview:book_];
+
+ [book_ setDelegate:self];
+
+ 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_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin)];
+ [overlay_ addSubview:toolbar_];
+
+ [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) {
+ UIView *button([toolbar_ viewWithTag:(i + 1)]);
+
+ [button setFrame:CGRectMake(
+ i * (screenrect.size.width / 5) + (screenrect.size.width / 5 - ButtonBarWidth_) / 2, 1,
+ ButtonBarWidth_, ButtonBarHeight_
+ )];
+
+ [button setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin];
+ }
+
+ [toolbar_ showSelectionForButton:1];
+
+ [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];
+
+#if RecyclePackageViews
+ details_ = [[NSMutableArray alloc] initWithCapacity:4];
+ [details_ addObject:[self _packageView]];
+ [details_ addObject:[self _packageView]];
+#endif
+
+ PrintTimes();
+
+ _setHomePage(self);