From d60043e4dfdcd8321f94720ef885c55ad59a2b3d Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 10 Mar 2017 22:34:52 -0800 Subject: [PATCH] Support compound user-agents using CyteInitialize. --- CyteKit/extern.h | 2 +- CyteKit/extern.mm | 4 ++-- MobileCydia.mm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CyteKit/extern.h b/CyteKit/extern.h index 562fb263..e019227b 100644 --- a/CyteKit/extern.h +++ b/CyteKit/extern.h @@ -33,7 +33,7 @@ extern const char *System_; bool CyteIsReachable(const char *name); -void CyteInitialize(NSString *app, NSString *version); +void CyteInitialize(NSString *agent); static inline double Retina(double value) { value *= ScreenScale_; diff --git a/CyteKit/extern.mm b/CyteKit/extern.mm index aad36267..42317e1a 100644 --- a/CyteKit/extern.mm +++ b/CyteKit/extern.mm @@ -58,7 +58,7 @@ bool CyteIsReachable(const char *name) { ; } -void CyteInitialize(NSString *app, NSString *version) { +void CyteInitialize(NSString *agent) { UIScreen *screen([UIScreen mainScreen]); if ([screen respondsToSelector:@selector(scale)]) ScreenScale_ = [screen scale]; @@ -96,7 +96,7 @@ void CyteInitialize(NSString *app, NSString *version) { safari = [info objectForKey:@"CFBundleVersion"]; } - NSString *agent([NSString stringWithFormat:@"%@/%@ CyF/%.2f", app, version, kCFCoreFoundationVersionNumber]); + agent = [NSString stringWithFormat:@"%@ CyF/%.2f", agent, kCFCoreFoundationVersionNumber]; if (RegEx match = RegEx("([0-9]+(\\.[0-9]+)+).*", safari)) agent = [NSString stringWithFormat:@"Safari/%@ %@", match[1], agent]; diff --git a/MobileCydia.mm b/MobileCydia.mm index 4be6750c..76a3a3f1 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -9211,7 +9211,7 @@ int main(int argc, char *argv[]) { _trace(); - CyteInitialize(@"Cydia", Cydia_); + CyteInitialize([NSString stringWithFormat:@"Cydia/%@", Cydia_]); UpdateExternalStatus(0); SessionData_ = [NSMutableDictionary dictionaryWithCapacity:4]; -- 2.45.2