import java.net.NetworkInterface;
import java.util.Collections;
import java.util.Enumeration;
public class VPN {
public VPN() {
}
public static boolean isVpnUsed() {
try {
Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
if (networkInterfaces != null) {
for (T t : Collections.list(networkInterfaces)) {
if (t.isUp() && t.getInterfaceAddresses().size() != 0) {
if ("tun0".equals(t.getName()) || "ppp0".equals(t.getName())) {
return true;
}
}
}
}
} catch (Throwable th) {
th.printStackTrace();
}
return false;
}
}
THE END