NSURL *url([request URL]);
if (url == nil)
return NO;
+
NSString *scheme([[url scheme] lowercaseString]);
- if (scheme == nil || ![scheme isEqualToString:@"cydia"])
- return NO;
- return YES;
+ if (scheme != nil && [scheme isEqualToString:@"cydia"])
+ return YES;
+ if ([[url absoluteString] hasPrefix:@"about:cydia-"])
+ return YES;
+
+ return NO;
}
+ (NSURLRequest *) canonicalRequestForRequest:(NSURLRequest *)request {
NSURL *url([request URL]);
NSString *href([url absoluteString]);
+ NSString *scheme([[url scheme] lowercaseString]);
+
+ NSString *path;
+
+ if ([scheme isEqualToString:@"cydia"])
+ path = [href substringFromIndex:8];
+ else if ([scheme isEqualToString:@"about"])
+ path = [href substringFromIndex:12];
+ else _assert(false);
- NSString *path([href substringFromIndex:8]);
NSRange slash([path rangeOfString:@"/"]);
NSString *command;