Skip to content

Commit

Permalink
Use [address]:port notation for IPv6
Browse files Browse the repository at this point in the history
  • Loading branch information
rikhwanto committed Jul 13, 2023
1 parent a85faf7 commit d2c70f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,13 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
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())) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit d2c70f4

Please sign in to comment.