Permalink
Browse files

Rework navigation drawer, improve tools installation, fix bug in Reav…

…erFragment when starting it directly from an AP, change version to 1.5-beta1
  • Loading branch information...
chrisk44 committed Mar 25, 2018
1 parent 019d71a commit 1169b4e47ed7d1df91047d25485166c5b3a20608
@@ -35,9 +35,6 @@
<option name="USE_CUSTOM_SETTINGS" value="true" />
</AndroidXmlCodeStyleSettings>
<Objective-C-extensions>
<option name="GENERATE_INSTANCE_VARIABLES_FOR_PROPERTIES" value="ASK" />
<option name="RELEASE_STYLE" value="IVAR" />
<option name="TYPE_QUALIFIERS_PLACEMENT" value="BEFORE" />
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
@@ -63,9 +60,7 @@
</extensions>
</Objective-C-extensions>
<XML>
<option name="XML_KEEP_LINE_BREAKS" value="false" />
<option name="XML_ALIGN_ATTRIBUTES" value="false" />
<option name="XML_SPACE_INSIDE_EMPTY_TAG" value="true" />
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="XML">
<option name="FORCE_REARRANGE_MODE" value="1" />
@@ -226,6 +221,6 @@
</codeStyleSettings>
</value>
</option>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default (1)" />
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</component>
</project>
View
@@ -7,7 +7,7 @@ android {
minSdkVersion 21
targetSdkVersion 27
versionCode 25
versionName "v2-exp.1"
versionName "v1.5-beta.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
@@ -32,12 +32,15 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.android.support:design:27.0.2'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:support-v4:27.1.0'
compile 'com.android.support:design:27.1.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
}
repositories {
@@ -24,6 +24,7 @@
import android.view.MenuItem;
import android.view.View;
import android.widget.PopupMenu;
import android.widget.Toast;
import java.io.BufferedReader;
import java.io.File;
@@ -218,13 +219,14 @@ void crack(){
}
void crackReaver(FragmentManager fragmentManager){
ReaverFragment.ap = this;
//ReaverFragment newRF = new ReaverFragment().setAutostart(true);
FragmentTransaction ft = fragmentManager.beginTransaction();
ft.replace(R.id.fragment1, new ReaverFragment());
ft.replace(R.id.fragment1, new ReaverFragment().setAutostart(true));
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
ft.addToBackStack(null);
ft.commitAllowingStateLoss();
fragmentManager.executePendingTransactions(); //Wait for everything to be set up
ReaverFragment.start_button.performClick(); //Click start to run reaver
//newRF.attemptStart();
}
void disconnectAll(){
if(Airodump.getChannel() != this.ch){
@@ -425,7 +427,11 @@ public boolean onMenuItemClick(android.view.MenuItem item) {
break;
case 6:
//crack with reaver
AP.this.crackReaver(mFragmentManager);
if(ReaverFragment.isRunning()){
Toast.makeText(activity, activity.getString(R.string.reaver_already_running), Toast.LENGTH_SHORT).show();
}else{
AP.this.crackReaver(mFragmentManager);
}
break;
}
return false;

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -80,6 +80,8 @@
EditText pinDelayView, lockedDelayView;
CheckBox pixie_dust_cb, ignored_locked_cb, eap_fail_cb, small_dh_cb, no_nack_cb;
ScrollView consoleScrollView;
int normalContainerHeight = -1;
boolean autostart = false;
static ReaverTask task;
static String console_text = null, pin_delay="1", locked_delay="60", custom_mac=null; //delays are always used as strings
static boolean pixie_dust, ignore_locked, eap_fail, small_dh, no_nack;
@@ -228,6 +230,10 @@ void attemptStart(){
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
ReaverFragment setAutostart(boolean autostart){
this.autostart = autostart;
return this;
}
static boolean isRunning(){
if(task==null) return false;
return task.getStatus()==AsyncTask.Status.RUNNING;
@@ -266,6 +272,17 @@ public void onStart(){
layoutParams.height = 0;
optionsContainer.setLayoutParams(layoutParams);
}
if(autostart){
optionsContainer.post(new Runnable(){
@Override
public void run(){
normalContainerHeight = optionsContainer.getHeight();
attemptStart();
}
});
autostart = false;
}
}
@Override
public void onStop(){
@@ -317,7 +334,6 @@ public void run(){
class ReaverTask extends AsyncTask<Void, String, Boolean>{
String pinDelay, lockedDelay;
boolean ignoreLocked, eapFail, smallDH, pixieDust, noNack;
int prevOptContainerHeight = -1;
ValueAnimator sizeAnimator;
@Override
protected void onPreExecute(){
@@ -332,8 +348,6 @@ protected void onPreExecute(){
start_button.setText(R.string.stop);
progress.setIndeterminate(true);
prevOptContainerHeight = optionsContainer.getHeight();
sizeAnimator = ValueAnimator.ofInt(optionsContainer.getHeight(), 0);
sizeAnimator.setTarget(optionsContainer);
sizeAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
@@ -421,7 +435,8 @@ void done(){
start_button.setText(R.string.start);
progress.setIndeterminate(false);
sizeAnimator = ValueAnimator.ofInt(0, prevOptContainerHeight);
Log.e("TESTESTESTEST", "normalContainerHeight is " + normalContainerHeight);
sizeAnimator = ValueAnimator.ofInt(0, normalContainerHeight);
sizeAnimator.setTarget(optionsContainer);
sizeAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
@Override
@@ -437,6 +452,7 @@ public void onAnimationStart(Animator animation){}
@Override
public void onAnimationEnd(Animator animation){
consoleScrollView.fullScroll(View.FOCUS_DOWN);
Log.e("TESTESTESTEST", "Animation Finished");
}
@Override
public void onAnimationCancel(Animator animation){}
@@ -447,6 +463,8 @@ public void onAnimationRepeat(Animator animation){}
if(optionsContainer!=null) {
sizeAnimator.start();
}else{
Log.e("TESTESTESTEST", "SHIT HAPPENED");
}
}
}
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorAccent" android:state_checked="true" />
<item android:color="@android:color/white" android:state_checked="false"/>
</selector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
</vector>
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- The main content view -->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
@@ -14,7 +15,6 @@
tools:context="com.hijacker.MainActivity"
android:animateLayoutChanges="true">
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
@@ -89,15 +89,16 @@
android:layout_marginTop="3dp" />
</RelativeLayout>
<!-- The navigation drawer -->
<ListView android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="?attr/colorPrimary"
android:paddingTop="200dp"
android:listSelector="?attr/colorAccent" />
<!-- Container for contents of drawer - use NavigationView to make configuration easier -->
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header"
app:itemTextColor="@color/drawer_selector"
app:menu="@menu/drawer_view" />
</android.support.v4.widget.DrawerLayout>
@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- The main content view -->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
@@ -89,15 +91,15 @@
android:layout_marginTop="3dp" />
</RelativeLayout>
<!-- The navigation drawer -->
<ListView android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="?attr/colorPrimary"
android:paddingTop="150dp"
android:listSelector="?attr/colorAccent" />
<!-- Container for contents of drawer - use NavigationView to make configuration easier -->
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header"
app:itemTextColor="@color/drawer_selector"
app:menu="@menu/drawer_view" />
</android.support.v4.widget.DrawerLayout>
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="192dp"
android:background="?attr/colorPrimary"
android:orientation="vertical"
android:padding="16dp">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
app:srcCompat="@drawable/ic_notification" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="@string/app_name"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="18sp" />
</RelativeLayout>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_airodump"
android:title="@string/nav_airodump" />
<item
android:id="@+id/nav_mdk3"
android:title="@string/nav_mdk3" />
<item
android:id="@+id/nav_reaver"
android:title="@string/nav_reaver" />
<item
android:id="@+id/nav_crack"
android:title="@string/nav_crack" />
<item
android:id="@+id/nav_custom_actions"
android:title="@string/nav_custom_actions" />
<item
android:id="@+id/nav_settings"
android:title="@string/nav_settings" />
</group>
</menu>
@@ -17,7 +17,7 @@
android:id="@+id/reset"
android:icon="@drawable/clear_drawable"
android:title="@string/clear"
app:showAsAction="ifRoom"/>
app:showAsAction="never"/>
<item
android:id="@+id/stop_aireplay"
@@ -8,13 +8,5 @@
<item>Reaver</item>
<item>Reaver in chroot</item>
</array>
<array name="planets_array">
<item>Airodump</item>
<item>MDK3</item>
<item>Crack cap file</item>
<item>Reaver</item>
<item>Custom Actions</item>
<item>@string/settings</item>
</array>
</resources>
@@ -25,6 +25,17 @@
<string name="download">Download</string>
<string name="unknown_error">An unknown error occurred</string>
<!-- Navigation Drawer -->
<string name="nav_airodump">Airodump</string>
<string name="nav_mdk3">MDK3</string>
<string name="nav_reaver">Reaver</string>
<string name="nav_crack">Crack .cap file</string>
<string name="nav_custom_actions">Custom Actions</string>
<string name="nav_settings">Settings</string>
<!-- AP -->
<string name="reaver_already_running">Reaver is already running</string>
<!-- APDialog (xml) -->
<string name="mac">MAC:</string>
<string name="channel">Channel:</string>

0 comments on commit 1169b4e

Please sign in to comment.