Use [address]:port notation for IPv6 (#334)

This commit is contained in:
Ridhwan Ikhwanto 2023-07-13 18:27:06 +07:00 committed by GitHub
parent a85faf7d5c
commit efa982c2c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -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())) {

View File

@ -3,6 +3,7 @@
<string name="default_collector_ip" translatable="false">127.0.0.1</string>
<string name="default_collector_port" translatable="false">1234</string>
<string name="ip_and_port" translatable="false">%1$s:%2$d</string>
<string name="ipv6_and_port" translatable="false">[%1$s]:%2$d</string>
<string name="app_and_proto" translatable="false">%1$s (%2$s)</string>
<string name="sni" translatable="false">SNI</string>
<string name="url" translatable="false">URL</string>