Skip to content

Commit

Permalink
Release 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
anonymouz4 committed Jun 29, 2019
1 parent 187263c commit 2052632
Show file tree
Hide file tree
Showing 13 changed files with 221 additions and 122 deletions.
91 changes: 91 additions & 0 deletions JamWiFi.xcodeproj/xcshareddata/xcschemes/JamWiFi.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FAB94BC615C0557A0031197A"
BuildableName = "JamWiFi.app"
BlueprintName = "JamWiFi"
ReferencedContainer = "container:JamWiFi.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FAB94BC615C0557A0031197A"
BuildableName = "JamWiFi.app"
BlueprintName = "JamWiFi"
ReferencedContainer = "container:JamWiFi.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FAB94BC615C0557A0031197A"
BuildableName = "JamWiFi.app"
BlueprintName = "JamWiFi"
ReferencedContainer = "container:JamWiFi.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FAB94BC615C0557A0031197A"
BuildableName = "JamWiFi.app"
BlueprintName = "JamWiFi"
ReferencedContainer = "container:JamWiFi.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,13 @@
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>FAB94BC615C0557A0031197A</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
2 changes: 1 addition & 1 deletion JamWiFi/ANAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
scan = dlsym(libHandle, "Apple80211Scan");
_close = dlsym(libHandle, "Apple80211Close");

networkList = [[ANListView alloc] initWithFrame:[self.window.contentView bounds]];
networkList = [ANListView.alloc initWithFrame:self.window.contentView.bounds];
[self pushView:networkList direction:ANViewSlideDirectionForward];
[CarbonAppProcess.currentProcess makeFrontmost];
}
Expand Down
118 changes: 59 additions & 59 deletions JamWiFi/ANClientKiller.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ @implementation ANClientKiller

