summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2010-11-10 00:12:36 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2010-11-15 14:39:12 -0800
commit567e3972565737fe38a24e6ba7df047fb7f44386 (patch)
tree4c26638c1b4e38a08cd2ff0afb7a4e414372ca39 /MobileCydia.mm
parentf97db6307650edae08342fab15057a471388afed (diff)
Add X-Carrier-ID.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm19
1 files changed, 19 insertions, 0 deletions
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<CFStringRef (*)(CFAllocatorRef)>(dlsym(RTLD_DEFAULT, "CTSIMSupportCopyMobileSubscriberCountryCode"));
+ CFStringRef mcc($CTSIMSupportCopyMobileSubscriberCountryCode == NULL ? NULL : (*$CTSIMSupportCopyMobileSubscriberCountryCode)(kCFAllocatorDefault));
+
+ CFStringRef (*$CTSIMSupportCopyMobileSubscriberNetworkCode)(CFAllocatorRef);
+ $CTSIMSupportCopyMobileSubscriberNetworkCode = reinterpret_cast<CFStringRef (*)(CFAllocatorRef)>(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"]) {