Skip to content
This repository was archived by the owner on Apr 8, 2022. It is now read-only.

Commit d78e0f9

Browse files
committed
Add optional client count label next to AP tile icons, update tools version, revert version to v1.5-beta.8
1 parent 9147703 commit d78e0f9

File tree

8 files changed

+123
-51
lines changed

8 files changed

+123
-51
lines changed

app/build.gradle

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apply plugin: 'com.android.application'
22
android {
3-
compileSdkVersion 27
3+
compileSdkVersion 28
44
defaultConfig {
55
applicationId "com.hijacker"
66
minSdkVersion 21
7-
targetSdkVersion 27
7+
targetSdkVersion 28
88
versionCode 32
9-
versionName "v1.5-stable"
9+
versionName "v1.5-beta.8"
1010
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1111
externalNativeBuild {
1212
cmake {
@@ -31,15 +31,15 @@ dependencies {
3131
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
3232
exclude group: 'com.android.support', module: 'support-annotations'
3333
})
34-
implementation 'com.android.support:appcompat-v7:27.1.1'
35-
implementation 'com.android.support:support-v4:27.1.1'
36-
implementation 'com.android.support:design:27.1.1'
34+
implementation 'com.android.support:appcompat-v7:28.0.0'
35+
implementation 'com.android.support:support-v4:28.0.0'
36+
implementation 'com.android.support:design:28.0.0'
3737
testImplementation 'junit:junit:4.12'
38-
implementation 'com.android.support:cardview-v7:27.1.1'
39-
implementation 'com.google.firebase:firebase-appindexing:16.0.1'
38+
implementation 'com.android.support:cardview-v7:28.0.0'
39+
implementation 'com.google.firebase:firebase-appindexing:16.0.2'
4040

41-
implementation 'com.android.support:appcompat-v7:27.1.1'
42-
implementation 'com.android.support:design:27.1.1'
41+
implementation 'com.android.support:appcompat-v7:28.0.0'
42+
implementation 'com.android.support:design:28.0.0'
4343
}
4444

4545
repositories {

app/src/main/java/com/hijacker/MainActivity.java

+14-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public class MainActivity extends AppCompatActivity{
165165
static String iface, prefix, airodump_dir, aireplay_dir, aircrack_dir, mdk3bf_dir, mdk3dos_dir, reaver_dir, chroot_dir,
166166
enable_monMode, disable_monMode, custom_chroot_cmd;
167167
static int deauthWait, band;
168-
static boolean show_notif, show_details, airOnStartup, debug, delete_extra,
168+
static boolean show_notif, show_details, airOnStartup, debug, delete_extra, show_client_count,
169169
monstart, always_cap, cont_on_fail, watchdog, target_deauth, enable_on_airodump, update_on_startup;
170170

171171
private GoogleApiClient client;
@@ -356,6 +356,7 @@ protected Boolean doInBackground(Void... params){
356356
target_deauth = Boolean.parseBoolean(getString(R.string.target_deauth));
357357
update_on_startup = Boolean.parseBoolean(getString(R.string.auto_update));
358358
band = Integer.parseInt(getString(R.string.band));
359+
show_client_count = Boolean.parseBoolean(getString(R.string.show_client_count));
359360

360361
//Load preferences
361362
publishProgress(getString(R.string.loading_preferences));
@@ -1130,6 +1131,7 @@ static void load(){
11301131
cont_on_fail = pref.getBoolean("cont_on_fail", cont_on_fail);
11311132
update_on_startup = pref.getBoolean("update_on_startup", update_on_startup);
11321133
band = Integer.parseInt(pref.getString("band", Integer.toString(band)));
1134+
show_client_count = pref.getBoolean("show_client_count", show_client_count);
11331135

11341136
progress.setMax(deauthWait);
11351137
progress.setProgress(deauthWait);
@@ -1337,13 +1339,23 @@ public View getView(int position, View convertView, @NonNull ViewGroup parent){
13371339
TextView upperRight = itemview.findViewById(R.id.upperRight);
13381340
upperRight.setText(current.device.upperRight);
13391341

1340-
//Image
1342+
//Image and count views
13411343
ImageView iv = itemview.findViewById(R.id.iv);
1344+
TextView icon_count_view = itemview.findViewById(R.id.icon_count_view);
13421345
if(current.device instanceof AP){
13431346
if(((AP)current.device).isHidden) iv.setImageResource(R.drawable.ap_hidden);
13441347
else iv.setImageResource(R.drawable.ap2);
1348+
1349+
if(show_client_count){
1350+
icon_count_view.setText(Integer.toString(((AP) (current.device)).clients.size()));
1351+
icon_count_view.setVisibility(View.VISIBLE);
1352+
}else{
1353+
icon_count_view.setVisibility(View.GONE);
1354+
}
13451355
}else{
13461356
iv.setImageResource(R.drawable.st2);
1357+
1358+
icon_count_view.setVisibility(View.GONE);
13471359
}
13481360

13491361
return itemview;

app/src/main/res/layout-large/listitem.xml

+28-11
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,35 @@
55
android:layout_height="wrap_content"
66
android:padding="9dp">
77

8-
<ImageView
9-
android:id="@+id/iv"
8+
<RelativeLayout
109
android:layout_width="wrap_content"
11-
android:layout_height="match_parent"
12-
android:adjustViewBounds="true"
13-
android:maxHeight="100dp"
14-
android:maxWidth="50dp"
15-
android:paddingBottom="5dp"
16-
android:paddingEnd="10dp"
17-
android:paddingStart="5dp"
18-
android:paddingTop="5dp"
19-
app:srcCompat="@drawable/ap2"/>
10+
android:layout_height="wrap_content">
11+
12+
<ImageView
13+
android:id="@+id/iv"
14+
android:layout_width="wrap_content"
15+
android:layout_height="wrap_content"
16+
android:adjustViewBounds="true"
17+
android:maxHeight="100dp"
18+
android:maxWidth="50dp"
19+
android:paddingBottom="5dp"
20+
android:paddingEnd="10dp"
21+
android:paddingStart="5dp"
22+
android:paddingTop="5dp"
23+
app:srcCompat="@drawable/ap2" />
24+
25+
<TextView
26+
android:id="@+id/icon_count_view"
27+
android:layout_width="wrap_content"
28+
android:layout_height="wrap_content"
29+
android:layout_alignBottom="@+id/iv"
30+
android:layout_alignEnd="@+id/iv"
31+
android:layout_marginBottom="2dp"
32+
android:layout_marginEnd="10dp"
33+
android:text="100"
34+
android:textColor="@android:color/white"
35+
android:textSize="12sp" />
36+
</RelativeLayout>
2037

2138
<RelativeLayout
2239
android:layout_width="match_parent"

app/src/main/res/layout-normal/listitem.xml

+31-14
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,35 @@
55
android:layout_height="wrap_content"
66
android:padding="7dp">
77

8-
<ImageView
9-
android:id="@+id/iv"
8+
<RelativeLayout
109
android:layout_width="wrap_content"
11-
android:layout_height="match_parent"
12-
android:adjustViewBounds="true"
13-
android:maxHeight="100dp"
14-
android:maxWidth="50dp"
15-
android:paddingBottom="5dp"
16-
android:paddingEnd="10dp"
17-
android:paddingStart="5dp"
18-
android:paddingTop="5dp"
19-
app:srcCompat="@drawable/ap2"/>
10+
android:layout_height="wrap_content">
11+
12+
<ImageView
13+
android:id="@+id/iv"
14+
android:layout_width="wrap_content"
15+
android:layout_height="wrap_content"
16+
android:adjustViewBounds="true"
17+
android:maxHeight="100dp"
18+
android:maxWidth="50dp"
19+
android:paddingBottom="5dp"
20+
android:paddingEnd="10dp"
21+
android:paddingStart="5dp"
22+
android:paddingTop="5dp"
23+
app:srcCompat="@drawable/ap2" />
24+
25+
<TextView
26+
android:id="@+id/icon_count_view"
27+
android:layout_width="wrap_content"
28+
android:layout_height="wrap_content"
29+
android:layout_alignBottom="@+id/iv"
30+
android:layout_alignEnd="@+id/iv"
31+
android:layout_marginBottom="2dp"
32+
android:layout_marginEnd="10dp"
33+
android:text="100"
34+
android:textColor="@android:color/white"
35+
android:textSize="12sp" />
36+
</RelativeLayout>
2037

2138
<RelativeLayout
2239
android:layout_width="match_parent"
@@ -76,10 +93,10 @@
7693
android:layout_gravity="center_vertical"
7794
android:layout_weight="1"
7895
android:gravity="end|center_vertical"
79-
android:maxLines="2"
80-
android:text="dsadfasdfasdfas"
96+
android:maxLines="1"
8197
android:paddingStart="4dp"
82-
android:textSize="13sp"/>
98+
android:text="dsadfasdfasdfas"
99+
android:textSize="13sp" />
83100
</LinearLayout>
84101

85102
</RelativeLayout>

app/src/main/res/layout/listitem.xml

+32-14
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,35 @@
55
android:layout_height="wrap_content"
66
android:padding="3dp">
77

8-
<ImageView
9-
android:id="@+id/iv"
8+
<RelativeLayout
109
android:layout_width="wrap_content"
11-
android:layout_height="match_parent"
12-
android:adjustViewBounds="true"
13-
android:maxHeight="100dp"
14-
android:maxWidth="50dp"
15-
android:paddingBottom="5dp"
16-
android:paddingEnd="10dp"
17-
android:paddingStart="5dp"
18-
android:paddingTop="5dp"
19-
app:srcCompat="@drawable/ap2"/>
10+
android:layout_height="wrap_content">
11+
12+
<ImageView
13+
android:id="@+id/iv"
14+
android:layout_width="wrap_content"
15+
android:layout_height="wrap_content"
16+
android:adjustViewBounds="true"
17+
android:maxHeight="100dp"
18+
android:maxWidth="50dp"
19+
android:paddingBottom="5dp"
20+
android:paddingEnd="10dp"
21+
android:paddingStart="5dp"
22+
android:paddingTop="5dp"
23+
app:srcCompat="@drawable/ap2" />
24+
25+
<TextView
26+
android:id="@+id/icon_count_view"
27+
android:layout_width="wrap_content"
28+
android:layout_height="wrap_content"
29+
android:layout_alignBottom="@+id/iv"
30+
android:layout_alignEnd="@+id/iv"
31+
android:layout_marginBottom="2dp"
32+
android:layout_marginEnd="10dp"
33+
android:text="100"
34+
android:textColor="@android:color/white"
35+
android:textSize="12sp" />
36+
</RelativeLayout>
2037

2138
<RelativeLayout
2239
android:layout_width="match_parent"
@@ -53,6 +70,7 @@
5370
</LinearLayout>
5471

5572
<LinearLayout
73+
android:id="@+id/ll2"
5674
android:layout_width="match_parent"
5775
android:layout_height="wrap_content"
5876
android:layout_below="@+id/ll1"
@@ -65,7 +83,7 @@
6583
android:layout_gravity="center_vertical"
6684
android:gravity="center_vertical"
6785
android:maxLines="1"
68-
android:text="00:11:22:33:44:55"/>
86+
android:text="00:11:22:33:44:55" />
6987

7088
<TextView
7189
android:id="@+id/lowerRight"
@@ -75,8 +93,8 @@
7593
android:layout_weight="1"
7694
android:gravity="end|center_vertical"
7795
android:maxLines="1"
78-
android:text="dsadfasdfasdfas"
79-
android:paddingStart="4dp"/>
96+
android:paddingStart="4dp"
97+
android:text="dsadfasdfasdfas" />
8098
</LinearLayout>
8199
</RelativeLayout>
82100
</LinearLayout>

app/src/main/res/values/strings.xml

+3
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@
326326
<string name="target_deauth" translatable="false">false</string>
327327
<string name="auto_update" translatable="false">true</string>
328328
<string name="band" translatable="false">1</string>
329+
<string name="show_client_count" translatable="false">true</string>
329330

330331
<!-- Settings -->
331332

@@ -353,6 +354,8 @@
353354
<string name="notif_details_title">Show details</string>
354355
<string name="notif_details_sum">Show additional details about running processes in notification</string>
355356

357+
<string name="show_client_count_title">Show AP\'s client count</string>
358+
356359
<string name="debug_title">Logcat Messages</string>
357360
<string name="debug_sum">Print debugging messages to logcat. Messages about exceptions will be printed anyway.</string>
358361

app/src/main/res/xml/preferences.xml

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
android:key="watchdog"
1919
android:summary="@string/watchdog_sum"
2020
android:title="@string/watchdog_title" />
21+
<SwitchPreference
22+
android:defaultValue="@string/show_client_count"
23+
android:key="show_client_count"
24+
android:title="@string/show_client_count_title" />
2125
<SwitchPreference
2226
android:defaultValue="@string/debug"
2327
android:key="debug"

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ buildscript {
1515

1616
allprojects {
1717
repositories {
18+
google()
1819
jcenter()
1920
}
2021
}

0 commit comments

Comments
 (0)