├── .gitmodules ├── README.md ├── lib ├── AppProxyCap.h └── AppProxyCap.m └── test └── AppProxyCap ├── AppProxyCap.xcodeproj └── project.pbxproj ├── TestMac ├── APCAppDelegate.h ├── APCAppDelegate.m ├── TestMac-Info.plist ├── TestMac-Prefix.pch ├── en.lproj │ ├── Credits.rtf │ ├── InfoPlist.strings │ └── MainMenu.xib └── main.m └── TestiOS ├── APCAppDelegate.h ├── APCAppDelegate.m ├── TestiOS-Info.plist ├── TestiOS-Prefix.pch ├── en.lproj └── InfoPlist.strings └── main.m /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/inject_and_interpose"] 2 | path = lib/inject_and_interpose 3 | url = git://github.com/comex/inject_and_interpose.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | AppProxyCap 2 | =========== 3 | Application-wide proxy setting 4 | 5 | ## Usage 6 | Add the following line to your application before any network call: 7 | 8 | [AppProxyCap activate]; 9 | [AppProxyCap setProxy:AppProxy_HTTP Host:@"127.0.0.1" Port:8086]; 10 | 11 | HTTP traffic in current app via CFNetwork (e.g. NSURLConnection) will go through 127.0.0.1:8086 HTTP proxy afterwards, traffic in other application is not affected. 12 | 13 | 14 | ## Supported OS 15 | Tested in Mac OS X 10.7.2, 10.8.1; iOS 5.0, 6.0 device and simulator 16 | 17 | 18 | ## LICENSE 19 | Released in [MIT License](http://opensource.org/licenses/mit-license.php) -------------------------------------------------------------------------------- /lib/AppProxyCap.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppProxyCap.h 3 | // AppProxyCap 4 | // 5 | // Created by Du Song on 11-10-22. 6 | // Copyright (c) RollingCode.org. All rights reserved. 7 | // 8 | // TODO: add Socks support 9 | // 10 | 11 | #import 12 | 13 | typedef enum {AppProxy_NONE, AppProxy_HTTP, AppProxy_SOCKS, AppProxy_PAC} AppProxyType; 14 | 15 | @interface AppProxyCap : NSObject 16 | 17 | //Initialize, invoke as early as possible in your app 18 | + (void) activate; 19 | 20 | //Set HTTP or Socks proxy to use in app-wide call 21 | + (void) setProxy:(AppProxyType)type Host:(NSString *)host Port:(int)port; 22 | + (void) setPACURL:(NSString *)pacURL; 23 | + (void) setNoProxy; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /lib/AppProxyCap.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppProxyCap.m 3 | // AppProxyCap 4 | // 5 | // Created by Du Song on 11-10-22. 6 | // Copyright (c) 2011年 FreeWheel Inc. All rights reserved. 7 | // 8 | 9 | #import "AppProxyCap.h" 10 | #import "interpose.h" 11 | #include 12 | #include 13 | 14 | @implementation AppProxyCap 15 | 16 | typedef CFDictionaryRef (*_SCDynamicStoreCopyProxies) (SCDynamicStoreRef store); 17 | static _SCDynamicStoreCopyProxies origin_SCDynamicStoreCopyProxies; 18 | 19 | /* 20 | typedef Boolean (* _CFReadStreamOpen) (CFReadStreamRef stream); 21 | static _CFReadStreamOpen origin_CFReadStreamOpen; 22 | 23 | typedef CFReadStreamRef (*_CFReadStreamCreate) (CFAllocatorRef alloc, const void *callbacks, void *info); 24 | typedef CFReadStreamRef (*_CFReadStreamCreateForHTTPRequest) (CFAllocatorRef alloc, CFHTTPMessageRef request); 25 | typedef CFReadStreamRef (*_CFReadStreamCreateForStreamedHTTPRequest) (CFAllocatorRef alloc, CFHTTPMessageRef requestHeaders, CFReadStreamRef requestBody); 26 | extern _CFReadStreamCreate CFReadStreamCreate; 27 | static _CFReadStreamCreateForHTTPRequest origin_CFReadStreamCreateForHTTPRequest; 28 | static _CFReadStreamCreateForStreamedHTTPRequest origin_CFReadStreamCreateForStreamedHTTPRequest; 29 | static _CFReadStreamCreate origin_CFReadStreamCreate; 30 | 31 | static void proxify(CFReadStreamRef ref) { 32 | if (!ref || !proxyType || !proxySetting) return; 33 | CFReadStreamSetProperty(ref, proxyType, proxySetting); 34 | NSLog(@"Proxify"); 35 | } 36 | 37 | static Boolean new_CFReadStreamOpen(CFReadStreamRef stream) { 38 | proxify(stream); 39 | return origin_CFReadStreamOpen(stream); 40 | } 41 | 42 | static CFReadStreamRef new_CFReadStreamCreate(CFAllocatorRef alloc, const void *callbacks, void *info) { 43 | CFReadStreamRef ref = origin_CFReadStreamCreate(alloc, callbacks, info); 44 | proxify(ref); 45 | return ref; 46 | } 47 | 48 | static CFReadStreamRef new_CFReadStreamCreateForHTTPRequest(CFAllocatorRef alloc, CFHTTPMessageRef request){ 49 | CFReadStreamRef ref = origin_CFReadStreamCreateForHTTPRequest(alloc, request); 50 | proxify(ref); 51 | return ref; 52 | } 53 | 54 | static CFReadStreamRef new_CFReadStreamCreateForStreamedHTTPRequest(CFAllocatorRef alloc, CFHTTPMessageRef requestHeaders, CFReadStreamRef requestBody) { 55 | CFReadStreamRef ref = origin_CFReadStreamCreateForStreamedHTTPRequest(alloc, requestHeaders, requestBody); 56 | proxify(ref); 57 | return ref; 58 | } 59 | static CFStringRef proxyType = NULL; 60 | static NSMutableDictionary *proxySetting = NULL; 61 | */ 62 | static bool activated = NO; 63 | static NSDictionary *proxyPref = NULL; 64 | extern CFDictionaryRef SCDynamicStoreCopyProxies (SCDynamicStoreRef store); 65 | static CFDictionaryRef new_SCDynamicStoreCopyProxies (SCDynamicStoreRef store) { 66 | if (!activated || !proxyPref) 67 | return origin_SCDynamicStoreCopyProxies(store); 68 | NSLog(@"AppProxyCap: proxify configuration applied: %@", proxyPref); 69 | return CFDictionaryCreateCopy(NULL, (CFDictionaryRef)proxyPref); 70 | } 71 | 72 | + (void) activate { 73 | if (activated) return; 74 | activated = YES; 75 | /* 76 | origin_CFReadStreamCreate = (_CFReadStreamCreate) &CFReadStreamCreate; 77 | origin_CFReadStreamCreateForHTTPRequest = &CFReadStreamCreateForHTTPRequest; 78 | origin_CFReadStreamCreateForStreamedHTTPRequest = &CFReadStreamCreateForStreamedHTTPRequest; 79 | if (!interpose("_CFReadStreamCreateForHTTPRequest", new_CFReadStreamCreateForHTTPRequest)) NSLog(@"error override _CFReadStreamCreateForHTTPRequest"); 80 | if (!interpose("_CFReadStreamCreateForStreamedHTTPRequest", new_CFReadStreamCreateForStreamedHTTPRequest)) NSLog(@"error override _CFReadStreamCreateForStreamedHTTPRequest"); 81 | if (!interpose("_CFReadStreamCreate", new_CFReadStreamCreate)) NSLog(@"error override _CFReadStreamCreate"); 82 | origin_CFReadStreamOpen = &CFReadStreamOpen; 83 | if (!interpose("_CFReadStreamOpen", new_CFReadStreamOpen)) NSLog(@"error override _CFReadStreamCreate"); 84 | */ 85 | origin_SCDynamicStoreCopyProxies = &SCDynamicStoreCopyProxies; 86 | if (!interpose("_SCDynamicStoreCopyProxies", new_SCDynamicStoreCopyProxies)) NSLog(@"AppProxyCap: error override _SCDynamicStoreCopyProxies"); 87 | } 88 | 89 | +(void)setNoProxy { 90 | [proxyPref release]; 91 | proxyPref = NULL; 92 | } 93 | 94 | +(void)setPACURL:(NSString *)pacURL { 95 | [proxyPref release]; 96 | proxyPref = [[NSDictionary dictionaryWithObjectsAndKeys: 97 | [NSNumber numberWithInt:1], @"ProxyAutoConfigEnable", 98 | pacURL, @"ProxyAutoConfigURLString", 99 | nil] retain]; 100 | 101 | } 102 | 103 | + (void) setProxy:(AppProxyType)type Host:(NSString *)host Port:(int)port { 104 | [proxyPref release]; 105 | switch (type) { 106 | case AppProxy_HTTP: 107 | proxyPref = [[NSDictionary dictionaryWithObjectsAndKeys: 108 | //[NSNumber numberWithInt:1], @"HTTPProxyType", 109 | //[NSNumber numberWithInt:0], @"ProxyAutoConfigEnable", 110 | [NSNumber numberWithInt:1], @"HTTPEnable", 111 | host, @"HTTPProxy", 112 | [NSNumber numberWithInt:port], @"HTTPPort", 113 | [NSNumber numberWithInt:1], @"HTTPSEnable", 114 | host, @"HTTPSProxy", 115 | [NSNumber numberWithInt:port], @"HTTPSPort", 116 | nil] retain]; 117 | /* 118 | proxyType = kCFStreamPropertyHTTPProxy; 119 | proxySetting = [NSMutableDictionary dictionaryWithObjectsAndKeys: 120 | host, kCFStreamPropertyHTTPProxyHost, 121 | [NSNumber numberWithInt:port], kCFStreamPropertyHTTPProxyPort, 122 | host, kCFStreamPropertyHTTPSProxyHost, 123 | [NSNumber numberWithInt:port], kCFStreamPropertyHTTPSProxyPort, 124 | nil]; 125 | */ 126 | break; 127 | case AppProxy_SOCKS: 128 | proxyPref = [[NSDictionary dictionaryWithObjectsAndKeys: 129 | [NSNumber numberWithInt:1], @"SOCKSEnable", 130 | host, @"SOCKSProxy", 131 | [NSNumber numberWithInt:port], @"SOCKSPort", 132 | nil] retain]; 133 | break; 134 | 135 | 136 | default: 137 | /* 138 | proxyType = NULL; 139 | proxySetting = NULL; 140 | */ 141 | proxyPref = NULL; 142 | break; 143 | } 144 | } 145 | 146 | @end 147 | -------------------------------------------------------------------------------- /test/AppProxyCap/AppProxyCap.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7398CF291453DA3700344FDE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73C8A6041452CA4D00717840 /* UIKit.framework */; }; 11 | 7398CF2A1453DA3700344FDE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73C8A6061452CA4D00717840 /* Foundation.framework */; }; 12 | 7398CF2B1453DA3700344FDE /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73C8A6081452CA4D00717840 /* CoreGraphics.framework */; }; 13 | 7398CF311453DA3700344FDE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7398CF2F1453DA3700344FDE /* InfoPlist.strings */; }; 14 | 7398CF331453DA3700344FDE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7398CF321453DA3700344FDE /* main.m */; }; 15 | 7398CF371453DA3700344FDE /* APCAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7398CF361453DA3700344FDE /* APCAppDelegate.m */; }; 16 | 7398CF4A1453DD8400344FDE /* interpose.c in Sources */ = {isa = PBXBuildFile; fileRef = 73C8A61B1452CAB000717840 /* interpose.c */; }; 17 | 7398CF4B1453DD8400344FDE /* AppProxyCap.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C8A6231452CB6300717840 /* AppProxyCap.m */; }; 18 | 7398CF4D1453DD9D00344FDE /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73C8A6641453C37800717840 /* SystemConfiguration.framework */; }; 19 | 7398CF4F1453E5B700344FDE /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 7398CF4E1453E5B700344FDE /* README.md */; }; 20 | 73C8A6481452DE9F00717840 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 73C8A6461452DE9F00717840 /* InfoPlist.strings */; }; 21 | 73C8A64A1452DE9F00717840 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C8A6491452DE9F00717840 /* main.m */; }; 22 | 73C8A64E1452DE9F00717840 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 73C8A64C1452DE9F00717840 /* Credits.rtf */; }; 23 | 73C8A6511452DE9F00717840 /* APCAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C8A6501452DE9F00717840 /* APCAppDelegate.m */; }; 24 | 73C8A6541452DE9F00717840 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 73C8A6521452DE9F00717840 /* MainMenu.xib */; }; 25 | 73C8A6581452DF6900717840 /* interpose.c in Sources */ = {isa = PBXBuildFile; fileRef = 73C8A61B1452CAB000717840 /* interpose.c */; }; 26 | 73C8A6591452DF6900717840 /* AppProxyCap.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C8A6231452CB6300717840 /* AppProxyCap.m */; }; 27 | 73C8A65B1452E16900717840 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73C8A65A1452E16900717840 /* CoreFoundation.framework */; }; 28 | 73C8A65D1452E17100717840 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73C8A65C1452E17100717840 /* Foundation.framework */; }; 29 | 73C8A65F1452E18500717840 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73C8A65E1452E18500717840 /* CoreServices.framework */; }; 30 | 73C8A6611452E19400717840 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73C8A6601452E19400717840 /* Cocoa.framework */; }; 31 | 73C8A6631453AEDB00717840 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73C8A6621453AEDB00717840 /* SystemConfiguration.framework */; }; 32 | /* End PBXBuildFile section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | 7398CF271453DA3700344FDE /* TestiOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestiOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | 7398CF2E1453DA3700344FDE /* TestiOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TestiOS-Info.plist"; sourceTree = ""; }; 37 | 7398CF301453DA3700344FDE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 38 | 7398CF321453DA3700344FDE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 39 | 7398CF341453DA3700344FDE /* TestiOS-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TestiOS-Prefix.pch"; sourceTree = ""; }; 40 | 7398CF351453DA3700344FDE /* APCAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APCAppDelegate.h; sourceTree = ""; }; 41 | 7398CF361453DA3700344FDE /* APCAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = APCAppDelegate.m; sourceTree = ""; }; 42 | 7398CF4E1453E5B700344FDE /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.md; path = ../../README.md; sourceTree = ""; }; 43 | 73C8A6041452CA4D00717840 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 44 | 73C8A6061452CA4D00717840 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 45 | 73C8A6081452CA4D00717840 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 46 | 73C8A61B1452CAB000717840 /* interpose.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = interpose.c; path = ../../lib/inject_and_interpose/interpose.c; sourceTree = ""; }; 47 | 73C8A61C1452CAB000717840 /* interpose.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = interpose.h; path = ../../lib/inject_and_interpose/interpose.h; sourceTree = ""; }; 48 | 73C8A6221452CB6300717840 /* AppProxyCap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppProxyCap.h; path = ../../lib/AppProxyCap.h; sourceTree = ""; }; 49 | 73C8A6231452CB6300717840 /* AppProxyCap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppProxyCap.m; path = ../../lib/AppProxyCap.m; sourceTree = ""; }; 50 | 73C8A6251452D14E00717840 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; 51 | 73C8A62D1452DDF400717840 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 52 | 73C8A63B1452DE9F00717840 /* TestMac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestMac.app; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 73C8A6401452DE9F00717840 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 54 | 73C8A6411452DE9F00717840 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 55 | 73C8A6421452DE9F00717840 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 56 | 73C8A6451452DE9F00717840 /* TestMac-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TestMac-Info.plist"; sourceTree = ""; }; 57 | 73C8A6471452DE9F00717840 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 58 | 73C8A6491452DE9F00717840 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 59 | 73C8A64B1452DE9F00717840 /* TestMac-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TestMac-Prefix.pch"; sourceTree = ""; }; 60 | 73C8A64D1452DE9F00717840 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 61 | 73C8A64F1452DE9F00717840 /* APCAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APCAppDelegate.h; sourceTree = ""; }; 62 | 73C8A6501452DE9F00717840 /* APCAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = APCAppDelegate.m; sourceTree = ""; }; 63 | 73C8A6531452DE9F00717840 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 64 | 73C8A65A1452E16900717840 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreFoundation.framework; sourceTree = DEVELOPER_DIR; }; 65 | 73C8A65C1452E17100717840 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 66 | 73C8A65E1452E18500717840 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreServices.framework; sourceTree = DEVELOPER_DIR; }; 67 | 73C8A6601452E19400717840 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; }; 68 | 73C8A6621453AEDB00717840 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = SDKs/MacOSX10.7.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; 69 | 73C8A6641453C37800717840 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 70 | /* End PBXFileReference section */ 71 | 72 | /* Begin PBXFrameworksBuildPhase section */ 73 | 7398CF241453DA3700344FDE /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | 7398CF4D1453DD9D00344FDE /* SystemConfiguration.framework in Frameworks */, 78 | 7398CF291453DA3700344FDE /* UIKit.framework in Frameworks */, 79 | 7398CF2A1453DA3700344FDE /* Foundation.framework in Frameworks */, 80 | 7398CF2B1453DA3700344FDE /* CoreGraphics.framework in Frameworks */, 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | 73C8A6381452DE9F00717840 /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 73C8A6631453AEDB00717840 /* SystemConfiguration.framework in Frameworks */, 89 | 73C8A6611452E19400717840 /* Cocoa.framework in Frameworks */, 90 | 73C8A65F1452E18500717840 /* CoreServices.framework in Frameworks */, 91 | 73C8A65D1452E17100717840 /* Foundation.framework in Frameworks */, 92 | 73C8A65B1452E16900717840 /* CoreFoundation.framework in Frameworks */, 93 | ); 94 | runOnlyForDeploymentPostprocessing = 0; 95 | }; 96 | /* End PBXFrameworksBuildPhase section */ 97 | 98 | /* Begin PBXGroup section */ 99 | 7398CF2C1453DA3700344FDE /* TestiOS */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 7398CF351453DA3700344FDE /* APCAppDelegate.h */, 103 | 7398CF361453DA3700344FDE /* APCAppDelegate.m */, 104 | 7398CF2D1453DA3700344FDE /* Supporting Files */, 105 | ); 106 | path = TestiOS; 107 | sourceTree = ""; 108 | }; 109 | 7398CF2D1453DA3700344FDE /* Supporting Files */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 7398CF2E1453DA3700344FDE /* TestiOS-Info.plist */, 113 | 7398CF2F1453DA3700344FDE /* InfoPlist.strings */, 114 | 7398CF321453DA3700344FDE /* main.m */, 115 | 7398CF341453DA3700344FDE /* TestiOS-Prefix.pch */, 116 | ); 117 | name = "Supporting Files"; 118 | sourceTree = ""; 119 | }; 120 | 73C8A5F51452CA4D00717840 = { 121 | isa = PBXGroup; 122 | children = ( 123 | 7398CF4E1453E5B700344FDE /* README.md */, 124 | 73C8A61E1452CACE00717840 /* Lib */, 125 | 73C8A6431452DE9F00717840 /* TestMac */, 126 | 7398CF2C1453DA3700344FDE /* TestiOS */, 127 | 73C8A6031452CA4D00717840 /* Frameworks */, 128 | 73C8A6011452CA4D00717840 /* Products */, 129 | ); 130 | sourceTree = ""; 131 | }; 132 | 73C8A6011452CA4D00717840 /* Products */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 73C8A63B1452DE9F00717840 /* TestMac.app */, 136 | 7398CF271453DA3700344FDE /* TestiOS.app */, 137 | ); 138 | name = Products; 139 | sourceTree = ""; 140 | }; 141 | 73C8A6031452CA4D00717840 /* Frameworks */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 73C8A6641453C37800717840 /* SystemConfiguration.framework */, 145 | 73C8A6621453AEDB00717840 /* SystemConfiguration.framework */, 146 | 73C8A6601452E19400717840 /* Cocoa.framework */, 147 | 73C8A65E1452E18500717840 /* CoreServices.framework */, 148 | 73C8A65C1452E17100717840 /* Foundation.framework */, 149 | 73C8A65A1452E16900717840 /* CoreFoundation.framework */, 150 | 73C8A6251452D14E00717840 /* CFNetwork.framework */, 151 | 73C8A6041452CA4D00717840 /* UIKit.framework */, 152 | 73C8A6061452CA4D00717840 /* Foundation.framework */, 153 | 73C8A6081452CA4D00717840 /* CoreGraphics.framework */, 154 | 73C8A62D1452DDF400717840 /* CoreFoundation.framework */, 155 | 73C8A63F1452DE9F00717840 /* Other Frameworks */, 156 | ); 157 | name = Frameworks; 158 | sourceTree = ""; 159 | }; 160 | 73C8A61E1452CACE00717840 /* Lib */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | 73C8A61B1452CAB000717840 /* interpose.c */, 164 | 73C8A61C1452CAB000717840 /* interpose.h */, 165 | 73C8A6221452CB6300717840 /* AppProxyCap.h */, 166 | 73C8A6231452CB6300717840 /* AppProxyCap.m */, 167 | ); 168 | name = Lib; 169 | sourceTree = ""; 170 | }; 171 | 73C8A63F1452DE9F00717840 /* Other Frameworks */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | 73C8A6401452DE9F00717840 /* AppKit.framework */, 175 | 73C8A6411452DE9F00717840 /* CoreData.framework */, 176 | 73C8A6421452DE9F00717840 /* Foundation.framework */, 177 | ); 178 | name = "Other Frameworks"; 179 | sourceTree = ""; 180 | }; 181 | 73C8A6431452DE9F00717840 /* TestMac */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | 73C8A64F1452DE9F00717840 /* APCAppDelegate.h */, 185 | 73C8A6501452DE9F00717840 /* APCAppDelegate.m */, 186 | 73C8A6521452DE9F00717840 /* MainMenu.xib */, 187 | 73C8A6441452DE9F00717840 /* Supporting Files */, 188 | ); 189 | path = TestMac; 190 | sourceTree = ""; 191 | }; 192 | 73C8A6441452DE9F00717840 /* Supporting Files */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | 73C8A6451452DE9F00717840 /* TestMac-Info.plist */, 196 | 73C8A6461452DE9F00717840 /* InfoPlist.strings */, 197 | 73C8A6491452DE9F00717840 /* main.m */, 198 | 73C8A64B1452DE9F00717840 /* TestMac-Prefix.pch */, 199 | 73C8A64C1452DE9F00717840 /* Credits.rtf */, 200 | ); 201 | name = "Supporting Files"; 202 | sourceTree = ""; 203 | }; 204 | /* End PBXGroup section */ 205 | 206 | /* Begin PBXNativeTarget section */ 207 | 7398CF261453DA3700344FDE /* TestiOS */ = { 208 | isa = PBXNativeTarget; 209 | buildConfigurationList = 7398CF381453DA3700344FDE /* Build configuration list for PBXNativeTarget "TestiOS" */; 210 | buildPhases = ( 211 | 7398CF231453DA3700344FDE /* Sources */, 212 | 7398CF241453DA3700344FDE /* Frameworks */, 213 | 7398CF251453DA3700344FDE /* Resources */, 214 | ); 215 | buildRules = ( 216 | ); 217 | dependencies = ( 218 | ); 219 | name = TestiOS; 220 | productName = TestiOS; 221 | productReference = 7398CF271453DA3700344FDE /* TestiOS.app */; 222 | productType = "com.apple.product-type.application"; 223 | }; 224 | 73C8A63A1452DE9F00717840 /* TestMac */ = { 225 | isa = PBXNativeTarget; 226 | buildConfigurationList = 73C8A6551452DE9F00717840 /* Build configuration list for PBXNativeTarget "TestMac" */; 227 | buildPhases = ( 228 | 73C8A6371452DE9F00717840 /* Sources */, 229 | 73C8A6381452DE9F00717840 /* Frameworks */, 230 | 73C8A6391452DE9F00717840 /* Resources */, 231 | ); 232 | buildRules = ( 233 | ); 234 | dependencies = ( 235 | ); 236 | name = TestMac; 237 | productName = TestMac; 238 | productReference = 73C8A63B1452DE9F00717840 /* TestMac.app */; 239 | productType = "com.apple.product-type.application"; 240 | }; 241 | /* End PBXNativeTarget section */ 242 | 243 | /* Begin PBXProject section */ 244 | 73C8A5F71452CA4D00717840 /* Project object */ = { 245 | isa = PBXProject; 246 | attributes = { 247 | LastUpgradeCheck = 0420; 248 | ORGANIZATIONNAME = "FreeWheel Inc"; 249 | }; 250 | buildConfigurationList = 73C8A5FA1452CA4D00717840 /* Build configuration list for PBXProject "AppProxyCap" */; 251 | compatibilityVersion = "Xcode 3.2"; 252 | developmentRegion = English; 253 | hasScannedForEncodings = 0; 254 | knownRegions = ( 255 | en, 256 | ); 257 | mainGroup = 73C8A5F51452CA4D00717840; 258 | productRefGroup = 73C8A6011452CA4D00717840 /* Products */; 259 | projectDirPath = ""; 260 | projectRoot = ""; 261 | targets = ( 262 | 73C8A63A1452DE9F00717840 /* TestMac */, 263 | 7398CF261453DA3700344FDE /* TestiOS */, 264 | ); 265 | }; 266 | /* End PBXProject section */ 267 | 268 | /* Begin PBXResourcesBuildPhase section */ 269 | 7398CF251453DA3700344FDE /* Resources */ = { 270 | isa = PBXResourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | 7398CF311453DA3700344FDE /* InfoPlist.strings in Resources */, 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | 73C8A6391452DE9F00717840 /* Resources */ = { 278 | isa = PBXResourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | 73C8A6481452DE9F00717840 /* InfoPlist.strings in Resources */, 282 | 73C8A64E1452DE9F00717840 /* Credits.rtf in Resources */, 283 | 73C8A6541452DE9F00717840 /* MainMenu.xib in Resources */, 284 | 7398CF4F1453E5B700344FDE /* README.md in Resources */, 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | }; 288 | /* End PBXResourcesBuildPhase section */ 289 | 290 | /* Begin PBXSourcesBuildPhase section */ 291 | 7398CF231453DA3700344FDE /* Sources */ = { 292 | isa = PBXSourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | 7398CF4A1453DD8400344FDE /* interpose.c in Sources */, 296 | 7398CF4B1453DD8400344FDE /* AppProxyCap.m in Sources */, 297 | 7398CF331453DA3700344FDE /* main.m in Sources */, 298 | 7398CF371453DA3700344FDE /* APCAppDelegate.m in Sources */, 299 | ); 300 | runOnlyForDeploymentPostprocessing = 0; 301 | }; 302 | 73C8A6371452DE9F00717840 /* Sources */ = { 303 | isa = PBXSourcesBuildPhase; 304 | buildActionMask = 2147483647; 305 | files = ( 306 | 73C8A6581452DF6900717840 /* interpose.c in Sources */, 307 | 73C8A6591452DF6900717840 /* AppProxyCap.m in Sources */, 308 | 73C8A64A1452DE9F00717840 /* main.m in Sources */, 309 | 73C8A6511452DE9F00717840 /* APCAppDelegate.m in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | /* End PBXSourcesBuildPhase section */ 314 | 315 | /* Begin PBXVariantGroup section */ 316 | 7398CF2F1453DA3700344FDE /* InfoPlist.strings */ = { 317 | isa = PBXVariantGroup; 318 | children = ( 319 | 7398CF301453DA3700344FDE /* en */, 320 | ); 321 | name = InfoPlist.strings; 322 | sourceTree = ""; 323 | }; 324 | 73C8A6461452DE9F00717840 /* InfoPlist.strings */ = { 325 | isa = PBXVariantGroup; 326 | children = ( 327 | 73C8A6471452DE9F00717840 /* en */, 328 | ); 329 | name = InfoPlist.strings; 330 | sourceTree = ""; 331 | }; 332 | 73C8A64C1452DE9F00717840 /* Credits.rtf */ = { 333 | isa = PBXVariantGroup; 334 | children = ( 335 | 73C8A64D1452DE9F00717840 /* en */, 336 | ); 337 | name = Credits.rtf; 338 | sourceTree = ""; 339 | }; 340 | 73C8A6521452DE9F00717840 /* MainMenu.xib */ = { 341 | isa = PBXVariantGroup; 342 | children = ( 343 | 73C8A6531452DE9F00717840 /* en */, 344 | ); 345 | name = MainMenu.xib; 346 | sourceTree = ""; 347 | }; 348 | /* End PBXVariantGroup section */ 349 | 350 | /* Begin XCBuildConfiguration section */ 351 | 7398CF391453DA3700344FDE /* Debug */ = { 352 | isa = XCBuildConfiguration; 353 | buildSettings = { 354 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 355 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 356 | GCC_PREFIX_HEADER = "TestiOS/TestiOS-Prefix.pch"; 357 | INFOPLIST_FILE = "TestiOS/TestiOS-Info.plist"; 358 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 359 | PRODUCT_NAME = "$(TARGET_NAME)"; 360 | WRAPPER_EXTENSION = app; 361 | }; 362 | name = Debug; 363 | }; 364 | 7398CF3A1453DA3700344FDE /* Release */ = { 365 | isa = XCBuildConfiguration; 366 | buildSettings = { 367 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 368 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 369 | GCC_PREFIX_HEADER = "TestiOS/TestiOS-Prefix.pch"; 370 | INFOPLIST_FILE = "TestiOS/TestiOS-Info.plist"; 371 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 372 | PRODUCT_NAME = "$(TARGET_NAME)"; 373 | WRAPPER_EXTENSION = app; 374 | }; 375 | name = Release; 376 | }; 377 | 73C8A6161452CA4D00717840 /* Debug */ = { 378 | isa = XCBuildConfiguration; 379 | buildSettings = { 380 | ALWAYS_SEARCH_USER_PATHS = NO; 381 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 382 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 383 | COPY_PHASE_STRIP = NO; 384 | GCC_C_LANGUAGE_STANDARD = gnu99; 385 | GCC_DYNAMIC_NO_PIC = NO; 386 | GCC_OPTIMIZATION_LEVEL = 0; 387 | GCC_PREPROCESSOR_DEFINITIONS = ( 388 | "DEBUG=1", 389 | "$(inherited)", 390 | ); 391 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 392 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 393 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 394 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 395 | GCC_WARN_UNUSED_VARIABLE = YES; 396 | IPHONEOS_DEPLOYMENT_TARGET = 3.0; 397 | MACOSX_DEPLOYMENT_TARGET = 10.6; 398 | SDKROOT = iphoneos; 399 | }; 400 | name = Debug; 401 | }; 402 | 73C8A6171452CA4D00717840 /* Release */ = { 403 | isa = XCBuildConfiguration; 404 | buildSettings = { 405 | ALWAYS_SEARCH_USER_PATHS = NO; 406 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 407 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 408 | COPY_PHASE_STRIP = YES; 409 | GCC_C_LANGUAGE_STANDARD = gnu99; 410 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 411 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 412 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 413 | GCC_WARN_UNUSED_VARIABLE = YES; 414 | IPHONEOS_DEPLOYMENT_TARGET = 3.0; 415 | MACOSX_DEPLOYMENT_TARGET = 10.6; 416 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 417 | SDKROOT = iphoneos; 418 | VALIDATE_PRODUCT = YES; 419 | }; 420 | name = Release; 421 | }; 422 | 73C8A6561452DE9F00717840 /* Debug */ = { 423 | isa = XCBuildConfiguration; 424 | buildSettings = { 425 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 426 | FRAMEWORK_SEARCH_PATHS = ( 427 | "$(inherited)", 428 | "\"$(DEVELOPER_FRAMEWORKS_DIR)\"", 429 | ); 430 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 431 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 432 | GCC_PREFIX_HEADER = "TestMac/TestMac-Prefix.pch"; 433 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 434 | INFOPLIST_FILE = "TestMac/TestMac-Info.plist"; 435 | MACOSX_DEPLOYMENT_TARGET = 10.7; 436 | ONLY_ACTIVE_ARCH = YES; 437 | PRODUCT_NAME = "$(TARGET_NAME)"; 438 | SDKROOT = macosx; 439 | WRAPPER_EXTENSION = app; 440 | }; 441 | name = Debug; 442 | }; 443 | 73C8A6571452DE9F00717840 /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | buildSettings = { 446 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 447 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 448 | FRAMEWORK_SEARCH_PATHS = ( 449 | "$(inherited)", 450 | "\"$(DEVELOPER_FRAMEWORKS_DIR)\"", 451 | ); 452 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 453 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 454 | GCC_PREFIX_HEADER = "TestMac/TestMac-Prefix.pch"; 455 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 456 | INFOPLIST_FILE = "TestMac/TestMac-Info.plist"; 457 | MACOSX_DEPLOYMENT_TARGET = 10.7; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | SDKROOT = macosx; 460 | WRAPPER_EXTENSION = app; 461 | }; 462 | name = Release; 463 | }; 464 | /* End XCBuildConfiguration section */ 465 | 466 | /* Begin XCConfigurationList section */ 467 | 7398CF381453DA3700344FDE /* Build configuration list for PBXNativeTarget "TestiOS" */ = { 468 | isa = XCConfigurationList; 469 | buildConfigurations = ( 470 | 7398CF391453DA3700344FDE /* Debug */, 471 | 7398CF3A1453DA3700344FDE /* Release */, 472 | ); 473 | defaultConfigurationIsVisible = 0; 474 | defaultConfigurationName = Release; 475 | }; 476 | 73C8A5FA1452CA4D00717840 /* Build configuration list for PBXProject "AppProxyCap" */ = { 477 | isa = XCConfigurationList; 478 | buildConfigurations = ( 479 | 73C8A6161452CA4D00717840 /* Debug */, 480 | 73C8A6171452CA4D00717840 /* Release */, 481 | ); 482 | defaultConfigurationIsVisible = 0; 483 | defaultConfigurationName = Release; 484 | }; 485 | 73C8A6551452DE9F00717840 /* Build configuration list for PBXNativeTarget "TestMac" */ = { 486 | isa = XCConfigurationList; 487 | buildConfigurations = ( 488 | 73C8A6561452DE9F00717840 /* Debug */, 489 | 73C8A6571452DE9F00717840 /* Release */, 490 | ); 491 | defaultConfigurationIsVisible = 0; 492 | defaultConfigurationName = Release; 493 | }; 494 | /* End XCConfigurationList section */ 495 | }; 496 | rootObject = 73C8A5F71452CA4D00717840 /* Project object */; 497 | } 498 | -------------------------------------------------------------------------------- /test/AppProxyCap/TestMac/APCAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // APCAppDelegate.h 3 | // TestMac 4 | // 5 | // Created by Du Song on 11-10-22. 6 | // Copyright (c) 2011年 FreeWheel Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface APCAppDelegate : NSObject 12 | 13 | @property (assign) IBOutlet NSWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /test/AppProxyCap/TestMac/APCAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // APCAppDelegate.m 3 | // TestMac 4 | // 5 | // Created by Du Song on 11-10-22. 6 | // Copyright (c) 2011年 FreeWheel Inc. All rights reserved. 7 | // 8 | 9 | #import "APCAppDelegate.h" 10 | #import 11 | 12 | @implementation APCAppDelegate 13 | 14 | @synthesize window = _window; 15 | 16 | - (void)dealloc 17 | { 18 | [super dealloc]; 19 | } 20 | 21 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 22 | { 23 | NSError *error = nil; 24 | NSString *s = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.iana.org/robots.txt"] encoding:NSUTF8StringEncoding error:&error]; 25 | NSLog(@"Loaded %@ error %@", s, error); 26 | 27 | exit(0); 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /test/AppProxyCap/TestMac/TestMac-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | org.rollingcode.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2011年 FreeWheel Inc. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /test/AppProxyCap/TestMac/TestMac-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'TestMac' target in the 'TestMac' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /test/AppProxyCap/TestMac/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /test/AppProxyCap/TestMac/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /test/AppProxyCap/TestMac/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TestMac 4 | // 5 | // Created by Du Song on 11-10-22. 6 | // Copyright (c) 2011年 FreeWheel Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppProxyCap.h" 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | [AppProxyCap activate]; 15 | [AppProxyCap setProxy:AppProxy_HTTP Host:@"127.0.0.1" Port:8086]; 16 | return NSApplicationMain(argc, (const char **)argv); 17 | } 18 | -------------------------------------------------------------------------------- /test/AppProxyCap/TestiOS/APCAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // APCAppDelegate.h 3 | // TestiOS 4 | // 5 | // Created by Du Song on 11-10-23. 6 | // Copyright (c) 2011年 FreeWheel Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface APCAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /test/AppProxyCap/TestiOS/APCAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // APCAppDelegate.m 3 | // TestiOS 4 | // 5 | // Created by Du Song on 11-10-23. 6 | // Copyright (c) 2011年 FreeWheel Inc. All rights reserved. 7 | // 8 | 9 | #import "APCAppDelegate.h" 10 | 11 | @implementation APCAppDelegate 12 | 13 | @synthesize window = _window; 14 | 15 | - (void)dealloc 16 | { 17 | [_window release]; 18 | [super dealloc]; 19 | } 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 24 | // Override point for customization after application launch. 25 | self.window.backgroundColor = [UIColor whiteColor]; 26 | [self.window makeKeyAndVisible]; 27 | 28 | NSError *error = nil; 29 | NSString *s = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.iana.org/robots.txt"] encoding:NSUTF8StringEncoding error:&error]; 30 | NSLog(@"Loaded %@ error %@", s, error); 31 | 32 | exit(0); 33 | 34 | return YES; 35 | } 36 | 37 | - (void)applicationWillResignActive:(UIApplication *)application 38 | { 39 | /* 40 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 41 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 42 | */ 43 | } 44 | 45 | - (void)applicationDidEnterBackground:(UIApplication *)application 46 | { 47 | /* 48 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 49 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 50 | */ 51 | } 52 | 53 | - (void)applicationWillEnterForeground:(UIApplication *)application 54 | { 55 | /* 56 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 57 | */ 58 | } 59 | 60 | - (void)applicationDidBecomeActive:(UIApplication *)application 61 | { 62 | /* 63 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 64 | */ 65 | } 66 | 67 | - (void)applicationWillTerminate:(UIApplication *)application 68 | { 69 | /* 70 | Called when the application is about to terminate. 71 | Save data if appropriate. 72 | See also applicationDidEnterBackground:. 73 | */ 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /test/AppProxyCap/TestiOS/TestiOS-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | org.rollingcode.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /test/AppProxyCap/TestiOS/TestiOS-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'TestiOS' target in the 'TestiOS' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /test/AppProxyCap/TestiOS/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /test/AppProxyCap/TestiOS/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TestiOS 4 | // 5 | // Created by Du Song on 11-10-23. 6 | // Copyright (c) 2011年 FreeWheel Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "APCAppDelegate.h" 12 | #import "AppProxyCap.h" 13 | 14 | int main(int argc, char *argv[]) 15 | { 16 | @autoreleasepool { 17 | [AppProxyCap activate]; 18 | [AppProxyCap setProxy:AppProxy_HTTP Host:@"192.168.1.4" Port:8086]; 19 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([APCAppDelegate class])); 20 | } 21 | } 22 | --------------------------------------------------------------------------------