正在查看: 050 IP Phone v2.3.0 应用的 a0.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 050 IP Phone v2.3.0 应用的 a0.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package t4;
import android.content.Context;
import android.net.LinkAddress;
import android.net.LinkProperties;
import android.provider.Settings;
import com.oki.esound.EsEngineJni;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.regex.Pattern;
import t4.q;
public class a0 {
private static class b implements q.d {
private InetAddress a;
private String b;
public InetAddress c() {
return this.a;
}
@Override
public void a() {
this.a = a0.b(this.b);
synchronized (this) {
notify();
}
}
private b(String str) {
this.a = null;
this.b = str;
}
}
public static String a(InetAddress inetAddress) {
if (inetAddress != null) {
return inetAddress.getHostAddress();
}
return null;
}
public static java.net.InetAddress b(java.lang.String r6) {
throw new UnsupportedOperationException("Method not decompiled: t4.a0.b(java.lang.String):java.net.InetAddress");
}
private static InetAddress c(String str) {
b bVar = new b(str);
synchronized (bVar) {
q.g(bVar);
try {
bVar.wait(20000L);
} catch (InterruptedException e) {
z.o("NetworkUtils", "getActiveLocalHostAsync() interrupted", e);
}
}
return bVar.c();
}
public static String d(String str) {
return e(b(str));
}
private static String e(InetAddress inetAddress) {
if (inetAddress == null) {
return null;
}
if (inetAddress instanceof Inet6Address) {
z.p("NetworkUtils", "iaddr is IPv6 address. iaddr=[" + inetAddress + "]");
}
return inetAddress.getHostAddress();
}
public static String f(String str) {
String str2;
InetAddress c = c(str);
if (c != null) {
Inet4Address h = h(c);
if (c instanceof Inet4Address) {
str2 = e(c);
} else if (c instanceof Inet6Address) {
str2 = h != null ? e(h) : e(c);
}
z.n("NetworkUtils", "getActiveLocalHostAsIPv4Async local: " + str2 + " remote: " + str);
return str2;
}
str2 = null;
z.n("NetworkUtils", "getActiveLocalHostAsIPv4Async local: " + str2 + " remote: " + str);
return str2;
}
public static InetAddress g(String str) {
InetAddress inetAddress;
InetAddress[] allByName = InetAddress.getAllByName(str);
if (allByName != null) {
int length = allByName.length;
for (int i = 0; i < length; i++) {
inetAddress = allByName[i];
if (inetAddress != null && (inetAddress instanceof Inet4Address)) {
String hostAddress = inetAddress.getHostAddress();
if (!n(hostAddress) && !inetAddress.isAnyLocalAddress() && m(hostAddress)) {
break;
}
}
}
}
inetAddress = null;
return inetAddress == null ? InetAddress.getByName(str) : inetAddress;
}
private static java.net.Inet4Address h(java.net.InetAddress r10) {
throw new UnsupportedOperationException("Method not decompiled: t4.a0.h(java.net.InetAddress):java.net.Inet4Address");
}
public static InetAddress i(LinkProperties linkProperties) {
InetAddress inetAddress = null;
for (LinkAddress linkAddress : linkProperties.getLinkAddresses()) {
if (linkAddress != null && linkAddress.getAddress() != null) {
InetAddress address = linkAddress.getAddress();
z.n("NetworkUtils", "inetAddress: " + address);
if (inetAddress == null && l(address)) {
inetAddress = address;
}
}
}
return inetAddress;
}
public static InetAddress j(int i) {
try {
return InetAddress.getByAddress(new byte[]{(byte) (i & EsEngineJni.NwMonitoringResult.ES_NW_MONITORING_RES_EXPIRED), (byte) ((i >> 8) & EsEngineJni.NwMonitoringResult.ES_NW_MONITORING_RES_EXPIRED), (byte) ((i >> 16) & EsEngineJni.NwMonitoringResult.ES_NW_MONITORING_RES_EXPIRED), (byte) ((i >> 24) & EsEngineJni.NwMonitoringResult.ES_NW_MONITORING_RES_EXPIRED)});
} catch (UnknownHostException unused) {
throw new AssertionError("Failed to convert int address: " + i);
}
}
public static boolean k(Context context) {
boolean z = Settings.Global.getInt(context.getContentResolver(), "airplane_mode_on", 0) != 0;
z.n("NetworkUtils", "isAirPlaneModeOn: " + z);
return z;
}
public static boolean l(InetAddress inetAddress) {
if (inetAddress instanceof Inet4Address) {
String hostAddress = inetAddress.getHostAddress();
if (!n(hostAddress) && !inetAddress.isAnyLocalAddress() && m(hostAddress)) {
return true;
}
}
return false;
}
private static boolean m(String str) {
return Pattern.matches("((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])([.](?!$)|$)){4}", str);
}
private static boolean n(String str) {
return "127.0.0.1".equals(str) || "0.0.0.0".equals(str);
}
public static boolean o(Context context) {
return !k(context);
}
}