Permalink
Browse files

added carrier info

  • Loading branch information...
1 parent 7dd3329 commit 66589acfade8633633cdc16782fc22072d184c2f Nicolas Seriot committed Nov 1, 2010
Showing with 22 additions and 0 deletions.
  1. +18 −0 Classes/SPSourcePhoneTVC.m
  2. +4 −0 SpyPhone.xcodeproj/project.pbxproj
View
@@ -12,6 +12,8 @@
#import <AddressBook/AddressBook.h>
#import "FMDatabase.h"
#import "NSNumber+SP.h"
+#import <CoreTelephony/CTTelephonyNetworkInfo.h>
+#import <CoreTelephony/CTCarrier.h>
@implementation SPSourcePhoneTVC
@@ -57,6 +59,7 @@ - (NSString *)nameOfABPersonWithID:(NSUInteger)recordID {
}
- (void)loadData {
+
if(contentsDictionaries) return;
NSString *path = @"/private/var/wireless/Library/Preferences/com.apple.commcenter.plist";
@@ -142,6 +145,21 @@ - (void)loadData {
}
/**/
+
+ CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init];
+ CTCarrier *carrier = networkInfo.subscriberCellularProvider;
+ [networkInfo release];
+
+ NSString *s1 = [NSString stringWithFormat:@"%@ %@", [carrier isoCountryCode], [carrier carrierName]];
+ NSString *s2 = [NSString stringWithFormat:@"country %@ network %@", [carrier mobileCountryCode], [carrier mobileNetworkCode]];
+ NSArray *carrierInfoArray = [NSArray arrayWithObjects:s1, s2, nil];
+ NSDictionary *carrierInfo = [NSDictionary dictionaryWithObjectsAndKeys:carrierInfoArray, @"Carrier Info", nil];
+
+ /**/
+
+ if(carrierInfo) {
+ [self.contentsDictionaries addObject:carrierInfo];
+ }
if(self.lastForwardNumber) {
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:[NSArray arrayWithObject:self.lastForwardNumber], @"Call forwarding number", nil];
@@ -93,6 +93,7 @@
282CCBFE0DB6C98000C4EA27 /* Sources.xib in Resources */ = {isa = PBXBuildFile; fileRef = 282CCBFD0DB6C98000C4EA27 /* Sources.xib */; };
288765080DF74369002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765070DF74369002DB57D /* CoreGraphics.framework */; };
28AD73880D9D96C1002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD73870D9D96C1002E5188 /* MainWindow.xib */; };
+ 5F38C609127EBB37003CA424 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F38C608127EBB37003CA424 /* CoreTelephony.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -237,6 +238,7 @@
28A0AB4B0D9B1048005BE974 /* SpyPhone_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpyPhone_Prefix.pch; sourceTree = "<group>"; };
28AD73870D9D96C1002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 5F38C608127EBB37003CA424 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
8D1107310486CEB800E47090 /* SpyPhone-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SpyPhone-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -254,6 +256,7 @@
032A81CA10B8EB6100E7FB65 /* MessageUI.framework in Frameworks */,
0317DE6910FF95CC00C5C2D4 /* MediaPlayer.framework in Frameworks */,
03F2472F1236E25E0017F214 /* libsqlite3.dylib in Frameworks */,
+ 5F38C609127EBB37003CA424 /* CoreTelephony.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -492,6 +495,7 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 5F38C608127EBB37003CA424 /* CoreTelephony.framework */,
03F2472E1236E25E0017F214 /* libsqlite3.dylib */,
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,

0 comments on commit 66589ac

Please sign in to comment.