diff --git a/JamWiFi.xcodeproj/project.pbxproj b/JamWiFi.xcodeproj/project.pbxproj index d481b06..e68af5d 100644 --- a/JamWiFi.xcodeproj/project.pbxproj +++ b/JamWiFi.xcodeproj/project.pbxproj @@ -390,7 +390,9 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "JamWiFi/JamWiFi-Prefix.pch"; INFOPLIST_FILE = "JamWiFi/JamWiFi-Info.plist"; + MACOSX_DEPLOYMENT_TARGET = 10.7; PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx10.7; WRAPPER_EXTENSION = app; }; name = Debug; @@ -402,7 +404,9 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "JamWiFi/JamWiFi-Prefix.pch"; INFOPLIST_FILE = "JamWiFi/JamWiFi-Info.plist"; + MACOSX_DEPLOYMENT_TARGET = 10.7; PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx10.7; WRAPPER_EXTENSION = app; }; name = Release; diff --git a/JamWiFi/ANListView.h b/JamWiFi/ANListView.h index f1a987e..2c1cf25 100644 --- a/JamWiFi/ANListView.h +++ b/JamWiFi/ANListView.h @@ -27,4 +27,6 @@ - (void)disassociateButton:(id)sender; - (void)jamButton:(id)sender; +- (NSString *)securityTypeString:(CWNetwork *)network; + @end diff --git a/JamWiFi/ANListView.m b/JamWiFi/ANListView.m index 3edc681..319afb4 100644 --- a/JamWiFi/ANListView.m +++ b/JamWiFi/ANListView.m @@ -53,21 +53,27 @@ - (id)initWithFrame:(NSRect)frame { NSTableColumn * channelColumn = [[NSTableColumn alloc] initWithIdentifier:@"channel"]; [[channelColumn headerCell] setStringValue:@"CH"]; [channelColumn setWidth:40]; - [channelColumn setEditable:NO]; + [channelColumn setEditable:YES]; [networksTable addTableColumn:channelColumn]; NSTableColumn * essidColumn = [[NSTableColumn alloc] initWithIdentifier:@"essid"]; [[essidColumn headerCell] setStringValue:@"ESSID"]; [essidColumn setWidth:200]; - [essidColumn setEditable:NO]; + [essidColumn setEditable:YES]; [networksTable addTableColumn:essidColumn]; NSTableColumn * bssidColumn = [[NSTableColumn alloc] initWithIdentifier:@"bssid"]; [[bssidColumn headerCell] setStringValue:@"BSSID"]; [bssidColumn setWidth:120]; - [bssidColumn setEditable:NO]; + [bssidColumn setEditable:YES]; [networksTable addTableColumn:bssidColumn]; + NSTableColumn * encColumn = [[NSTableColumn alloc] initWithIdentifier:@"enc"]; + [[encColumn headerCell] setStringValue:@"Security"]; + [encColumn setWidth:60]; + [encColumn setEditable:YES]; + [networksTable addTableColumn:encColumn]; + [networksScrollView setDocumentView:networksTable]; [networksScrollView setBorderType:NSBezelBorder]; [networksScrollView setHasVerticalScroller:YES]; @@ -137,16 +143,23 @@ - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { CWNetwork * network = [networks objectAtIndex:row]; + if ([[tableColumn identifier] isEqualToString:@"channel"]) { return [NSNumber numberWithInt:(int)network.wlanChannel.channelNumber]; } else if ([[tableColumn identifier] isEqualToString:@"essid"]) { return network.ssid; } else if ([[tableColumn identifier] isEqualToString:@"bssid"]) { return network.bssid; + } else if ([[tableColumn identifier] isEqualToString:@"enc"]) { + return [self securityTypeString:network]; } return nil; } +- (void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { + return; +} + - (void)tableViewSelectionDidChange:(NSNotification *)notification { if ([[networksTable selectedRowIndexes] count] > 0) { [jamButton setEnabled:YES]; @@ -155,6 +168,18 @@ - (void)tableViewSelectionDidChange:(NSNotification *)notification { } } +- (NSString *)securityTypeString:(CWNetwork *)network { + if ([network supportsSecurity:kCWSecurityDynamicWEP]) { + return @"WEP"; + } else if ([network supportsSecurity:kCWSecurityModeOpen]) { + return @"Open"; + } else if ([network supportsSecurity:kCWSecurityEnterprise]) { + return @"Enterprise"; + } else { + return @"WPA"; + } +} + #pragma mark - Private - - (void)handleScanError { diff --git a/JamWiFi/main.m b/JamWiFi/main.m index 8b97dae..03efd9a 100644 --- a/JamWiFi/main.m +++ b/JamWiFi/main.m @@ -42,7 +42,7 @@ int main(int argc, char *argv[]) { myStatus = AuthorizationExecuteWithPrivileges(myAuthorizationRef, myToolPath, myFlags, myArguments, NULL); AuthorizationFree(myAuthorizationRef, kAuthorizationFlagDefaults); - return 0; + exit(0); } return NSApplicationMain(argc, (const char **)argv); }