From efa982c2c65c4fef60adcf47fa315c3b014e8608 Mon Sep 17 00:00:00 2001 From: Ridhwan Ikhwanto <33298810+rikhwanto@users.noreply.github.com> Date: Thu, 13 Jul 2023 18:27:06 +0700 Subject: [PATCH] Use [address]:port notation for IPv6 (#334) --- .../remote_capture/fragments/ConnectionOverview.java | 9 +++++++-- app/src/main/res/values/strings.xml | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/emanuelef/remote_capture/fragments/ConnectionOverview.java b/app/src/main/java/com/emanuelef/remote_capture/fragments/ConnectionOverview.java index d38663c8..32703c0b 100644 --- a/app/src/main/java/com/emanuelef/remote_capture/fragments/ConnectionOverview.java +++ b/app/src/main/java/com/emanuelef/remote_capture/fragments/ConnectionOverview.java @@ -163,8 +163,13 @@ public class ConnectionOverview extends Fragment implements ConnectionDetailsAct source.setText(mConn.src_ip); destination.setText(mConn.dst_ip); } else { - source.setText(String.format(getResources().getString(R.string.ip_and_port), mConn.src_ip, mConn.src_port)); - destination.setText(String.format(getResources().getString(R.string.ip_and_port), mConn.dst_ip, mConn.dst_port)); + if (mConn.ipver == 6) { + source.setText(String.format(getResources().getString(R.string.ipv6_and_port), mConn.src_ip, mConn.src_port)); + destination.setText(String.format(getResources().getString(R.string.ipv6_and_port), mConn.dst_ip, mConn.dst_port)); + } else { + source.setText(String.format(getResources().getString(R.string.ip_and_port), mConn.src_ip, mConn.src_port)); + destination.setText(String.format(getResources().getString(R.string.ip_and_port), mConn.dst_ip, mConn.dst_port)); + } } if((mConn.info != null) && (!mConn.info.isEmpty())) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 09768ee3..aa201853 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -3,6 +3,7 @@ 127.0.0.1 1234 %1$s:%2$d + [%1$s]:%2$d %1$s (%2$s) SNI URL