X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/70d35e1385a7311e310a9890ecb163d97bbdf6e9..367a112d938db5c80814b42c428b517e4a65efd9:/MobileCydia.mm diff --git a/MobileCydia.mm b/MobileCydia.mm index bba7233e..b359a279 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -5337,14 +5337,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { - (PackageCell *) init { CGRect frame(CGRectMake(0, 0, 320, 74)); if ((self = [super initWithFrame:frame reuseIdentifier:@"Package"]) != nil) { - UIView *content([self contentView]); - CGRect bounds([content bounds]); - - self.content = [[[CyteTableViewCellContentView alloc] initWithFrame:bounds] autorelease]; - [self.content setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; - [content addSubview:self.content]; - - [self.content setDelegate:self]; [self.content setOpaque:YES]; } return self; } @@ -5560,15 +5552,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { switch_ = [[[UISwitch alloc] initWithFrame:CGRectMake(218, 9, 60, 25)] autorelease]; [switch_ addTarget:self action:@selector(onSwitch:) forEvents:UIControlEventValueChanged]; - UIView *content([self contentView]); - CGRect bounds([content bounds]); - - self.content = [[[CyteTableViewCellContentView alloc] initWithFrame:bounds] autorelease]; - [self.content setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; - [content addSubview:self.content]; [self.content setBackgroundColor:[UIColor whiteColor]]; - - [self.content setDelegate:self]; } return self; } @@ -5654,7 +5638,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { /* }}} */ /* File Table {{{ */ -@interface FileTable : CyteViewController < +@interface FileTable : CyteListController < UITableViewDataSource, UITableViewDelegate > { @@ -5662,11 +5646,9 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { _H package_; _H name_; _H files_; - _H list_; } -- (id) initWithDatabase:(Database *)database; -- (void) setPackage:(Package *)package; +- (id) initWithDatabase:(Database *)database forPackage:(NSString *)name; @end @@ -5698,47 +5680,36 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { return [NSURL URLWithString:[NSString stringWithFormat:@"cydia://package/%@/files", [package_ id]]]; } -- (void) loadView { - list_ = [[[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]; - [list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; - [list_ setRowHeight:24.0f]; - [(UITableView *) list_ setDataSource:self]; - [list_ setDelegate:self]; - [self setView:list_]; -} - -- (void) viewDidLoad { - [super viewDidLoad]; - - [[self navigationItem] setTitle:UCLocalize("INSTALLED_FILES")]; +- (CGFloat) rowHeight { + return 24; } - (void) releaseSubviews { - list_ = nil; - package_ = nil; files_ = nil; [super releaseSubviews]; } -- (id) initWithDatabase:(Database *)database { - if ((self = [super init]) != nil) { +- (id) initWithDatabase:(Database *)database forPackage:(NSString *)name { + if ((self = [super initWithTitle:UCLocalize("INSTALLED_FILES")]) != nil) { database_ = database; + name_ = name; } return self; } -- (void) setPackage:(Package *)package { - package_ = nil; - name_ = nil; +- (bool) shouldYield { + return false; +} - files_ = [NSMutableArray arrayWithCapacity:32]; +- (void) _reloadData { + files_ = nil; - if (package != nil) { - package_ = package; - name_ = [package id]; + package_ = [database_ packageWithName:name_]; + if (package_ != nil) { + files_ = [NSMutableArray arrayWithCapacity:32]; - if (NSArray *files = [package files]) + if (NSArray *files = [package_ files]) [files_ addObjectsFromArray:files]; if ([files_ count] != 0) { @@ -5763,13 +5734,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } } - [list_ reloadData]; -} - -- (void) reloadData { - [super reloadData]; - - [self setPackage:[database_ packageWithName:name_]]; + [super _reloadData]; } @end @@ -7543,20 +7508,12 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi - (SourceCell *) initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier { if ((self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) != nil) { - UIView *content([self contentView]); - CGRect bounds([content bounds]); - - self.content = [[[CyteTableViewCellContentView alloc] initWithFrame:bounds] autorelease]; - [self.content setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; [self.content setBackgroundColor:[UIColor whiteColor]]; - [content addSubview:self.content]; - - [self.content setDelegate:self]; [self.content setOpaque:YES]; indicator_ = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGraySmall] autorelease]; [indicator_ setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin];// | UIViewAutoresizingFlexibleBottomMargin]; - [content addSubview:indicator_]; + [[self contentView] addSubview:indicator_]; [[self.content layer] setContentsGravity:kCAGravityTopLeft]; } return self; @@ -8857,10 +8814,7 @@ _end if ([arg2 isEqualToString:@"settings"]) { controller = [[[PackageSettingsController alloc] initWithDatabase:database_ package:arg1] autorelease]; } else if ([arg2 isEqualToString:@"files"]) { - if (Package *package = [database_ packageWithName:arg1]) { - controller = [[[FileTable alloc] initWithDatabase:database_] autorelease]; - [(FileTable *)controller setPackage:package]; - } + controller = [[[FileTable alloc] initWithDatabase:database_ forPackage:arg1] autorelease]; } } @@ -9237,17 +9191,47 @@ static NSMutableDictionary *AutoreleaseDeepMutableCopyOfDictionary(CFTypeRef typ return [(NSMutableDictionary *) copy autorelease]; } +int main_copy(); +int main_file(); +int main_gpgv(); +int main_rred(int, char *argv[]); + +int main_gzip(int, char *argv[]); + int main_store(int, char *argv[]); +int main_http(); + int main(int argc, char *argv[]) { -#ifdef __arm64__ const char *argv0(argv[0]); if (const char *slash = strrchr(argv0, '/')) argv0 = slash + 1; if (false); + else if (!strcmp(argv0, "copy")) + return main_copy(); + else if (!strcmp(argv0, "file")) + return main_file(); + else if (!strcmp(argv0, "gpgv")) + return main_gpgv(); + else if (!strcmp(argv0, "rred")) + return main_rred(argc, argv); +#ifdef __arm__ + else if (!strcmp(argv0, "bzip2")) + return main_gzip(argc, argv); + else if (!strcmp(argv0, "gzip")) + return main_gzip(argc, argv); + else if (!strcmp(argv0, "lzma")) + return main_gzip(argc, argv); +#endif +#ifdef __arm64__ else if (!strcmp(argv0, "store")) return main_store(argc, argv); #endif + else if (!strcmp(argv0, "http")) + return main_http(); + else if (!strcmp(argv0, "https")) + return main_http(); + else {} int fd(open("/tmp/cydia.log", O_WRONLY | O_APPEND | O_CREAT, 0644)); dup2(fd, 2); @@ -9257,7 +9241,7 @@ int main(int argc, char *argv[]) { _trace(); - CyteInitialize(@"Cydia", Cydia_); + CyteInitialize([NSString stringWithFormat:@"Cydia/%@", Cydia_]); UpdateExternalStatus(0); SessionData_ = [NSMutableDictionary dictionaryWithCapacity:4]; @@ -9481,7 +9465,8 @@ int main(int argc, char *argv[]) { _config->Set("Acquire::AllowInsecureRepositories", true); _config->Set("Acquire::Check-Valid-Until", false); - _config->Set("Dir::Bin::Methods::store", "/Applications/Cydia.app/store"); + + _config->Set("Dir::Bin::Methods", "/Applications/Cydia.app"); _config->Set("pkgCacheGen::ForceEssential", "");