Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc small bugfixes, layout tweaks, & lint suggestions + Target Android 10 / API 29 #990

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0-alpha12'
classpath 'com.android.tools.build:gradle:3.6.0-alpha12'
}
}

Expand Down
20 changes: 10 additions & 10 deletions cSploit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0-alpha12'
classpath 'com.android.tools.build:gradle:3.6.0-alpha12'
}
}

Expand All @@ -18,25 +18,25 @@ apply plugin: 'com.android.application'

dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.preference:preference:1.0.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.google.android.material:material:1.0.0'
implementation 'org.apache.commons:commons-compress:1.18'
implementation 'org.apache.commons:commons-compress:1.19'
implementation 'commons-net:commons-net:3.6'
implementation 'com.github.zafarkhaja:java-semver:0.9.0'
implementation 'org.unbescape:unbescape:1.1.6.RELEASE'
implementation 'org.msgpack:msgpack:0.6.12'
implementation 'com.googlecode.juniversalchardet:juniversalchardet:1.0.3'
implementation 'org.tukaani:xz:1.8'
implementation 'ch.acra:acra-http:5.2.0'
implementation 'ch.acra:acra-notification:5.2.0'
implementation 'ch.acra:acra-http:5.4.0'
implementation 'ch.acra:acra-notification:5.4.0'
testImplementation 'junit:junit:4.12'
}

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileSdkVersion 29
buildToolsVersion '29.0.2'

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -50,7 +50,7 @@ android {

defaultConfig {
minSdkVersion 14
targetSdkVersion 28
targetSdkVersion 29
versionCode 4
versionName "1.7.0-unstable"
if(System.getenv("NIGHTLY_BUILD")) {
Expand Down
6 changes: 4 additions & 2 deletions cSploit/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

<application
android:name=".CSploitApplication"
android:allowBackup="true"
android:allowBackup="false"
android:fullBackupContent="false"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:resizeableActivity="true">
android:resizeableActivity="true"
tools:ignore="GoogleAppIndexingWarning">

<meta-data
android:name="android.max_aspect"
Expand Down
2 changes: 1 addition & 1 deletion cSploit/src/main/java/org/csploit/android/net/Target.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public void setPort(Port port) {
private ArrayList<Session> mSessions = new ArrayList<Session>();

public static Target getFromString(String string){
final Pattern PARSE_PATTERN = Pattern.compile("^(([a-z]+)://)?([0-9a-z\\-\\.]+)(:([\\d]+))?[0-9a-z\\-\\./]*$", Pattern.CASE_INSENSITIVE);
final Pattern PARSE_PATTERN = Pattern.compile("^(([a-z]+)://)?([0-9a-z\\-.]+)(:([\\d]+))?[0-9a-z\\-./]*$", Pattern.CASE_INSENSITIVE);
final Pattern IP_PATTERN = Pattern.compile("^[\\d]{1,3}\\.[\\d]{1,3}\\.[\\d]{1,3}\\.[\\d]{1,3}$");

Matcher matcher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class ProxyThread extends Thread
private final static int MAX_REQUEST_SIZE = 8192;
private final static int HTTP_SERVER_PORT = 80;
private final static int HTTPS_SERVER_PORT = 443;
private final static Pattern LINK_PATTERN = Pattern.compile("(https://[\\w\\d:#@%/;$()~_?\\+-=\\\\\\.&]*)", Pattern.CASE_INSENSITIVE);
private final static Pattern LINK_PATTERN = Pattern.compile("(https://[\\w\\d:#@%/;$()~_?+-=\\\\.&]*)", Pattern.CASE_INSENSITIVE);

private Socket mSocket = null;
private BufferedOutputStream mWriter = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.UnknownHostException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.csploit.android.net.metasploit;

import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Map;
import java.util.regex.Pattern;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import androidx.core.content.ContextCompat;
import android.util.SparseArray;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
Expand All @@ -39,6 +38,10 @@
import android.widget.TextView;
import android.widget.Toast;

import androidx.core.content.ContextCompat;

import com.google.android.material.floatingactionbutton.FloatingActionButton;

import org.csploit.android.R;
import org.csploit.android.core.ChildManager;
import org.csploit.android.core.Logger;
Expand All @@ -55,8 +58,6 @@
import org.csploit.android.tools.NMap;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class PortScanner extends Plugin {
private TextView mTextDoc = null;
Expand All @@ -72,7 +73,7 @@ public class PortScanner extends Plugin {
private static final String CUSTOM_PARAMETERS = "PortScanner.Prefs.CustomParameters";
private static final String CUSTOM_PARAMETERS_TEXT = "PortScanner.Prefs.CustomParameters.Text";
private SharedPreferences mPreferences = null;
private Map<Integer, String> urlFormats = new HashMap<>();
private SparseArray<String> urlFormats = new SparseArray<>();
private boolean mShowCustomParameters = false;

public PortScanner() {
Expand Down Expand Up @@ -228,7 +229,7 @@ public boolean onItemLongClick(AdapterView<?> parent, View view,
int position, long id) {
int portNumber = target.getOpenPorts().get(position).getNumber();

if(!urlFormats.containsKey(portNumber)) {
if(urlFormats.get(portNumber) != null) {
portNumber = 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public String onDataReceived(String headers, String data){
// handle css background declarations
data = data.replaceAll
(
"(?i)background\\s*(:|-)\\s*url\\s*[\\(|:][^\\);]+\\)?.*",
"(?i)background\\s*(:|-)\\s*url\\s*[(|:][^\\);]+\\)?.*",
"background: url(" + resource + ")"
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.view.MenuItem;

import org.csploit.android.R;
Expand Down
140 changes: 70 additions & 70 deletions cSploit/src/main/res/layout/about_dialog.xml
Original file line number Diff line number Diff line change
@@ -1,104 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:padding="10dp">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical">

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:text="@string/csploit_catchphrase"
android:textAppearance="?android:attr/textAppearanceMedium"/>
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:text="@string/csploit_catchphrase"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_alignRight="@+id/textView1"
android:layout_below="@+id/textView1"
android:text="@string/csploit_copyleft"
android:textAppearance="?android:attr/textAppearanceSmall"/>
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_alignLeft="@+id/textView1"
android:layout_alignRight="@+id/textView1"
android:text="@string/csploit_copyleft"
android:textAppearance="?android:attr/textAppearanceSmall" />

<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView2"
android:layout_alignRight="@+id/textView2"
android:layout_below="@+id/textView2"
android:autoLink="web"
android:linksClickable="true"
android:text="@string/csploit_url"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold"/>
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView2"
android:layout_alignLeft="@+id/textView2"
android:layout_alignRight="@+id/textView2"
android:autoLink="web"
android:linksClickable="true"
android:text="@string/csploit_url"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold" />

<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView3"
android:layout_below="@+id/textView3"
android:text="@string/disclaimer"
android:textAppearance="?android:attr/textAppearanceMedium"/>
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView3"
android:layout_alignLeft="@+id/textView3"
android:text="@string/disclaimer"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView5"
android:layout_below="@+id/textView5"
android:text="@string/csploit_disclaimer"
android:textAppearance="?android:attr/textAppearanceSmall"/>
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView5"
android:layout_alignLeft="@+id/textView5"
android:text="@string/csploit_disclaimer"
android:textAppearance="?android:attr/textAppearanceSmall" />

<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView6"
android:layout_below="@+id/textView6"
android:text="@string/license"
android:textAppearance="?android:attr/textAppearanceMedium"/>
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView6"
android:layout_alignLeft="@+id/textView6"
android:text="@string/license"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView7"
android:layout_alignParentRight="true"
android:layout_below="@+id/textView7"
android:text="@string/gpl_license"
android:textAppearance="?android:attr/textAppearanceSmall"/>
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView7"
android:layout_alignLeft="@+id/textView7"
android:layout_alignParentRight="true"
android:text="@string/gpl_license"
android:textAppearance="?android:attr/textAppearanceSmall" />

<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView8"
android:layout_below="@+id/textView8"
android:layout_alignLeft="@+id/textView8"
android:text="@string/buildinfo"
android:textAppearance="?android:attr/textAppearanceMedium"/>
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/buildinfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView9"
android:layout_alignLeft="@+id/textView9"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/textView9"
android:textAppearance="?android:attr/textAppearanceSmall"/>
android:layout_alignParentBottom="true"
android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>

</ScrollView>
1 change: 0 additions & 1 deletion cSploit/src/main/res/layout/plugin_exploit_finder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
android:layout_margin="20dp" />

<ListView
android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
Expand Down
6 changes: 1 addition & 5 deletions cSploit/src/main/res/layout/target_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,16 @@
android:id="@+id/textView10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_row="0"
android:gravity="top|center_horizontal"
android:text="@string/ports"
android:textColor="@color/primary_material_light"
android:textSize="12dp"
android:textSize="12sp"
android:textStyle="bold" />

<TextView
android:id="@+id/portCount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_row="0"
android:gravity="top|center_horizontal"
android:text="22"
android:textColor="@color/background_window"
Expand Down
3 changes: 0 additions & 3 deletions cSploit/src/main/res/layout/wifi_scanner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
android:padding="8dp">

<ListView
android:id="@+id/android:list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
Expand All @@ -18,9 +17,7 @@
android:id="@+id/scanStatusText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/android:list"
android:layout_alignParentTop="true"
android:layout_alignRight="@+id/android:list"
android:fontFamily="sans-serif-condensed"
android:padding="8dp"
android:text="Status"
Expand Down
Loading