From 567e3972565737fe38a24e6ba7df047fb7f44386 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 10 Nov 2010 00:12:36 -0800 Subject: Add X-Carrier-ID. --- MobileCydia.mm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'MobileCydia.mm') diff --git a/MobileCydia.mm b/MobileCydia.mm index faf7c36..cb9cda3 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -1055,6 +1055,7 @@ static NSString *SerialNumber_ = nil; static NSString *ChipID_ = nil; static NSString *Token_ = nil; static NSString *UniqueID_ = nil; +static NSString *PLMN_ = nil; static NSString *Build_ = nil; static NSString *Product_ = nil; static NSString *Safari_ = nil; @@ -6305,6 +6306,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [request setValue:ChipID_ forHTTPHeaderField:@"X-Chip-ID"]; if (UniqueID_ != nil) [request setValue:UniqueID_ forHTTPHeaderField:@"X-Unique-ID"]; + if (PLMN_ != nil) + [request setValue:PLMN_ forHTTPHeaderField:@"X-Carrier-ID"]; } - (void) aboutButtonClicked { @@ -8996,6 +8999,22 @@ int main(int argc, char *argv[]) { _pooled UniqueID_ = [[UIDevice currentDevice] uniqueIdentifier]; + CFStringRef (*$CTSIMSupportCopyMobileSubscriberCountryCode)(CFAllocatorRef); + $CTSIMSupportCopyMobileSubscriberCountryCode = reinterpret_cast(dlsym(RTLD_DEFAULT, "CTSIMSupportCopyMobileSubscriberCountryCode")); + CFStringRef mcc($CTSIMSupportCopyMobileSubscriberCountryCode == NULL ? NULL : (*$CTSIMSupportCopyMobileSubscriberCountryCode)(kCFAllocatorDefault)); + + CFStringRef (*$CTSIMSupportCopyMobileSubscriberNetworkCode)(CFAllocatorRef); + $CTSIMSupportCopyMobileSubscriberNetworkCode = reinterpret_cast(dlsym(RTLD_DEFAULT, "CTSIMSupportCopyMobileSubscriberCountryCode")); + CFStringRef mnc($CTSIMSupportCopyMobileSubscriberNetworkCode == NULL ? NULL : (*$CTSIMSupportCopyMobileSubscriberNetworkCode)(kCFAllocatorDefault)); + + if (mcc != NULL && mnc != NULL) + PLMN_ = [NSString stringWithFormat:@"%@%@", mcc, mnc]; + + if (mnc != NULL) + CFRelease(mnc); + if (mcc != NULL) + CFRelease(mcc); + if (NSDictionary *system = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]) Build_ = [system objectForKey:@"ProductBuildVersion"]; if (NSDictionary *info = [NSDictionary dictionaryWithContentsOfFile:@"/Applications/MobileSafari.app/Info.plist"]) { -- cgit v1.2.3