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

Commit

Permalink
Add optional client count label next to AP tile icons, update tools v…
Browse files Browse the repository at this point in the history
…ersion, revert version to v1.5-beta.8
  • Loading branch information
chrisk44 committed Oct 23, 2018
1 parent 9147703 commit d78e0f9
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 51 deletions.
20 changes: 10 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
compileSdkVersion 28
defaultConfig {
applicationId "com.hijacker"
minSdkVersion 21
targetSdkVersion 27
targetSdkVersion 28
versionCode 32
versionName "v1.5-stable"
versionName "v1.5-beta.8"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
Expand All @@ -31,15 +31,15 @@ dependencies {
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.firebase:firebase-appindexing:16.0.1'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.google.firebase:firebase-appindexing:16.0.2'

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
}

repositories {
Expand Down
16 changes: 14 additions & 2 deletions app/src/main/java/com/hijacker/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public class MainActivity extends AppCompatActivity{
static String iface, prefix, airodump_dir, aireplay_dir, aircrack_dir, mdk3bf_dir, mdk3dos_dir, reaver_dir, chroot_dir,
enable_monMode, disable_monMode, custom_chroot_cmd;
static int deauthWait, band;
static boolean show_notif, show_details, airOnStartup, debug, delete_extra,
static boolean show_notif, show_details, airOnStartup, debug, delete_extra, show_client_count,
monstart, always_cap, cont_on_fail, watchdog, target_deauth, enable_on_airodump, update_on_startup;

private GoogleApiClient client;
Expand Down Expand Up @@ -356,6 +356,7 @@ protected Boolean doInBackground(Void... params){
target_deauth = Boolean.parseBoolean(getString(R.string.target_deauth));
update_on_startup = Boolean.parseBoolean(getString(R.string.auto_update));
band = Integer.parseInt(getString(R.string.band));
show_client_count = Boolean.parseBoolean(getString(R.string.show_client_count));

//Load preferences
publishProgress(getString(R.string.loading_preferences));
Expand Down Expand Up @@ -1130,6 +1131,7 @@ static void load(){
cont_on_fail = pref.getBoolean("cont_on_fail", cont_on_fail);
update_on_startup = pref.getBoolean("update_on_startup", update_on_startup);
band = Integer.parseInt(pref.getString("band", Integer.toString(band)));
show_client_count = pref.getBoolean("show_client_count", show_client_count);

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

//Image
//Image and count views
ImageView iv = itemview.findViewById(R.id.iv);
TextView icon_count_view = itemview.findViewById(R.id.icon_count_view);
if(current.device instanceof AP){
if(((AP)current.device).isHidden) iv.setImageResource(R.drawable.ap_hidden);
else iv.setImageResource(R.drawable.ap2);

if(show_client_count){
icon_count_view.setText(Integer.toString(((AP) (current.device)).clients.size()));
icon_count_view.setVisibility(View.VISIBLE);
}else{
icon_count_view.setVisibility(View.GONE);
}
}else{
iv.setImageResource(R.drawable.st2);

icon_count_view.setVisibility(View.GONE);
}

return itemview;
Expand Down
39 changes: 28 additions & 11 deletions app/src/main/res/layout-large/listitem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,35 @@
android:layout_height="wrap_content"
android:padding="9dp">

<ImageView
android:id="@+id/iv"
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:maxHeight="100dp"
android:maxWidth="50dp"
android:paddingBottom="5dp"
android:paddingEnd="10dp"
android:paddingStart="5dp"
android:paddingTop="5dp"
app:srcCompat="@drawable/ap2"/>
android:layout_height="wrap_content">

<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:maxHeight="100dp"
android:maxWidth="50dp"
android:paddingBottom="5dp"
android:paddingEnd="10dp"
android:paddingStart="5dp"
android:paddingTop="5dp"
app:srcCompat="@drawable/ap2" />

<TextView
android:id="@+id/icon_count_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/iv"
android:layout_alignEnd="@+id/iv"
android:layout_marginBottom="2dp"
android:layout_marginEnd="10dp"
android:text="100"
android:textColor="@android:color/white"
android:textSize="12sp" />
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
Expand Down
45 changes: 31 additions & 14 deletions app/src/main/res/layout-normal/listitem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,35 @@
android:layout_height="wrap_content"
android:padding="7dp">

<ImageView
android:id="@+id/iv"
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:maxHeight="100dp"
android:maxWidth="50dp"
android:paddingBottom="5dp"
android:paddingEnd="10dp"
android:paddingStart="5dp"
android:paddingTop="5dp"
app:srcCompat="@drawable/ap2"/>
android:layout_height="wrap_content">

<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:maxHeight="100dp"
android:maxWidth="50dp"
android:paddingBottom="5dp"
android:paddingEnd="10dp"
android:paddingStart="5dp"
android:paddingTop="5dp"
app:srcCompat="@drawable/ap2" />

<TextView
android:id="@+id/icon_count_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/iv"
android:layout_alignEnd="@+id/iv"
android:layout_marginBottom="2dp"
android:layout_marginEnd="10dp"
android:text="100"
android:textColor="@android:color/white"
android:textSize="12sp" />
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
Expand Down Expand Up @@ -76,10 +93,10 @@
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:gravity="end|center_vertical"
android:maxLines="2"
android:text="dsadfasdfasdfas"
android:maxLines="1"
android:paddingStart="4dp"
android:textSize="13sp"/>
android:text="dsadfasdfasdfas"
android:textSize="13sp" />
</LinearLayout>

</RelativeLayout>
Expand Down
46 changes: 32 additions & 14 deletions app/src/main/res/layout/listitem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,35 @@
android:layout_height="wrap_content"
android:padding="3dp">

<ImageView
android:id="@+id/iv"
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:maxHeight="100dp"
android:maxWidth="50dp"
android:paddingBottom="5dp"
android:paddingEnd="10dp"
android:paddingStart="5dp"
android:paddingTop="5dp"
app:srcCompat="@drawable/ap2"/>
android:layout_height="wrap_content">

<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:maxHeight="100dp"
android:maxWidth="50dp"
android:paddingBottom="5dp"
android:paddingEnd="10dp"
android:paddingStart="5dp"
android:paddingTop="5dp"
app:srcCompat="@drawable/ap2" />

<TextView
android:id="@+id/icon_count_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/iv"
android:layout_alignEnd="@+id/iv"
android:layout_marginBottom="2dp"
android:layout_marginEnd="10dp"
android:text="100"
android:textColor="@android:color/white"
android:textSize="12sp" />
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
Expand Down Expand Up @@ -53,6 +70,7 @@
</LinearLayout>

<LinearLayout
android:id="@+id/ll2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll1"
Expand All @@ -65,7 +83,7 @@
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:maxLines="1"
android:text="00:11:22:33:44:55"/>
android:text="00:11:22:33:44:55" />

<TextView
android:id="@+id/lowerRight"
Expand All @@ -75,8 +93,8 @@
android:layout_weight="1"
android:gravity="end|center_vertical"
android:maxLines="1"
android:text="dsadfasdfasdfas"
android:paddingStart="4dp"/>
android:paddingStart="4dp"
android:text="dsadfasdfasdfas" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@
<string name="target_deauth" translatable="false">false</string>
<string name="auto_update" translatable="false">true</string>
<string name="band" translatable="false">1</string>
<string name="show_client_count" translatable="false">true</string>

<!-- Settings -->

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

<string name="show_client_count_title">Show AP\'s client count</string>

<string name="debug_title">Logcat Messages</string>
<string name="debug_sum">Print debugging messages to logcat. Messages about exceptions will be printed anyway.</string>

Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
android:key="watchdog"
android:summary="@string/watchdog_sum"
android:title="@string/watchdog_title" />
<SwitchPreference
android:defaultValue="@string/show_client_count"
android:key="show_client_count"
android:title="@string/show_client_count_title" />
<SwitchPreference
android:defaultValue="@string/debug"
android:key="debug"
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ buildscript {

allprojects {
repositories {
google()
jcenter()
}
}
Expand Down

1 comment on commit d78e0f9

@papundutta
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look to change

Please sign in to comment.