mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-06-16 21:10:57 +08:00
Show blacklisted status in the connection details
This commit is contained in:
parent
6173ef2798
commit
dcdbd527e0
@ -32,6 +32,7 @@ import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@ -56,6 +57,8 @@ public class ConnectionDetailsActivity extends BaseActivity implements Connectio
|
||||
private TextView mFirstSeen;
|
||||
private TextView mLastSeen;
|
||||
private TextView mTcpFlags;
|
||||
private ImageView mBlacklistedIp;
|
||||
private ImageView mBlacklistedHost;
|
||||
private Handler mHandler;
|
||||
private int mConnPos;
|
||||
private boolean mListenerSet;
|
||||
@ -91,6 +94,8 @@ public class ConnectionDetailsActivity extends BaseActivity implements Connectio
|
||||
mFirstSeen = findViewById(R.id.first_seen);
|
||||
mLastSeen = findViewById(R.id.last_seen);
|
||||
mTcpFlags = findViewById(R.id.tcp_flags);
|
||||
mBlacklistedIp = findViewById(R.id.blacklisted_ip);
|
||||
mBlacklistedHost = findViewById(R.id.blacklisted_host);
|
||||
|
||||
String l4proto = Utils.proto2str(mConn.ipproto);
|
||||
|
||||
@ -204,6 +209,8 @@ public class ConnectionDetailsActivity extends BaseActivity implements Connectio
|
||||
mLastSeen.setText(Utils.formatEpochMillis(this, conn.last_seen));
|
||||
mStatus.setText(conn.getStatusLabel(this));
|
||||
mTcpFlags.setText(Utils.tcpFlagsToStr(conn.getRcvdTcpFlags()) + " <- " + Utils.tcpFlagsToStr(conn.getSentTcpFlags()));
|
||||
mBlacklistedIp.setVisibility(conn.isBlacklistedIp() ? View.VISIBLE : View.GONE);
|
||||
mBlacklistedHost.setVisibility(conn.isBlacklistedHost() ? View.VISIBLE : View.GONE);
|
||||
|
||||
if(conn.status >= ConnectionDescriptor.CONN_STATUS_CLOSED)
|
||||
unregisterConnsListener();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
<vector android:height="20dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="512" android:viewportWidth="512"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
android:width="20dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--
|
||||
All brand icons are trademarks of their respective owners.
|
||||
-->
|
||||
|
||||
@ -68,13 +68,26 @@
|
||||
android:layout_weight="0.25"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/sni" />
|
||||
<TextView
|
||||
android:id="@+id/detail_info"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.75"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="ssl.example.com" />
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:id="@+id/blacklisted_host"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingVertical="3sp"
|
||||
android:src="@drawable/ic_skull"
|
||||
app:tint="@color/colorTabText"/>
|
||||
<TextView
|
||||
android:id="@+id/detail_info"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.75"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="ssl.example.com" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
@ -107,13 +120,25 @@
|
||||
android:layout_weight="0.25"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/destination" />
|
||||
<TextView
|
||||
android:id="@+id/detail_destination"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.75"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="5.6.7.8:443" />
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:id="@+id/blacklisted_ip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingVertical="3sp"
|
||||
android:src="@drawable/ic_skull"
|
||||
app:tint="@color/colorTabText"/>
|
||||
<TextView
|
||||
android:id="@+id/detail_destination"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="5.6.7.8:443" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
|
||||
Loading…
Reference in New Issue
Block a user