HYDK v3.0.0版本的 MD5 值为:36b96e4c5561390bc72ab66c2f29a92f

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


package p.a.y.e.a.s.e.net;

import android.content.Context;
import android.net.wifi.WifiManager;
import android.util.Log;
import io.netty.handler.codec.dns.DefaultDnsRecordDecoder;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.JSONObject;

public class kd0 {
    private static String[] lite_do = {"http://pv.sohu.com/cityjson", "http://pv.sohu.com/cityjson?ie=utf-8", "http://ip.chinaz.com/getip.aspx"};

    public static String lite_do(Context context) {
        WifiManager wifiManager = (WifiManager) context.getSystemService("wifi");
        if (!wifiManager.isWifiEnabled()) {
            wifiManager.setWifiEnabled(true);
        }
        return lite_for(wifiManager.getConnectionInfo().getIpAddress());
    }

    private static String lite_for(int i) {
        return (i & 255) + DefaultDnsRecordDecoder.ROOT + ((i >> 8) & 255) + DefaultDnsRecordDecoder.ROOT + ((i >> 16) & 255) + DefaultDnsRecordDecoder.ROOT + ((i >> 24) & 255);
    }

    public static String lite_if(Context context, int i) {
        if (i >= lite_do.length) {
            return lite_do(context);
        }
        try {
            HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(lite_do[i]).openConnection();
            httpURLConnection.setRequestMethod(gb2.G);
            httpURLConnection.setReadTimeout(5000);
            httpURLConnection.setConnectTimeout(5000);
            httpURLConnection.setDoInput(true);
            httpURLConnection.setUseCaches(false);
            if (httpURLConnection.getResponseCode() == 200) {
                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream(), "UTF-8"));
                StringBuilder sb = new StringBuilder();
                while (true) {
                    String readLine = bufferedReader.readLine();
                    if (readLine == null) {
                        break;
                    }
                    sb.append(readLine);
                }
                bufferedReader.close();
                httpURLConnection.disconnect();
                Log.e("xiaoman", sb.toString());
                if (i != 0 && i != 1) {
                    if (i == 2) {
                        return new JSONObject(sb.toString()).getString("ip");
                    }
                }
                return new JSONObject(sb.substring(sb.indexOf("{"), sb.indexOf(e4.lite_int) + 1)).getString("cip");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return lite_if(context, i + 1);
    }
}