#include <CydiaSubstrate/CydiaSubstrate.h>
#include "Menes/Menes.h"
+#include "CyteKit/IndirectDelegate.h"
#include "CyteKit/PerlCompatibleRegEx.hpp"
#include "CyteKit/TableViewCell.h"
#include "CyteKit/WebScriptObject-Cyte.h"
#include "CyteKit/WebViewController.h"
+#include "CyteKit/WebViewTableViewCell.h"
#include "CyteKit/stringWithUTF8Bytes.h"
#include "Cydia/MIMEAddress.h"
};
// }}}
+static bool ShowPromoted_;
+
static NSString *Colon_;
NSString *Elision_;
static NSString *Error_;
static NSString *Warning_;
+static bool AprilFools_;
+
static const NSUInteger UIViewAutoresizingFlexibleBoth(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
static _finline NSString *CydiaURL(NSString *path) {
@end
+@class CydiaObject;
+
@interface CydiaWebViewController : CyteWebViewController {
_H<CydiaObject> cydia_;
}
+ (void) addDiversion:(Diversion *)diversion;
++ (NSURLRequest *) requestWithHeaders:(NSURLRequest *)request;
++ (void) didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame withCydia:(CydiaObject *)cydia;
+- (void) setDelegate:(id)delegate;
@end
return @"setMetadataValue";
else if (selector == @selector(setSessionValue::))
return @"setSessionValue";
+ else if (selector == @selector(setShowPromoted:))
+ return @"setShowPromoted";
else if (selector == @selector(substitutePackageNames:))
return @"substitutePackageNames";
else if (selector == @selector(scrollToBottom:))
return [Values_ allKeys];
} }
+- (void) _setShowPromoted:(NSNumber *)value {
+ [Metadata_ setObject:value forKey:@"ShowPromoted"];
+ Changed_ = true;
+}
+
+- (void) setShowPromoted:(NSNumber *)value {
+ [self performSelectorOnMainThread:@selector(_setShowPromoted:) withObject:value waitUntilDone:NO];
+}
+
- (id) getMetadataValue:(NSString *)key {
@synchronized (Values_) {
return [Values_ objectForKey:key];
- (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame {
[super webView:view didClearWindowObject:window forFrame:frame];
+ [CydiaWebViewController didClearWindowObject:window forFrame:frame withCydia:cydia_];
+}
++ (void) didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame withCydia:(CydiaObject *)cydia {
WebDataSource *source([frame dataSource]);
NSURLResponse *response([source response]);
NSURL *url([response URL]);
}
if (bridged)
- [window setValue:cydia_ forKey:@"cydia"];
+ [window setValue:cydia forKey:@"cydia"];
}
- (void) _setupMail:(MFMailComposeViewController *)controller {
}
- (NSURLRequest *) webView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source {
- NSURL *url([request URL]);
- NSString *host([url host]);
+ return [CydiaWebViewController requestWithHeaders:[super webView:view resource:resource willSendRequest:request redirectResponse:response fromDataSource:source]];
+}
- NSMutableURLRequest *copy([[super webView:view resource:resource willSendRequest:request redirectResponse:response fromDataSource:source] mutableCopy]);
++ (NSURLRequest *) requestWithHeaders:(NSURLRequest *)request {
+ NSMutableURLRequest *copy([request mutableCopy]);
+
+ NSURL *url([copy URL]);
+ NSString *host([url host]);
if ([copy valueForHTTPHeaderField:@"X-Cydia-Cf-Version"] == nil)
[copy setValue:[NSString stringWithFormat:@"%.2f", kCFCoreFoundationVersionNumber] forHTTPHeaderField:@"X-Cydia-Cf-Version"];
}
- (void) loadView {
- [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]];
-
- list_ = [[[UITableView alloc] initWithFrame:[[self view] bounds]] autorelease];
+ list_ = [[[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
[list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
[list_ setRowHeight:24.0f];
[(UITableView *) list_ setDataSource:self];
[list_ setDelegate:self];
- [[self view] addSubview:list_];
+ [self setView:list_];
}
- (void) viewDidLoad {
}
- (void) loadView {
- [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]];
+ UIView *view([[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]);
+ [view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
+ [self setView:view];
list_ = [[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStylePlain] autorelease];
[list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
- [[self view] addSubview:list_];
+ [view addSubview:list_];
// XXX: is 20 the most optimal number here?
[list_ setSectionIndexMinimumDisplayRowCount:20];
/* Section Controller {{{ */
@interface SectionController : FilteredPackageListController {
+ _H<IndirectDelegate, 1> indirect_;
+ _H<CydiaObject> cydia_;
_H<NSString> section_;
+ std::vector< _H<CyteWebViewTableViewCell, 1> > promoted_;
}
- (id) initWithDatabase:(Database *)database section:(NSString *)section;
if (name == nil)
name = @"all";
- return [NSURL URLWithString:[NSString stringWithFormat:@"cydia://sections/%@", name]];
+ return [NSURL URLWithString:[NSString stringWithFormat:@"cydia://sections/%@", [name stringByAddingPercentEscapesIncludingReserved]]];
}
- (id) initWithDatabase:(Database *)database section:(NSString *)name {
title = UCLocalize("NO_SECTION");
if ((self = [super initWithDatabase:database title:title filter:@selector(isVisibleInSection:) with:name]) != nil) {
+ indirect_ = [[[IndirectDelegate alloc] initWithDelegate:self] autorelease];
+ cydia_ = [[[CydiaObject alloc] initWithDelegate:indirect_] autorelease];
section_ = name;
} return self;
}
+- (NSInteger) numberOfSectionsInTableView:(UITableView *)list {
+ return [super numberOfSectionsInTableView:list] + 1;
+}
+
+- (NSString *) tableView:(UITableView *)list titleForHeaderInSection:(NSInteger)section {
+ return section == 0 ? nil : [super tableView:list titleForHeaderInSection:(section - 1)];
+}
+
+- (NSInteger) tableView:(UITableView *)list numberOfRowsInSection:(NSInteger)section {
+ return section == 0 ? promoted_.size() : [super tableView:list numberOfRowsInSection:(section - 1)];
+}
+
++ (NSIndexPath *) adjustedIndexPath:(NSIndexPath *)path {
+ return [NSIndexPath indexPathForRow:[path row] inSection:([path section] - 1)];
+}
+
+- (UITableViewCell *) tableView:(UITableView *)table cellForRowAtIndexPath:(NSIndexPath *)path {
+ if ([path section] != 0)
+ return [super tableView:table cellForRowAtIndexPath:[SectionController adjustedIndexPath:path]];
+
+ return promoted_[[path row]];
+}
+
+- (void) tableView:(UITableView *)table didSelectRowAtIndexPath:(NSIndexPath *)path {
+ if ([path section] != 0)
+ return [super tableView:table didSelectRowAtIndexPath:[SectionController adjustedIndexPath:path]];
+}
+
+- (NSInteger) tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
+ NSInteger section([super tableView:tableView sectionForSectionIndexTitle:title atIndex:index]);
+ return section == 0 ? 0 : section + 1;
+}
+
+- (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)frame decisionListener:(id<WebPolicyDecisionListener>)listener {
+ NSURL *url([request URL]);
+ if (url == nil)
+ return;
+
+ if ([frame isEqualToString:@"_open"])
+ [delegate_ openURL:url];
+ else {
+ CyteViewController *controller([delegate_ pageForURL:url forExternal:NO] ?: [[[CydiaWebViewController alloc] initWithRequest:request] autorelease]);
+ [controller setDelegate:delegate_];
+ [[self navigationController] pushViewController:controller animated:YES];
+ }
+
+ [listener ignore];
+}
+
+- (NSURLRequest *) webView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source {
+ return [CydiaWebViewController requestWithHeaders:request];
+}
+
+- (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame {
+ [CydiaWebViewController didClearWindowObject:window forFrame:frame withCydia:cydia_];
+}
+
+- (void) loadView {
+ [super loadView];
+
+ // XXX: this code is horrible. I mean, wtf Jay?
+ if (ShowPromoted_ && [[Metadata_ objectForKey:@"ShowPromoted"] boolValue]) {
+ promoted_.resize(1);
+
+ for (unsigned i(0); i != promoted_.size(); ++i) {
+ CyteWebViewTableViewCell *promoted([CyteWebViewTableViewCell cellWithRequest:[NSURLRequest
+ requestWithURL:[Diversion divertURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/#!/sectionhead/%u/%@",
+ UI_, i, section_ == nil ? @"" : [section_ stringByAddingPercentEscapesIncludingReserved]]
+ ]]
+
+ cachePolicy:NSURLRequestUseProtocolCachePolicy
+ timeoutInterval:120
+ ]]);
+
+ [promoted setDelegate:self];
+ promoted_[i] = promoted;
+ }
+ }
+}
+
+- (void) setDelegate:(id)delegate {
+ [super setDelegate:delegate];
+ [cydia_ setDelegate:delegate];
+}
+
+- (void) releaseSubviews {
+ promoted_.clear();
+ [super releaseSubviews];
+}
+
@end
/* }}} */
/* Sections Controller {{{ */
}
- (void) loadView {
- [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]];
-
- list_ = [[[UITableView alloc] initWithFrame:[[self view] bounds]] autorelease];
+ list_ = [[[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
[list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
[list_ setRowHeight:45.0f];
[(UITableView *) list_ setDataSource:self];
[list_ setDelegate:self];
- [[self view] addSubview:list_];
+ [self setView:list_];
}
- (void) viewDidLoad {
_H<NSArray> packages_;
_H<NSMutableArray> sections_;
_H<UITableView, 2> list_;
+ _H<CyteWebView, 1> dickbar_;
unsigned upgrades_;
+ _H<IndirectDelegate, 1> indirect_;
+ _H<CydiaObject> cydia_;
}
- (id) initWithDatabase:(Database *)database;
}
- (void) loadView {
- [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]];
+ UIView *view([[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]);
+ [view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
+ [self setView:view];
- list_ = [[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStylePlain] autorelease];
+ list_ = [[[UITableView alloc] initWithFrame:[view bounds] style:UITableViewStylePlain] autorelease];
[list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
[list_ setRowHeight:73];
[(UITableView *) list_ setDataSource:self];
[list_ setDelegate:self];
- [[self view] addSubview:list_];
+ [view addSubview:list_];
+
+ if (AprilFools_ && kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iPhoneOS_3_0) {
+ CGRect dickframe([view bounds]);
+ dickframe.size.height = 44;
+
+ dickbar_ = [[[CyteWebView alloc] initWithFrame:dickframe] autorelease];
+ [dickbar_ setDelegate:self];
+ [view addSubview:dickbar_];
+
+ [dickbar_ setBackgroundColor:[UIColor clearColor]];
+ [dickbar_ setScalesPageToFit:YES];
+
+ UIWebDocumentView *document([dickbar_ _documentView]);
+ [document setBackgroundColor:[UIColor clearColor]];
+ [document setDrawsBackground:NO];
+
+ WebView *webview([document webView]);
+ [webview setShouldUpdateWhileOffscreen:NO];
+
+ UIScrollView *scroller([dickbar_ scrollView]);
+ [scroller setScrollingEnabled:NO];
+ [scroller setFixedBackgroundPattern:YES];
+ [scroller setBackgroundColor:[UIColor clearColor]];
+
+ WebPreferences *preferences([webview preferences]);
+ [preferences setCacheModel:WebCacheModelDocumentBrowser];
+ [preferences setJavaScriptCanOpenWindowsAutomatically:YES];
+ [preferences setOfflineWebApplicationCacheEnabled:YES];
+
+ [dickbar_ loadRequest:[NSURLRequest
+ requestWithURL:[Diversion divertURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/#!/dickbar/", UI_]]]
+ cachePolicy:NSURLRequestUseProtocolCachePolicy
+ timeoutInterval:120
+ ]];
+
+ UIEdgeInsets inset = {44, 0, 0, 0};
+ [list_ setContentInset:inset];
+
+ [dickbar_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
+ }
+}
+
+- (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)frame decisionListener:(id<WebPolicyDecisionListener>)listener {
+ NSURL *url([request URL]);
+ if (url == nil)
+ return;
+
+ if ([frame isEqualToString:@"_open"])
+ [delegate_ openURL:url];
+ else {
+ CyteViewController *controller([delegate_ pageForURL:url forExternal:NO] ?: [[[CydiaWebViewController alloc] initWithRequest:request] autorelease]);
+ [controller setDelegate:delegate_];
+ [[self navigationController] pushViewController:controller animated:YES];
+ }
+
+ [listener ignore];
+}
+
+- (NSURLRequest *) webView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source {
+ return [CydiaWebViewController requestWithHeaders:request];
+}
+
+- (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame {
+ [CydiaWebViewController didClearWindowObject:window forFrame:frame withCydia:cydia_];
+}
+
+- (void) setDelegate:(id)delegate {
+ [super setDelegate:delegate];
+ [cydia_ setDelegate:delegate];
}
- (void) viewDidLoad {
[super viewDidLoad];
- [[self navigationItem] setTitle:UCLocalize("CHANGES")];
+ [[self navigationItem] setTitle:(AprilFools_ ? @"Timeline" : UCLocalize("CHANGES"))];
}
- (void) releaseSubviews {
packages_ = nil;
sections_ = nil;
+ dickbar_ = nil;
[super releaseSubviews];
}
- (id) initWithDatabase:(Database *)database {
if ((self = [super init]) != nil) {
+ indirect_ = [[[IndirectDelegate alloc] initWithDelegate:self] autorelease];
+ cydia_ = [[[CydiaObject alloc] initWithDelegate:indirect_] autorelease];
database_ = database;
} return self;
}
if ([search_ text] == nil || [[search_ text] isEqualToString:@""])
return [NSURL URLWithString:@"cydia://search"];
else
- return [NSURL URLWithString:[NSString stringWithFormat:@"cydia://search/%@", [search_ text]]];
+ return [NSURL URLWithString:[NSString stringWithFormat:@"cydia://search/%@", [[search_ text] stringByAddingPercentEscapesIncludingReserved]]];
}
- (void) useSearch {
}
- (void) loadView {
- [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]];
+ UIView *view([[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]);
+ [view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
+ [self setView:view];
table_ = [[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStyleGrouped] autorelease];
[table_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
[(UITableView *) table_ setDataSource:self];
[table_ setDelegate:self];
- [[self view] addSubview:table_];
+ [view addSubview:table_];
subscribedSwitch_ = [[[UISwitch alloc] initWithFrame:CGRectMake(0, 0, 50, 20)] autorelease];
[subscribedSwitch_ setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin];
}
- (void) loadView {
- [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]];
-
- list_ = [[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStylePlain] autorelease];
+ list_ = [[[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame] style:UITableViewStylePlain] autorelease];
[list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
[list_ setRowHeight:53];
[(UITableView *) list_ setDataSource:self];
[list_ setDelegate:self];
- [[self view] addSubview:list_];
+ [self setView:list_];
}
- (void) viewDidLoad {
@implementation SettingsController
- (void) loadView {
- [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]];
-
- table_ = [[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStyleGrouped] autorelease];
+ table_ = [[[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame] style:UITableViewStyleGrouped] autorelease];
[table_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
[table_ setDelegate:self];
[(UITableView *) table_ setDataSource:self];
- [[self view] addSubview:table_];
+ [self setView:table_];
NSArray *items = [NSArray arrayWithObjects:
UCLocalize("USER"),
@implementation StashController
- (void) loadView {
- [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]];
- [[self view] setBackgroundColor:[UIColor viewFlipsideBackgroundColor]];
+ UIView *view([[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]);
+ [view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
+ [self setView:view];
+
+ [view setBackgroundColor:[UIColor viewFlipsideBackgroundColor]];
spinner_ = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge] autorelease];
CGRect spinrect = [spinner_ frame];
spinrect.origin.y = [[self view] frame].size.height - 80.0f;
[spinner_ setFrame:spinrect];
[spinner_ setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin];
- [[self view] addSubview:spinner_];
+ [view addSubview:spinner_];
[spinner_ startAnimating];
CGRect captrect;
[caption_ setBackgroundColor:[UIColor clearColor]];
[caption_ setShadowColor:[UIColor blackColor]];
[caption_ setTextAlignment:UITextAlignmentCenter];
- [[self view] addSubview:caption_];
+ [view addSubview:caption_];
CGRect statusrect;
statusrect.size.width = [[self view] frame].size.width;
[status_ setBackgroundColor:[UIColor clearColor]];
[status_ setShadowColor:[UIColor blackColor]];
[status_ setTextAlignment:UITextAlignmentCenter];
- [[self view] addSubview:status_];
+ [view addSubview:status_];
}
- (void) releaseSubviews {
NSString *path([[url absoluteString] substringFromIndex:[scheme length] + 3]);
NSArray *components([path componentsSeparatedByString:@"/"]);
- if ([scheme isEqualToString:@"apptapp"] && [components count] > 0 && [[components objectAtIndex:0] isEqualToString:@"package"])
- return [self pageForPackage:[components objectAtIndex:1]];
+ if ([scheme isEqualToString:@"apptapp"] && [components count] > 0 && [[components objectAtIndex:0] isEqualToString:@"package"]) {
+ CyteViewController *controller([self pageForPackage:[components objectAtIndex:1]]);
+ if (controller != nil)
+ [controller setDelegate:self];
+ return controller;
+ }
if ([components count] < 1 || ![scheme isEqualToString:@"cydia"])
return nil;
}
if (!external && [base isEqualToString:@"search"]) {
- controller = [[[SearchController alloc] initWithDatabase:database_ query:argument] autorelease];
+ controller = [[[SearchController alloc] initWithDatabase:database_ query:[argument stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] autorelease];
}
if (!external && [base isEqualToString:@"sections"]) {
if ([argument isEqualToString:@"all"])
argument = nil;
- controller = [[[SectionController alloc] initWithDatabase:database_ section:argument] autorelease];
+ controller = [[[SectionController alloc] initWithDatabase:database_ section:[argument stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] autorelease];
}
if (!external && [base isEqualToString:@"sources"]) {
NSMutableArray *items([NSMutableArray arrayWithObjects:
[[[UITabBarItem alloc] initWithTitle:@"Cydia" image:[UIImage applicationImageNamed:@"home.png"] tag:0] autorelease],
[[[UITabBarItem alloc] initWithTitle:UCLocalize("SECTIONS") image:[UIImage applicationImageNamed:@"install.png"] tag:0] autorelease],
- [[[UITabBarItem alloc] initWithTitle:UCLocalize("CHANGES") image:[UIImage applicationImageNamed:@"changes.png"] tag:0] autorelease],
+ [[[UITabBarItem alloc] initWithTitle:(AprilFools_ ? @"Timeline" : UCLocalize("CHANGES")) image:[UIImage applicationImageNamed:@"changes.png"] tag:0] autorelease],
[[[UITabBarItem alloc] initWithTitle:UCLocalize("SEARCH") image:[UIImage applicationImageNamed:@"search.png"] tag:0] autorelease],
nil]);
}
}
+- (void) applicationDidReceiveMemoryWarning:(UIApplication *)application {
+ NSLog(@"--");
+ [[NSURLCache sharedURLCache] removeAllCachedResponses];
+}
+
- (void) applicationDidFinishLaunching:(id)unused {
//[NSThread detachNewThreadSelector:@selector(_sendMemoryWarningNotifications) toTarget:self withObject:nil];
NSDate *closed = [Metadata_ objectForKey:@"LastClosed"];
if (valid && closed != nil) {
NSTimeInterval interval([closed timeIntervalSinceNow]);
- // XXX: Is 60 minutes the optimal time here?
- if (interval <= -(60*60))
+ // XXX: Is 30 minutes the optimal time here?
+ if (interval <= -(30*60))
valid = NO;
}
//UIKeyboardDisableAutomaticAppearance();
/* }}} */
+ BOOL (*GSSystemHasCapability)(CFStringRef) = reinterpret_cast<BOOL (*)(CFStringRef)>(dlsym(RTLD_DEFAULT, "GSSystemHasCapability"));
+ ShowPromoted_ = GSSystemHasCapability != NULL && GSSystemHasCapability(CFSTR("armv7"));
+
Colon_ = UCLocalize("COLON_DELIMITED");
Elision_ = UCLocalize("ELISION");
Error_ = UCLocalize("ERROR");
Warning_ = UCLocalize("WARNING");
+#if !ForRelease
+ AprilFools_ = true;
+#else
+ CFGregorianDate date(CFAbsoluteTimeGetGregorianDate(CFAbsoluteTimeGetCurrent(), CFTimeZoneCopySystem()));
+ AprilFools_ = date.month == 4 && date.day == 1;
+#endif
+
_trace();
int value(UIApplicationMain(argc, argv, @"Cydia", @"Cydia"));