bool IsWildcat_;
static CGFloat ScreenScale_;
static NSString *Idiom_;
+
+static NSMutableSet *CydiaHosts_;
/* }}} */
/* Display Helpers {{{ */
- (CYViewController *) pageForPackage:(NSString *)name;
- (void) showActionSheet:(UIActionSheet *)sheet fromItem:(UIBarButtonItem *)item;
- (void) reloadDataWithInvocation:(NSInvocation *)invocation;
+- (void) addCydiaHost:(NSString *)host;
@end
/* }}} */
+ (NSString *) webScriptNameForSelector:(SEL)selector {
if (false);
+ else if (selector == @selector(addCydiaHost:))
+ return @"addCydiaHost";
else if (selector == @selector(addTrivialSource:))
return @"addTrivialSource";
else if (selector == @selector(close))
return [NSString stringWithCString:value];
}
+- (void) addCydiaHost:(NSString *)host {
+ [delegate_ performSelectorOnMainThread:@selector(addCydiaHost:) withObject:host waitUntilDone:NO];
+}
+
- (void) addTrivialSource:(NSString *)href {
[delegate_ performSelectorOnMainThread:@selector(addTrivialSource:) withObject:href waitUntilDone:NO];
}
NSURLResponse *response([source response]);
NSURL *url([response URL]);
- NSString *scheme([url scheme]);
+ //NSString *scheme([url scheme]);
NSString *host([url host]);
if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
[self setHeaders:headers forHost:host];
}
- if (
- [host isEqualToString:@"cydia.saurik.com"] ||
- [host hasSuffix:@".cydia.saurik.com"] ||
- [scheme isEqualToString:@"file"]
- )
+ if ([CydiaHosts_ containsObject:host])
[window setValue:cydia_ forKey:@"cydia"];
}
- (void) repairWithInvocation:(NSInvocation *)invocation {
_trace();
- [self invokeNewProgress:invocation forController:nil withTitle:UCLocalize("REPAIRING")];
+ [self invokeNewProgress:invocation forController:nil withTitle:@"REPAIRING"];
_trace();
}
fclose(file);
- [self detachNewProgressSelector:@selector(update_) toTarget:self forController:nil title:UCLocalize("UPDATING_SOURCES")];
+ [self detachNewProgressSelector:@selector(update_) toTarget:self forController:nil title:@"UPDATING_SOURCES"];
[self complete];
}
- (void) confirmWithNavigationController:(UINavigationController *)navigation {
Queuing_ = false;
++locked_;
- [self detachNewProgressSelector:@selector(perform) toTarget:database_ forController:navigation title:UCLocalize("RUNNING")];
+ [self detachNewProgressSelector:@selector(perform) toTarget:database_ forController:navigation title:@"RUNNING"];
--locked_;
[self complete];
}
[tabbar_ setUpdateDelegate:self];
}
+- (void) addCydiaHost:(NSString *)host {
+ [CydiaHosts_ addObject:host];
+}
+
- (void) applicationDidFinishLaunching:(id)unused {
_trace();
if ([self respondsToSelector:@selector(setApplicationSupportsShakeToEdit:)])
[self setApplicationSupportsShakeToEdit:NO];
+ [self addCydiaHost:[[NSURL URLWithString:CydiaURL(@"")] host]];
+
[NSURLCache setSharedURLCache:[[[SDURLCache alloc]
initWithMemoryCapacity:524288
diskCapacity:10485760
NSLog(@"unknown UIUserInterfaceIdiom!");
}
+ CydiaHosts_ = [NSMutableSet setWithCapacity:2];
+
UI_ = CydiaURL([NSString stringWithFormat:@"ui/ios~%@", Idiom_]);
PackageName = reinterpret_cast<CYString &(*)(Package *, SEL)>(method_getImplementation(class_getInstanceMethod([Package class], @selector(cyname))));