8000 fixed a warning, · ThinkCode/iProxy@926ee95 · GitHub
[go: up one dir, main page]

Skip to content

Commit 926ee95

Browse files
committed
fixed a warning,
use interface depending on simulator/device, added ad-hoc build
1 parent 0187bcf commit 926ee95

File tree

5 files changed

+78
-9
lines changed

5 files changed

+78
-9
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ build/*
1212
*.tar.gz
1313
*.gz
1414
*.psd
15-
*.orig
15+
*.orig
16+
*.mobileprovision

Frameworks/srelay.diff

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,20 @@ diff -u srelay-0.4.7p3.orig/init.c srelay-0.4.7p3/init.c
3434
if (str_serv_sock == NULL)
3535
diff -u srelay-0.4.7p3.orig/main.c srelay-0.4.7p3/main.c
3636
--- srelay-0.4.7p3.orig/main.c 2009-12-17 15:57:16.000000000 +0100
37-
+++ srelay-0.4.7p3/main.c 2010-01-14 04:18:46.000000000 +0100
38-
@@ -99,7 +99,7 @@
37+
+++ srelay-0.4.7p3/main.c 2010-01-19 14:23:53.000000000 +0100
38+
@@ -99,10 +99,10 @@
3939
exit(1);
4040
}
4141

4242
-int main(int ac, char **av)
4343
+int local_main(int ac, char **av)
4444
{
4545
int ch, i=0;
46-
pid_t pid;
46+
- pid_t pid;
47+
+// pid_t pid;
48+
FILE *fp;
49+
uid_t uid;
50+
#ifdef USE_THREAD
4751
@@ -279,50 +279,51 @@
4852
}
4953
#endif

Resources/Entitlements.plist

Lines changed: 8 additions & 0 deletions
7440
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>get-task-allow</key>
6+
<false/>
7+
</dict>
8+
</plist>

Sources/AppDelegate.m

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ @implementation AppDelegate
2929
int queue_init();
3030
int local_main(int ac, char **av);
3131

32-
- (NSString *)getIPAddress
32+
- (NSString *)getIPAddressForInterface:(NSString*)ifname
3333
{
3434
NSString *address = nil;
3535

@@ -45,7 +45,7 @@ - (NSString *)getIPAddress
4545

4646
if(temp_addr->ifa_addr->sa_family == AF_INET) {
4747

48-
if([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:@"en1"]) {
48+
if([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:ifname]) {
4949

5050
address = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr)];
5151
}
@@ -66,7 +66,18 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
6666
[window addSubview:statusViewController.view];
6767
[window makeKeyAndVisible];
6868

69-
NSString *ip = [self getIPAddress];
69+
#if TARGET_IPHONE_SIMULATOR
70+
NSString *ip = [self getIPAddressForInterface:@"en1"];
71+
#else
72+
NSString *ip = [self getIPAddressForInterface:@"en0"];
73+
#endif
74+
75+
if (ip == nil) {
76+
statusViewController.ipLabel.text = @"";
77+
statusViewController.portLabel.text = @"";
78+
return;
79+
}
80+
7081
NSUInteger port = 8888;
7182

7283
NSLog(@"ip = %@", ip);

iProxy.xcodeproj/project.pbxproj

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1111
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
1212
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
13+
9D2224E51105E6A6003F4E04 /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9D2224E41105E6A6003F4E04 /* Entitlements.plist */; };
1314
9D5B3C5F1103D4E2003C8FCF /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 9D5B3C5E1103D4E2003C8FCF /* Icon.png */; };
1415
9D63172B10FEAC6C0041EE37 /* auth-pwd.c in Sources */ = {isa = PBXBuildFile; fileRef = 9D63172110FEAC6C0041EE37 /* auth-pwd.c */; };
1516
9D63172C10FEAC6C0041EE37 /* get-bind.c in Sources */ = {isa = PBXBuildFile; fileRef = 9D63172210FEAC6C0041EE37 /* get-bind.c */; };
@@ -32,6 +33,7 @@
3233
1D6058910D05DD3D006BFB54 /* iProxy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iProxy.app; sourceTree = BUILT_PRODUCTS_DIR; };
3334
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
3435
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
36+
9D2224E41105E6A6003F4E04 /* Entitlements.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Entitlements.plist; path = Resources/Entitlements.plist; sourceTree = "<group>"; };
3537
9D5B3C5E1103D4E2003C8FCF /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = Resources/Icon.png; sourceTree = "<group>"; };
3638
9D63172110FEAC6C0041EE37 /* auth-pwd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "auth-pwd.c"; path = "Frameworks/srelay-0.4.7p3/auth-pwd.c"; sourceTree = "<group>"; };
3739
9D63172210FEAC6C0041EE37 /* get-bind.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "get-bind.c"; path = "Frameworks/srelay-0.4.7p3/get-bind.c"; sourceTree = "<group>"; };
@@ -108,6 +110,7 @@
108110
9D63174510FEACD30041EE37 /* Info.plist */,
109111
9D63174610FEACD30041EE37 /* StatusViewController.xib */,
110112
9D63174710FEACD30041EE37 /* MainWindow.xib */,
113+
9D2224E41105E6A6003F4E04 /* Entitlements.plist */,
111114
);
112115
name = Resources;
113116
sourceTree = "<group>";
@@ -197,6 +200,7 @@
197200
9D63174A10FEACD30041EE37 /* MainWindow.xib in Resources */,
198201
9D5B3C5F1103D4E2003C8FCF /* Icon.png in Resources */,
199202
9DB0CF66110551F6001F4119 /* Status.png in Resources */,
203+
9D2224E51105E6A6003F4E04 /* Entitlements.plist in Resources */,
200204
);
201205
runOnlyForDeploymentPostprocessing = 0;
202206
};
@@ -228,6 +232,8 @@
228232
isa = XCBuildConfiguration;
229233
buildSettings = {
230234
ALWAYS_SEARCH_USER_PATHS = NO;
235+
CODE_SIGN_ENTITLEMENTS = Resources/Entitlements.plist;
236+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
231237
COPY_PHASE_STRIP = NO;
232238
GCC_DYNAMIC_NO_PIC = NO;
233239
GCC_OPTIMIZATION_LEVEL = 0;
@@ -237,23 +243,58 @@
237243
INFOPLIST_FILE = Resources/Info.plist;
238244
OTHER_LDFLAGS = "";
239245
PRODUCT_NAME = iProxy;
246+
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
240247
};
241248
name = Debug;
242249
};
243250
1D6058950D05DD3E006BFB54 /* Release */ = {
244251
isa = XCBuildConfiguration;
245252
buildSettings = {
246253
ALWAYS_SEARCH_USER_PATHS = NO;
254+
CODE_SIGN_ENTITLEMENTS = "";
255+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
247256
COPY_PHASE_STRIP = YES;
248257
GCC_PRECOMPILE_PREFIX_HEADER = YES;
249258
GCC_PREFIX_HEADER = Sources/Prefix.pch;
250259
GCC_PREPROCESSOR_DEFINITIONS = "";
251260
INFOPLIST_FILE = Resources/Info.plist;
252261
OTHER_LDFLAGS = "";
253262
PRODUCT_NAME = iProxy;
263+
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
254264
};
255265
name = Release;
256266
};
267+
9D2224DD1105E60B003F4E04 /* Ad-hoc */ = {
268+
isa = XCBuildConfiguration;
269+
buildSettings = {
270+
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
271+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
272+
GCC_C_LANGUAGE_STANDARD = c99;
273+
GCC_WARN_ABOUT_RETURN_TYPE = YES;
274+
GCC_WARN_UNUSED_VARIABLE = YES;
275+
ONLY_ACTIVE_ARCH = NO;
276+
PREBINDING = NO;
277+
SDKROOT = iphoneos3.1;
278+
};
279+
name = "Ad-hoc";
280+
};
281+
9D2224DE1105E60B003F4E04 /* Ad-hoc */ = {
282+
isa = XCBuildConfiguration;
283+
buildSettings = {
284+
ALWAYS_SEARCH_USER_PATHS = NO;
285+
CODE_SIGN_ENTITLEMENTS = Resources/Entitlements.plist;
286+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
287+
COPY_PHASE_STRIP = YES;
288+
GCC_PRECOMPILE_PREFIX_HEADER = YES;
289+
GCC_PREFIX_HEADER = Sources/Prefix.pch;
290+
GCC_PREPROCESSOR_DEFINITIONS = "";
291+
INFOPLIST_FILE = Resources/Info.plist;
292+
OTHER_LDFLAGS = "";
293+
PRODUCT_NAME = iProxy;
294+
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
295+
};
296+
name = "Ad-hoc";
297+
};
257298
C01FCF4F08A954540054247B /* Debug */ = {
258299
isa = XCBuildConfiguration;
259300
buildSettings = {
@@ -262,8 +303,9 @@
262303
GCC_C_LANGUAGE_STANDARD = c99;
263304
GCC_WARN_ABOUT_RETURN_TYPE = YES;
264305
GCC_WARN_UNUSED_VARIABLE = YES;
306+
ONLY_ACTIVE_ARCH = NO;
265307
PREBINDING = NO;
266-
SDKROOT = iphoneos3.1.2;
308+
SDKROOT = iphoneos3.1;
267309
};
268310
name = Debug;
269311
};
@@ -275,8 +317,9 @@
275317
GCC_C_LANGUAGE_STANDARD = c99;
276318
GCC_WARN_ABOUT_RETURN_TYPE = YES;
277319
GCC_WARN_UNUSED_VARIABLE = YES;
320+
ONLY_ACTIVE_ARCH = NO;
278321
PREBINDING = NO;
279-
SDKROOT = iphoneos3.1.2;
322+
SDKROOT = iphoneos3.1;
280323
};
281324
name = Release;
282325
};
@@ -288,6 +331,7 @@
288331
buildConfigurations = (
289332
1D6058940D05DD3E006BFB54 /* Debug */,
290333
1D6058950D05DD3E006BFB54 /* Release */,
334+
9D2224DE1105E60B003F4E04 /* Ad-hoc */,
291335
);
292336
defaultConfigurationIsVisible = 0;
293337
defaultConfigurationName = Release;
@@ -297,6 +341,7 @@
297341
buildConfigurations = (
298342
C01FCF4F08A954540054247B /* Debug */,
299343
C01FCF5008A954540054247B /* Release */,
344+
9D2224DD1105E60B003F4E04 /* Ad-hoc */,
300345
);
301346
defaultConfigurationIsVisible = 0;
302347
defaultConfigurationName = Release;

0 commit comments

Comments
 (0)
0