diff options
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r-- | MobileCydia.mm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index ad48ee5..0d6c636 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -10023,6 +10023,22 @@ MSHook(void, UIApplication$_updateApplicationAccessibility, UIApplication *self, } } +Class $NSURLConnection; + +MSHook(id, NSURLConnection$init$, NSURLConnection *self, SEL _cmd, NSURLRequest *request, id delegate, BOOL usesCache, int64_t maxContentLength, BOOL startImmediately, NSDictionary *connectionProperties) { + NSMutableURLRequest *copy([request mutableCopy]); + + NSURL *url([copy URL]); + NSString *host([url host]); + + if ([copy respondsToSelector:@selector(setHTTPShouldUsePipelining:)]) + if ([CydiaHosts_ containsObject:host]) + [copy setHTTPShouldUsePipelining:YES]; + + if ((self = _NSURLConnection$init$(self, _cmd, copy, delegate, usesCache, maxContentLength, startImmediately, connectionProperties)) != nil) { + } return self; +} + int main(int argc, char *argv[]) { _pooled _trace(); @@ -10069,6 +10085,13 @@ int main(int argc, char *argv[]) { _pooled method_setImplementation(UIWebDocumentView$_setUIKitDelegate$, reinterpret_cast<IMP>(&$UIWebDocumentView$_setUIKitDelegate$)); } + $NSURLConnection = objc_getClass("NSURLConnection"); + Method NSURLConnection$init$(class_getInstanceMethod($NSURLConnection, @selector(_initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:))); + if (NSURLConnection$init$ != NULL) { + _NSURLConnection$init$ = reinterpret_cast<id (*)(NSURLConnection *, SEL, NSURLRequest *, id, BOOL, int64_t, BOOL, NSDictionary *)>(method_getImplementation(NSURLConnection$init$)); + method_setImplementation(NSURLConnection$init$, reinterpret_cast<IMP>(&$NSURLConnection$init$)); + } + $UIHardware = objc_getClass("UIHardware"); Method UIHardware$_playSystemSound$(class_getClassMethod($UIHardware, @selector(_playSystemSound:))); if (UIHardware$_playSystemSound$ != NULL) { |