From e8063ddbdbc1d0aa3f58d4f32a0616cde1d20d64 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 22 Jan 2016 11:28:29 +0100 Subject: [PATCH] Blocked traffic layout improvements --- FAQ.md | 11 ++ .../java/eu/faircode/netguard/LogAdapter.java | 16 ++- app/src/main/res/layout/log.xml | 107 ++++++++++-------- 3 files changed, 75 insertions(+), 59 deletions(-) diff --git a/FAQ.md b/FAQ.md index edec9541..3fe56bb1 100644 --- a/FAQ.md +++ b/FAQ.md @@ -233,6 +233,17 @@ The columns have the following meaning: 1. Application uid 1. IPv4 or IPv6 address (tap on a log entry to lookup an IP address) +From version 0.77: + +1. Time (tap on a log entry to see the date) +1. Application icon (tap on a log entry to see the application name) +1. Application uid +1. Wi-Fi / mobile connection, green=allowed, red=blocked +1. Interactive state (screen on) +1. Protocol (see below) and packet flags (see below) +1. Source and destination port (tap on a log entry to lookup a destination port) +1. Source and destination IPv4 or IPv6 address (tap on a log entry to lookup a destination IP address) + Protocols: * I = ICMP diff --git a/app/src/main/java/eu/faircode/netguard/LogAdapter.java b/app/src/main/java/eu/faircode/netguard/LogAdapter.java index 29015385..a8613cf4 100644 --- a/app/src/main/java/eu/faircode/netguard/LogAdapter.java +++ b/app/src/main/java/eu/faircode/netguard/LogAdapter.java @@ -105,12 +105,15 @@ public class LogAdapter extends CursorAdapter { else ivInteractive.setImageResource(R.drawable.screen_on); - if (protocol == 1) // ICMP - tvProtocol.setText("I"); + // https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers + if (protocol == 0) // HOPOPT + tvProtocol.setText("HOPO"); + else if (protocol == 1) // ICMP + tvProtocol.setText("ICMP"); else if (protocol == 6) // TCP - tvProtocol.setText("T"); + tvProtocol.setText("TCP"); else if (protocol == 17) // UDP - tvProtocol.setText("U"); + tvProtocol.setText("UDP"); else tvProtocol.setText(protocol < 0 ? "" : Integer.toString(protocol)); @@ -148,11 +151,6 @@ public class LogAdapter extends CursorAdapter { else tvUid.setText(Integer.toString(uid)); - // tvProtocol.setText("99"); - // tvPort.setText("88888"); - // tvFlags.setText("+APFR"); - // tvUid.setText("18888"); - // TODO resolve source when inbound tvSource.setText(source); diff --git a/app/src/main/res/layout/log.xml b/app/src/main/res/layout/log.xml index b71d96a3..cc750ef0 100644 --- a/app/src/main/res/layout/log.xml +++ b/app/src/main/res/layout/log.xml @@ -14,11 +14,27 @@ android:textAppearance="@android:style/TextAppearance.Material.Small" android:textSize="12sp" /> + + + + + android:layout_gravity="center_vertical" + android:layout_marginStart="4dp" /> - - - - - - - - - - - - + android:orientation="horizontal"> - + + + + + + android:orientation="horizontal"> + + + + +