Skip to content

Commit 2052632

Browse files
committed
Release 1.2
1 parent 187263c commit 2052632

File tree

13 files changed

+221
-122
lines changed

13 files changed

+221
-122
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1010"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "FAB94BC615C0557A0031197A"
18+
BuildableName = "JamWiFi.app"
19+
BlueprintName = "JamWiFi"
20+
ReferencedContainer = "container:JamWiFi.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
<MacroExpansion>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "FAB94BC615C0557A0031197A"
36+
BuildableName = "JamWiFi.app"
37+
BlueprintName = "JamWiFi"
38+
ReferencedContainer = "container:JamWiFi.xcodeproj">
39+
</BuildableReference>
40+
</MacroExpansion>
41+
<AdditionalOptions>
42+
</AdditionalOptions>
43+
</TestAction>
44+
<LaunchAction
45+
buildConfiguration = "Release"
46+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
47+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
48+
launchStyle = "0"
49+
useCustomWorkingDirectory = "NO"
50+
ignoresPersistentStateOnLaunch = "NO"
51+
debugDocumentVersioning = "YES"
52+
debugServiceExtension = "internal"
53+
allowLocationSimulation = "YES">
54+
<BuildableProductRunnable
55+
runnableDebuggingMode = "0">
56+
<BuildableReference
57+
BuildableIdentifier = "primary"
58+
BlueprintIdentifier = "FAB94BC615C0557A0031197A"
59+
BuildableName = "JamWiFi.app"
60+
BlueprintName = "JamWiFi"
61+
ReferencedContainer = "container:JamWiFi.xcodeproj">
62+
</BuildableReference>
63+
</BuildableProductRunnable>
64+
<AdditionalOptions>
65+
</AdditionalOptions>
66+
</LaunchAction>
67+
<ProfileAction
68+
buildConfiguration = "Release"
69+
shouldUseLaunchSchemeArgsEnv = "YES"
70+
savedToolIdentifier = ""
71+
useCustomWorkingDirectory = "NO"
72+
debugDocumentVersioning = "YES">
73+
<BuildableProductRunnable
74+
runnableDebuggingMode = "0">
75+
<BuildableReference
76+
BuildableIdentifier = "primary"
77+
BlueprintIdentifier = "FAB94BC615C0557A0031197A"
78+
BuildableName = "JamWiFi.app"
79+
BlueprintName = "JamWiFi"
80+
ReferencedContainer = "container:JamWiFi.xcodeproj">
81+
</BuildableReference>
82+
</BuildableProductRunnable>
83+
</ProfileAction>
84+
<AnalyzeAction
85+
buildConfiguration = "Debug">
86+
</AnalyzeAction>
87+
<ArchiveAction
88+
buildConfiguration = "Release"
89+
revealArchiveInOrganizer = "YES">
90+
</ArchiveAction>
91+
</Scheme>

JamWiFi.xcodeproj/xcuserdata/Leonard.xcuserdatad/xcschemes/xcschememanagement.plist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,13 @@
1010
<integer>0</integer>
1111
</dict>
1212
</dict>
13+
<key>SuppressBuildableAutocreation</key>
14+
<dict>
15+
<key>FAB94BC615C0557A0031197A</key>
16+
<dict>
17+
<key>primary</key>
18+
<true/>
19+
</dict>
20+
</dict>
1321
</dict>
1422
</plist>

JamWiFi/ANAppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
3030
scan = dlsym(libHandle, "Apple80211Scan");
3131
_close = dlsym(libHandle, "Apple80211Close");
3232

33-
networkList = [[ANListView alloc] initWithFrame:[self.window.contentView bounds]];
33+
networkList = [ANListView.alloc initWithFrame:self.window.contentView.bounds];
3434
[self pushView:networkList direction:ANViewSlideDirectionForward];
3535
[CarbonAppProcess.currentProcess makeFrontmost];
3636
}

JamWiFi/ANClientKiller.m

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ @implementation ANClientKiller
1818

