mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 13:44:40 +00:00
Added network interfaces to debug info
This commit is contained in:
parent
0ce2759f62
commit
55b1f44c5b
1 changed files with 24 additions and 0 deletions
|
@ -90,6 +90,9 @@ import java.io.InputStreamReader;
|
|||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Array;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InterfaceAddress;
|
||||
import java.net.NetworkInterface;
|
||||
import java.net.SocketException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.cert.CertPathValidatorException;
|
||||
|
@ -100,6 +103,7 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -1981,6 +1985,26 @@ public class Log {
|
|||
size += write(os, "\r\n");
|
||||
}
|
||||
|
||||
try {
|
||||
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
|
||||
while (interfaces != null && interfaces.hasMoreElements()) {
|
||||
NetworkInterface ni = interfaces.nextElement();
|
||||
size += write(os, "Interface=" + ni + "\r\n");
|
||||
for (InterfaceAddress iaddr : ni.getInterfaceAddresses()) {
|
||||
InetAddress addr = iaddr.getAddress();
|
||||
size += write(os, " addr=" + addr +
|
||||
(addr.isLoopbackAddress() ? " loopback" : "") +
|
||||
(addr.isSiteLocalAddress() ? " site local (LAN)" : "") +
|
||||
(addr.isLinkLocalAddress() ? " link local (device)" : "") +
|
||||
(addr.isAnyLocalAddress() ? " any local" : "") +
|
||||
(addr.isMulticastAddress() ? " multicast" : "") + "\r\n");
|
||||
}
|
||||
size += write(os, "\r\n");
|
||||
}
|
||||
} catch (Throwable ex) {
|
||||
size += write(os, ex.getMessage() + "\r\n");
|
||||
}
|
||||
|
||||
size += write(os, "VPN active=" + ConnectionHelper.vpnActive(context) + "\r\n\r\n");
|
||||
|
||||
ConnectionHelper.NetworkState state = ConnectionHelper.getNetworkState(context);
|
||||
|
|
Loading…
Reference in a new issue