- (id)initWithFrame:(NSRect)frame sniffer:(ANWiFiSniffer *)theSniffer networks:(NSArray *)networks clients:(NSArray *)theClients {
if ((self = [super initWithFrame:frame])) {
clients = [theClients mutableCopy];
clients = theClients.mutableCopy;
sniffer = theSniffer;
[sniffer setDelegate:self];
sniffer.delegate = self;
[sniffer start];

NSMutableArray * mChannels = [[NSMutableArray alloc] init];
NSMutableArray * mChannels = NSMutableArray.new;
for (CWNetwork * net in networks) {
if (![mChannels containsObject:net.wlanChannel]) {
[mChannels addObject:net.wlanChannel];
Expand All @@ -32,17 +32,17 @@ - (id)initWithFrame:(NSRect)frame sniffer:(ANWiFiSniffer *)theSniffer networks:(
channels = [mChannels copy];
channelIndex = -1;

NSMutableDictionary * mNetworksPerChannel = [[NSMutableDictionary alloc] init];
NSMutableDictionary * mNetworksPerChannel = NSMutableDictionary.new;
for (CWChannel * channel in channels) {
NSMutableArray * mNetworks = [[NSMutableArray alloc] init];
NSMutableArray * mNetworks = NSMutableArray.new;
for (CWNetwork * network in networks) {
if ([[network wlanChannel] isEqualToChannel:channel]) {
[mNetworks addObject:network];
}
}
[mNetworksPerChannel setObject:[mNetworks copy] forKey:channel];
[mNetworksPerChannel setObject:mNetworks.copy forKey:channel];
}
networksForChannel = [mNetworksPerChannel copy];
networksForChannel = mNetworksPerChannel.copy;

jamTimer = [NSTimer scheduledTimerWithTimeInterval:0.02 target:self selector:@selector(performNextRound) userInfo:nil repeats:YES];
[self performNextRound];
Expand All @@ -54,56 +54,56 @@ - (id)initWithFrame:(NSRect)frame sniffer:(ANWiFiSniffer *)theSniffer networks:(

- (void)configureUI {
NSRect frame = self.bounds;
infoScrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect(10, 52, frame.size.width - 20, frame.size.height - 62)];
infoTable = [[NSTableView alloc] initWithFrame:[[infoScrollView contentView] bounds]];
doneButton = [[NSButton alloc] initWithFrame:NSMakeRect(frame.size.width - 110, 10, 100, 24)];
backButton = [[NSButton alloc] initWithFrame:NSMakeRect(frame.size.width - 210, 10, 100, 24)];
newClientsCheck = [[NSButton alloc] initWithFrame:NSMakeRect(10, 10, 200, 24)];
infoScrollView = [NSScrollView.alloc initWithFrame:NSMakeRect(10, 52, frame.size.width - 20, frame.size.height - 62)];
infoTable = [NSTableView.alloc initWithFrame:infoScrollView.contentView.bounds];
doneButton = [NSButton.alloc initWithFrame:NSMakeRect(frame.size.width - 110, 10, 100, 24)];
backButton = [NSButton.alloc initWithFrame:NSMakeRect(frame.size.width - 210, 10, 100, 24)];
newClientsCheck = [NSButton.alloc initWithFrame:NSMakeRect(10, 10, 200, 24)];

[newClientsCheck setButtonType:NSSwitchButton];
[newClientsCheck setBezelStyle:NSRoundedBezelStyle];
[newClientsCheck setTitle:@"Actively scan for clients"];
[newClientsCheck setState:1];
newClientsCheck.buttonType = NSSwitchButton;
newClientsCheck.bezelStyle = NSRoundedBezelStyle;
newClientsCheck.title = @"Actively scan for clients";
newClientsCheck.state = 1;

[backButton setBezelStyle:NSRoundedBezelStyle];
[backButton setTitle:@"Back"];
[backButton setFont:[NSFont systemFontOfSize:13]];
[backButton setTarget:self];
[backButton setAction:@selector(backButton:)];
backButton.bezelStyle = NSRoundedBezelStyle;
backButton.title = @"Back";
backButton.font = [NSFont systemFontOfSize:13];
backButton.target = self;
backButton.action = @selector(backButton:);

[doneButton setBezelStyle:NSRoundedBezelStyle];
[doneButton setTitle:@"Done"];
[doneButton setFont:[NSFont systemFontOfSize:13]];
[doneButton setTarget:self];
[doneButton setAction:@selector(doneButton:)];
doneButton.bezelStyle = NSRoundedBezelStyle;
doneButton.title = @"Done";
doneButton.font = [NSFont systemFontOfSize:13];
doneButton.target = self;
doneButton.action = @selector(doneButton:);

NSTableColumn * enabledColumn = [[NSTableColumn alloc] initWithIdentifier:@"enabled"];
[[enabledColumn headerCell] setStringValue:@"Jam"];
[enabledColumn setWidth:30];
[enabledColumn setEditable:YES];
NSTableColumn * enabledColumn = [NSTableColumn.alloc initWithIdentifier:@"enabled"];
enabledColumn.headerCell.stringValue = @"Jam";
enabledColumn.width = 30;
enabledColumn.editable = YES;
[infoTable addTableColumn:enabledColumn];

NSTableColumn * stationColumn = [[NSTableColumn alloc] initWithIdentifier:@"station"];
[[stationColumn headerCell] setStringValue:@"Station"];
[stationColumn setWidth:120];
[stationColumn setEditable:NO];
[infoTable addTableColumn:stationColumn];
NSTableColumn * deviceColumn = [NSTableColumn.alloc initWithIdentifier:@"device"];
deviceColumn.headerCell.stringValue = @"Device";
deviceColumn.width = 120;
deviceColumn.editable = NO;
[infoTable addTableColumn:deviceColumn];

NSTableColumn * deauthsColumn = [[NSTableColumn alloc] initWithIdentifier:@"count"];
[[deauthsColumn headerCell] setStringValue:@"Deauths"];
[deauthsColumn setWidth:120];
[deauthsColumn setEditable:NO];
NSTableColumn * deauthsColumn = [NSTableColumn.alloc initWithIdentifier:@"count"];
deauthsColumn.headerCell.stringValue = @"Deauths";
deauthsColumn.width = 120;
deauthsColumn.editable = NO;
[infoTable addTableColumn:deauthsColumn];

[infoScrollView setDocumentView:infoTable];
[infoScrollView setBorderType:NSBezelBorder];
[infoScrollView setHasVerticalScroller:YES];
[infoScrollView setHasHorizontalScroller:YES];
[infoScrollView setAutohidesScrollers:NO];
infoScrollView.documentView = infoTable;
infoScrollView.borderType = NSBezelBorder;
infoScrollView.hasVerticalScroller = YES;
infoScrollView.hasHorizontalScroller = YES;
infoScrollView.autohidesScrollers = NO;

[infoTable setDataSource:self];
[infoTable setDelegate:self];
[infoTable setAllowsMultipleSelection:YES];
infoTable.dataSource = self;
infoTable.delegate = self;
infoTable.allowsMultipleSelection = YES;

[self addSubview:infoScrollView];
[self addSubview:backButton];
Expand All @@ -122,28 +122,28 @@ - (void)configureUI {
- (void)backButton:(id)sender {
[jamTimer invalidate];
jamTimer = nil;
[sniffer setDelegate:nil];
NSMutableArray * networks = [NSMutableArray array];
sniffer.delegate = nil;
NSMutableArray * networks = NSMutableArray.array;
for (id key in networksForChannel) {
[networks addObjectsFromArray:[networksForChannel objectForKey:key]];
}
ANTrafficGatherer * gatherer = [[ANTrafficGatherer alloc] initWithFrame:self.bounds sniffer:sniffer networks:networks];
[(ANAppDelegate *)[NSApp delegate] pushView:gatherer direction:ANViewSlideDirectionBackward];
ANTrafficGatherer * gatherer = [ANTrafficGatherer.alloc initWithFrame:self.bounds sniffer:sniffer networks:networks];
[(ANAppDelegate *)NSApp.delegate pushView:gatherer direction:ANViewSlideDirectionBackward];
}

- (void)doneButton:(id)sender {
[jamTimer invalidate];
jamTimer = nil;
[sniffer stop];
[sniffer setDelegate:nil];
sniffer.delegate = nil;
sniffer = nil;
[(ANAppDelegate *)[NSApp delegate] showNetworkList];
[(ANAppDelegate *)NSApp.delegate showNetworkList];
}

#pragma mark - Table View -

- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
return [clients count];
return clients.count;
}

- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
Expand All @@ -160,9 +160,9 @@ - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColum

- (NSCell *)tableView:(NSTableView *)tableView dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
if ([[tableColumn identifier] isEqualToString:@"enabled"]) {
NSButtonCell * cell = [[NSButtonCell alloc] init];
[cell setButtonType:NSSwitchButton];
[cell setTitle:@""];
NSButtonCell * cell = NSButtonCell.new;
cell.buttonType = NSSwitchButton;
cell.title = @"";
return cell;
}
return nil;
Expand Down Expand Up @@ -205,7 +205,7 @@ - (AN80211Packet *)deauthPacketForBSSID:(const unsigned char *)bssid client:(con
memcpy(&deauth[4], client, 6);
memcpy(&deauth[10], bssid, 6);
memcpy(&deauth[16], bssid, 6);
AN80211Packet * packet = [[AN80211Packet alloc] initWithData:[NSData dataWithBytes:deauth length:26]];
AN80211Packet * packet = [AN80211Packet.alloc initWithData:[NSData dataWithBytes:deauth length:26]];
return packet;
}

Expand Down Expand Up @@ -251,7 +251,7 @@ - (void)wifiSniffer:(ANWiFiSniffer *)sniffer gotPacket:(AN80211Packet *)packet {
if (client[0] == 0xFF && client[1] == 0xFF) hasClient = NO;
if (client[0] == 0x03 && client[5] == 0x01) hasClient = NO;
if (hasClient) {
ANClient * clientObj = [[ANClient alloc] initWithMac:client bssid:bssid];
ANClient * clientObj = [ANClient.alloc initWithMac:client bssid:bssid];
BOOL containsClient = NO;
for (ANClient * aClient in clients) {
if (memcmp(aClient.macAddress, clientObj.macAddress, 6) == 0) {
Expand Down
Loading

0 comments on commit 2052632

Please sign in to comment.