1919
- (id)initWithFrame:(NSRect)frame sniffer:(ANWiFiSniffer *)theSniffer networks:(NSArray *)networks clients:(NSArray *)theClients {
2020
if ((self = [super initWithFrame:frame])) {
21-
clients = [theClients mutableCopy];
21+
clients = theClients.mutableCopy;
2222
sniffer = theSniffer;
23-
[sniffer setDelegate:self];
23+
sniffer.delegate = self;
2424
[sniffer start];
2525

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

35-
NSMutableDictionary * mNetworksPerChannel = [[NSMutableDictionary alloc] init];
35+
NSMutableDictionary * mNetworksPerChannel = NSMutableDictionary.new;
3636
for (CWChannel * channel in channels) {
37-
NSMutableArray * mNetworks = [[NSMutableArray alloc] init];
37+
NSMutableArray * mNetworks = NSMutableArray.new;
3838
for (CWNetwork * network in networks) {
3939
if ([[network wlanChannel] isEqualToChannel:channel]) {
4040
[mNetworks addObject:network];
4141
}
4242
}
43-
[mNetworksPerChannel setObject:[mNetworks copy] forKey:channel];
43+
[mNetworksPerChannel setObject:mNetworks.copy forKey:channel];
4444
}
45-
networksForChannel = [mNetworksPerChannel copy];
45+
networksForChannel = mNetworksPerChannel.copy;
4646

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

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

63-
[newClientsCheck setButtonType:NSSwitchButton];
64-
[newClientsCheck setBezelStyle:NSRoundedBezelStyle];
65-
[newClientsCheck setTitle:@"Actively scan for clients"];
66-
[newClientsCheck setState:1];
63+
newClientsCheck.buttonType = NSSwitchButton;
64+
newClientsCheck.bezelStyle = NSRoundedBezelStyle;
65+
newClientsCheck.title = @"Actively scan for clients";
66+
newClientsCheck.state = 1;
6767

68-
[backButton setBezelStyle:NSRoundedBezelStyle];
69-
[backButton setTitle:@"Back"];
70-
[backButton setFont:[NSFont systemFontOfSize:13]];
71-
[backButton setTarget:self];
72-
[backButton setAction:@selector(backButton:)];
68+
backButton.bezelStyle = NSRoundedBezelStyle;
69+
backButton.title = @"Back";
70+
backButton.font = [NSFont systemFontOfSize:13];
71+
backButton.target = self;
72+
backButton.action = @selector(backButton:);
7373

74-
[doneButton setBezelStyle:NSRoundedBezelStyle];
75-
[doneButton setTitle:@"Done"];
76-
[doneButton setFont:[NSFont systemFontOfSize:13]];
77-
[doneButton setTarget:self];
78-
[doneButton setAction:@selector(doneButton:)];
74+
doneButton.bezelStyle = NSRoundedBezelStyle;
75+
doneButton.title = @"Done";
76+
doneButton.font = [NSFont systemFontOfSize:13];
77+
doneButton.target = self;
78+
doneButton.action = @selector(doneButton:);
7979

80-
NSTableColumn * enabledColumn = [[NSTableColumn alloc] initWithIdentifier:@"enabled"];
81-
[[enabledColumn headerCell] setStringValue:@"Jam"];
82-
[enabledColumn setWidth:30];
83-
[enabledColumn setEditable:YES];
80+
NSTableColumn * enabledColumn = [NSTableColumn.alloc initWithIdentifier:@"enabled"];
81+
enabledColumn.headerCell.stringValue = @"Jam";
82+
enabledColumn.width = 30;
83+
enabledColumn.editable = YES;
8484
[infoTable addTableColumn:enabledColumn];
8585

86-
NSTableColumn * stationColumn = [[NSTableColumn alloc] initWithIdentifier:@"station"];
87-
[[stationColumn headerCell] setStringValue:@"Station"];
88-
[stationColumn setWidth:120];
89-
[stationColumn setEditable:NO];
90-
[infoTable addTableColumn:stationColumn];
86+
NSTableColumn * deviceColumn = [NSTableColumn.alloc initWithIdentifier:@"device"];
87+
deviceColumn.headerCell.stringValue = @"Device";
88+
deviceColumn.width = 120;
89+
deviceColumn.editable = NO;
90+
[infoTable addTableColumn:deviceColumn];
9191

92-
NSTableColumn * deauthsColumn = [[NSTableColumn alloc] initWithIdentifier:@"count"];
93-
[[deauthsColumn headerCell] setStringValue:@"Deauths"];
94-
[deauthsColumn setWidth:120];
95-
[deauthsColumn setEditable:NO];
92+
NSTableColumn * deauthsColumn = [NSTableColumn.alloc initWithIdentifier:@"count"];
93+
deauthsColumn.headerCell.stringValue = @"Deauths";
94+
deauthsColumn.width = 120;
95+
deauthsColumn.editable = NO;
9696
[infoTable addTableColumn:deauthsColumn];
9797

98-
[infoScrollView setDocumentView:infoTable];
99-
[infoScrollView setBorderType:NSBezelBorder];
100-
[infoScrollView setHasVerticalScroller:YES];
101-
[infoScrollView setHasHorizontalScroller:YES];
102-
[infoScrollView setAutohidesScrollers:NO];
98+
infoScrollView.documentView = infoTable;
99+
infoScrollView.borderType = NSBezelBorder;
100+
infoScrollView.hasVerticalScroller = YES;
101+
infoScrollView.hasHorizontalScroller = YES;
102+
infoScrollView.autohidesScrollers = NO;
103103

104-
[infoTable setDataSource:self];
105-
[infoTable setDelegate:self];
106-
[infoTable setAllowsMultipleSelection:YES];
104+
infoTable.dataSource = self;
105+
infoTable.delegate = self;
106+
infoTable.allowsMultipleSelection = YES;
107107

108108
[self addSubview:infoScrollView];
109109
[self addSubview:backButton];
@@ -122,28 +122,28 @@ - (void)configureUI {
122122
- (void)backButton:(id)sender {
123123
[jamTimer invalidate];
124124
jamTimer = nil;
125-
[sniffer setDelegate:nil];
126-
NSMutableArray * networks = [NSMutableArray array];
125+
sniffer.delegate = nil;
126+
NSMutableArray * networks = NSMutableArray.array;
127127
for (id key in networksForChannel) {
128128
[networks addObjectsFromArray:[networksForChannel objectForKey:key]];
129129
}
130-
ANTrafficGatherer * gatherer = [[ANTrafficGatherer alloc] initWithFrame:self.bounds sniffer:sniffer networks:networks];
131-
[(ANAppDelegate *)[NSApp delegate] pushView:gatherer direction:ANViewSlideDirectionBackward];
130+
ANTrafficGatherer * gatherer = [ANTrafficGatherer.alloc initWithFrame:self.bounds sniffer:sniffer networks:networks];
131+
[(ANAppDelegate *)NSApp.delegate pushView:gatherer direction:ANViewSlideDirectionBackward];
132132
}
133133

134134
- (void)doneButton:(id)sender {
135135
[jamTimer invalidate];
136136
jamTimer = nil;
137137
[sniffer stop];
138-
[sniffer setDelegate:nil];
138+
sniffer.delegate = nil;
139139
sniffer = nil;
140-
[(ANAppDelegate *)[NSApp delegate] showNetworkList];
140+
[(ANAppDelegate *)NSApp.delegate showNetworkList];
141141
}
142142

143143
#pragma mark - Table View -
144144

145145
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
146-
return [clients count];
146+
return clients.count;
147147
}
148148

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

161161
- (NSCell *)tableView:(NSTableView *)tableView dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
162162
if ([[tableColumn identifier] isEqualToString:@"enabled"]) {
163-
NSButtonCell * cell = [[NSButtonCell alloc] init];
164-
[cell setButtonType:NSSwitchButton];
165-
[cell setTitle:@""];
163+
NSButtonCell * cell = NSButtonCell.new;
164+
cell.buttonType = NSSwitchButton;
165+
cell.title = @"";
166166
return cell;
167167
}
168168
return nil;
@@ -205,7 +205,7 @@ - (AN80211Packet *)deauthPacketForBSSID:(const unsigned char *)bssid client:(con
205205
memcpy(&deauth[4], client, 6);
206206
memcpy(&deauth[10], bssid, 6);
207207
memcpy(&deauth[16], bssid, 6);
208-
AN80211Packet * packet = [[AN80211Packet alloc] initWithData:[NSData dataWithBytes:deauth length:26]];
208+
AN80211Packet * packet = [AN80211Packet.alloc initWithData:[NSData dataWithBytes:deauth length:26]];
209209
return packet;
210210
}
211211

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

0 commit comments

Comments
 (0)