X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/856b8388ba6423823008aa77e4b83a4b9a37983b..98aab5ed9061436910f4210b017c6c2b3ddf1e41:/MobileCydia.mm diff --git a/MobileCydia.mm b/MobileCydia.mm index 15a4f815..0c83f523 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -820,7 +820,7 @@ bool Changed_; static time_t now_; bool IsWildcat_; -static CGFloat ScreenScale_; +CGFloat ScreenScale_; static NSString *Idiom_; static _H Firmware_; static NSString *Major_; @@ -3133,6 +3133,10 @@ struct PackageNameOrdering : } } - (NSArray *) warnings { +@synchronized (database_) { + if ([database_ era] != era_ || file_.end()) + return nil; + NSMutableArray *warnings([NSMutableArray arrayWithCapacity:4]); const char *name(iterator_.Name()); @@ -3153,6 +3157,7 @@ struct PackageNameOrdering : bool user = false; bool _private = false; bool stash = false; + bool dbstash = false; bool dsstore = false; bool repository = [[self section] isEqualToString:@"Repositories"]; @@ -3167,6 +3172,8 @@ struct PackageNameOrdering : _private = true; else if (!stash && [file isEqualToString:@"/var/stash"]) stash = true; + else if (!dbstash && [file isEqualToString:@"/var/db/stash"]) + dbstash = true; else if (!dsstore && [file hasSuffix:@"/.DS_Store"]) dsstore = true; @@ -3179,12 +3186,14 @@ struct PackageNameOrdering : [warnings addObject:[NSString stringWithFormat:UCLocalize("FILES_INSTALLED_TO"), @"/private"]]; if (stash) [warnings addObject:[NSString stringWithFormat:UCLocalize("FILES_INSTALLED_TO"), @"/var/stash"]]; + if (dbstash) + [warnings addObject:[NSString stringWithFormat:UCLocalize("FILES_INSTALLED_TO"), @"/var/db/stash"]]; if (dsstore) [warnings addObject:[NSString stringWithFormat:UCLocalize("FILES_INSTALLED_TO"), @".DS_Store"]]; } return [warnings count] == 0 ? nil : warnings; -} +} } - (NSArray *) applications { NSString *me([[NSBundle mainBundle] bundleIdentifier]); @@ -4947,6 +4956,10 @@ static _H Diversions_; return [CydiaWebViewController requestWithHeaders:[super webView:view resource:resource willSendRequest:request redirectResponse:response fromDataSource:source]]; } +- (NSURLRequest *) webThreadWebView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source { + return [CydiaWebViewController requestWithHeaders:[super webThreadWebView:view resource:resource willSendRequest:request redirectResponse:response fromDataSource:source]]; +} + + (NSURLRequest *) requestWithHeaders:(NSURLRequest *)request { NSMutableURLRequest *copy([[request mutableCopy] autorelease]); @@ -7115,9 +7128,11 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi // on the iPad, this view controller is ALSO visible. :( if (IsWildcat_) - if (UIViewController *top = [self topViewController]) - if (top != visible) - [top reloadData]; + if (UIViewController *modal = [self modalViewController]) + if ([modal modalPresentationStyle] == UIModalPresentationFormSheet) + if (UIViewController *top = [self topViewController]) + if (top != visible) + [top reloadData]; } - (void) unloadData { @@ -8610,7 +8625,7 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi case 1: { NSString *href = [[alert textField] text]; - static Pcre href_r("^http(s?)://[^# ]*$"); + static Pcre href_r("^(http(s?)://|file:///)[^# ]*$"); if (!href_r(href)) { UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:Colon_, Error_, UCLocalize("INVALID_URL")] @@ -9220,8 +9235,6 @@ _end - (void) presentModalViewController:(UIViewController *)controller force:(BOOL)force { UINavigationController *navigation([[[UINavigationController alloc] initWithRootViewController:controller] autorelease]); - if (IsWildcat_) - [navigation setModalPresentationStyle:UIModalPresentationFormSheet]; UIViewController *parent; if (emulated_ == nil) @@ -9233,6 +9246,8 @@ _end parent = tabbar_; } + if (IsWildcat_) + [navigation setModalPresentationStyle:UIModalPresentationFormSheet]; [parent presentModalViewController:navigation animated:YES]; } @@ -9751,12 +9766,12 @@ _end NSTimeInterval interval([closed timeIntervalSinceNow]); - if (interval <= -(30)) { + if (interval <= -(30*60)) { [tabbar_ setSelectedIndex:0]; [[[tabbar_ viewControllers] objectAtIndex:0] popToRootViewControllerAnimated:NO]; } - if (interval <= -(15)) { + if (interval <= -(15*60)) { if (IsReachable("cydia.saurik.com")) { [tabbar_ beginUpdate]; [appcache_ reloadURLWithCache:YES]; @@ -9946,7 +9961,6 @@ _trace(); Stash_("/Library/Wallpaper"); //Stash_("/usr/bin"); Stash_("/usr/include"); - Stash_("/usr/lib/pam"); Stash_("/usr/share"); //Stash_("/var/lib"); @@ -10472,7 +10486,8 @@ int main(int argc, char *argv[]) { _root(CydiaWriteSources()); _trace(); - MetaFile_.Open([Cache("metadata.cb0") UTF8String]); + mkdir("/var/mobile/Library/Cydia", 0755); + MetaFile_.Open("/var/mobile/Library/Cydia/metadata.cb0"); _trace(); if (Packages_ != nil) { @@ -10504,6 +10519,9 @@ int main(int argc, char *argv[]) { /*if (substrate && access("/Library/MobileSubstrate/MobileSubstrate.dylib", F_OK) == 0) dlopen("/Library/MobileSubstrate/MobileSubstrate.dylib", RTLD_LAZY | RTLD_GLOBAL);*/ + if (kCFCoreFoundationVersionNumber > 1000) + _root(system([[NSString stringWithFormat:@"/usr/libexec/cydia/setnsfpn /var/lib"] UTF8String])); + int version([[NSString stringWithContentsOfFile:@"/var/lib/cydia/firmware.ver"] intValue]); if (access("/User", F_OK) != 0 || version != 6) {