QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

以下内容为反编译后的 i.java 源代码,内容仅作参考


package com.tencent.luggage.util;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import com.tencent.luggage.wxa.se.aa;
import com.tencent.luggage.wxa.se.ai;
import com.tencent.luggage.wxa.se.r;
import com.tencent.luggage.wxa.se.u;
import com.tencent.mtt.compliance.MethodDelegate;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
import java.util.Locale;

public class i {
    public static String a() {
        int i = 0;
        try {
            i = aa.e(u.a());
        } catch (Exception e) {
            r.b("Luggage.LuggageNetUtil", "getSelfIp, call NetworkDetailInfo.getNetType(), exp = %s", e);
        }
        if (i == -1) {
            return "127.0.0.1";
        }
        if (i == 0) {
            return a(u.a());
        }
        try {
            Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
            while (networkInterfaces.hasMoreElements()) {
                NetworkInterface nextElement = networkInterfaces.nextElement();
                if (nextElement != null) {
                    Enumeration<InetAddress> inetAddresses = nextElement.getInetAddresses();
                    while (inetAddresses.hasMoreElements()) {
                        InetAddress nextElement2 = inetAddresses.nextElement();
                        if (nextElement2 != null && !nextElement2.isLoopbackAddress() && (nextElement2 instanceof Inet4Address)) {
                            return ai.c(MethodDelegate.getHostAddress(nextElement2)) ? "127.0.0.1" : MethodDelegate.getHostAddress(nextElement2);
                        }
                    }
                }
            }
            return "127.0.0.1";
        } catch (Exception unused) {
            return "127.0.0.1";
        }
    }

    public static String a(Context context) {
        int d2 = com.tencent.luggage.wxa.se.h.f26242a.d();
        return d2 == 0 ? "127.0.0.1" : String.format(Locale.ENGLISH, "%d.%d.%d.%d", Integer.valueOf(d2 & 255), Integer.valueOf((d2 >> 8) & 255), Integer.valueOf((d2 >> 16) & 255), Integer.valueOf((d2 >> 24) & 255));
    }

    public static boolean b(Context context) {
        NetworkInfo networkInfo;
        ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
        if (connectivityManager == null || (networkInfo = connectivityManager.getNetworkInfo(1)) == null) {
            return false;
        }
        return networkInfo.isConnected();
    }
}