Skip to content

Commit

Permalink
Added constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Gildas Quiniou authored and Gildas Quiniou committed Jan 8, 2014
1 parent 90eb3dd commit df3479c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Binary file not shown.
13 changes: 8 additions & 5 deletions AppStaller/BPPAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#import "BPPAppDelegate.h"
#import "NSFileHandle+Readable.h"

#define BPP_WEB_PORT 8000
#define BPP_PYTHON @"/usr/bin/python"

@interface BPPAppDelegate()
@property (nonatomic, retain) NSFileHandle *fdStdout;
@property (nonatomic, retain) NSTask *task;
Expand Down Expand Up @@ -56,7 +59,7 @@ - (IBAction)go:(id)sender
}
}

[self.txtUrl setStringValue:[NSString stringWithFormat:@"http://%@:8000", anIp]];
[self.txtUrl setStringValue:[NSString stringWithFormat:@"http://%@:%d", anIp, BPP_WEB_PORT]];

aString = [NSMutableString stringWithString:@"<html><head></head><body>\n"];

Expand All @@ -75,7 +78,7 @@ - (IBAction)go:(id)sender
{
NSLog(@"IPA: %@", aFile);
fileName = [aFile substringToIndex:aRange.length - 4];
[aString appendFormat:@"<a href=\"itms-services://?action=download-manifest&url=http://%@:8000/%@.plist\">%@</a><br />\n", anIp, fileName, fileName];
[aString appendFormat:@"<a href=\"itms-services://?action=download-manifest&url=http://%@:%d/%@.plist\">%@</a><br />\n", anIp, BPP_WEB_PORT, fileName, fileName];
aDict = [NSMutableDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.plist", path, fileName]];
if (aDict != nil)
{
Expand All @@ -89,7 +92,7 @@ - (IBAction)go:(id)sender
([[anObj objectForKey:@"assets"] count] > 0))
{
anObj = [[anObj objectForKey:@"assets"] objectAtIndex:0];
[anObj setObject:[NSString stringWithFormat:@"http://%@:8000/%@.ipa", anIp, fileName] forKey:@"url"];
[anObj setObject:[NSString stringWithFormat:@"http://%@:%d/%@.ipa", anIp, BPP_WEB_PORT, fileName] forKey:@"url"];
}
anObj = [[aDict objectForKey:@"items"] objectAtIndex:0];
if ([[anObj objectForKey:@"metadata"] isKindOfClass:[NSDictionary class]])
Expand All @@ -109,8 +112,8 @@ - (IBAction)go:(id)sender
attributes:nil];

self.task = [[NSTask alloc] init];
[task setLaunchPath:@"/usr/bin/python"];
[task setArguments:[NSArray arrayWithObjects:@"-m", @"SimpleHTTPServer", @"8000", nil]];
[task setLaunchPath:BPP_PYTHON];
[task setArguments:[NSArray arrayWithObjects:@"-m", @"SimpleHTTPServer", [NSString stringWithFormat:@"%d", BPP_WEB_PORT], nil]];

NSPipe *outPipe;
outPipe = [NSPipe pipe];
Expand Down
8 changes: 3 additions & 5 deletions AppStaller/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,8 @@
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xRN-fC-HkL">
<rect key="frame" x="76" y="251" width="329" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" id="FQl-1R-T6t">
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="A humble replacement for Mavericks broken iPhone Utility App Installer" id="FQl-1R-T6t">
<font key="font" metaFont="system"/>
<string key="title">A Quick and Dirty replacement for
Mavericks broken iPhone Utility App Installer</string>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
Expand Down Expand Up @@ -712,9 +710,9 @@ Mavericks broken iPhone Utility App Installer</string>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wgw-vR-sgx">
<rect key="frame" x="41" y="80" width="399" height="17"/>
<rect key="frame" x="41" y="82" width="399" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" id="jOM-o7-l7j">
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="&lt;click GO to reveal the URL>" id="jOM-o7-l7j">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
Expand Down

0 comments on commit df3479c

Please sign in to comment.