换机精灵 v2.5.2版本的 MD5 值为:469dcb6202646d6ec40973ea20c8c14b

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


package tmsdkobf;

import android.content.Context;
import android.net.NetworkInfo;
import android.net.Proxy;
import android.telephony.TelephonyManager;
import tmsdk.common.TMServiceFactory;

public class fm {
    public static int lL = 4;
    public static String lM = null;
    public static int lN = 80;
    public static byte lO = 0;
    public static boolean lP = false;
    public static boolean lQ = false;
    public static byte lR = 4;
    public static String lS = "unknown";
    public static byte lT = 9;
    public static int lU = 17;

    private static int a(Context context, NetworkInfo networkInfo) {
        TelephonyManager telephonyManager;
        int i = 1;
        if (networkInfo == null) {
            return 0;
        }
        try {
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (1 != networkInfo.getType()) {
            if (networkInfo.getType() == 0 && (telephonyManager = (TelephonyManager) context.getSystemService("phone")) != null) {
                switch (telephonyManager.getNetworkType()) {
                    case 1:
                        i = 2;
                        break;
                    case 2:
                        i = 3;
                        break;
                    case 3:
                        i = 4;
                        break;
                    case 4:
                        i = 8;
                        break;
                    case 5:
                        i = 9;
                        break;
                    case 6:
                        i = 10;
                        break;
                    case 7:
                        i = 11;
                        break;
                    case 8:
                        i = 5;
                        break;
                    case 9:
                        i = 6;
                        break;
                    case 10:
                        i = 7;
                        break;
                    default:
                        i = 17;
                        break;
                }
            }
            i = 0;
        }
        return i;
    }

    private static void aC(String str) {
        if (str == null) {
            return;
        }
        if (str.contains("cmwap")) {
            lS = "cmwap";
            lT = (byte) 0;
            return;
        }
        if (str.contains("cmnet")) {
            lS = "cmnet";
            lT = (byte) 1;
            return;
        }
        if (str.contains("3gwap")) {
            lS = "3gwap";
            lT = (byte) 2;
            return;
        }
        if (str.contains("3gnet")) {
            lS = "3gnet";
            lT = (byte) 3;
            return;
        }
        if (str.contains("uniwap")) {
            lS = "uniwap";
            lT = (byte) 4;
            return;
        }
        if (str.contains("uninet")) {
            lS = "uninet";
            lT = (byte) 5;
            return;
        }
        if (str.contains("ctwap")) {
            lS = "ctwap";
            lT = (byte) 6;
        } else if (str.contains("ctnet")) {
            lS = "ctnet";
            lT = (byte) 7;
        } else if (str.contains("#777")) {
            lS = "#777";
            lT = (byte) 8;
        }
    }

    private static boolean at(int i) {
        return i == 2 || i == 0;
    }

    public static void c(Context context) {
        if (lQ) {
            return;
        }
        synchronized (fm.class) {
            if (!lQ) {
                init(context);
                lQ = true;
            }
        }
    }

    public static void init(Context context) {
        NetworkInfo networkInfo;
        String str = null;
        try {
            networkInfo = TMServiceFactory.getSystemInfoService().getActiveNetworkInfo();
        } catch (NullPointerException e) {
            tmsdk.common.utils.d.f("getActiveNetworkInfo", " getActiveNetworkInfo NullPointerException--- \n" + e.getMessage());
            networkInfo = null;
        }
        tmsdk.common.utils.d.e("Apn", "networkInfo : " + networkInfo);
        int i = -1;
        try {
            lL = 0;
            lR = (byte) 4;
            if (networkInfo != null) {
                i = networkInfo.getType();
                tmsdk.common.utils.d.e("Apn", "type: " + networkInfo.getType());
                tmsdk.common.utils.d.e("Apn", "typeName: " + networkInfo.getTypeName());
                str = networkInfo.getExtraInfo();
                if (str == null) {
                    lL = 0;
                } else {
                    str = str.trim().toLowerCase();
                }
            }
            tmsdk.common.utils.d.e("Apn", "extraInfo : " + str);
            if (i == 1) {
                lL = 4;
                lP = false;
                lR = (byte) 3;
                lS = "unknown";
                lT = (byte) 9;
            } else {
                aC(str);
                if (str == null) {
                    lL = 0;
                } else if (str.contains("cmwap") || str.contains("uniwap") || str.contains("3gwap") || str.contains("ctwap")) {
                    lR = (byte) 1;
                    if (str.contains("3gwap")) {
                        lR = (byte) 2;
                    }
                    lL = 2;
                } else if (str.contains("cmnet") || str.contains("uninet") || str.contains("3gnet") || str.contains("ctnet")) {
                    lR = (byte) 1;
                    if (str.contains("3gnet") || str.contains("ctnet")) {
                        lR = (byte) 2;
                    }
                    lL = 1;
                } else if (str.contains("#777")) {
                    lR = (byte) 2;
                    lL = 0;
                } else {
                    lL = 0;
                }
                lP = false;
                if (at(lL)) {
                    lM = Proxy.getDefaultHost();
                    lN = Proxy.getDefaultPort();
                    if (lM != null) {
                        lM = lM.trim();
                    }
                    if (lM == null || "".equals(lM)) {
                        lP = false;
                        lL = 1;
                    } else {
                        lP = true;
                        lL = 2;
                        if ("10.0.0.200".equals(lM)) {
                            lO = (byte) 1;
                        } else {
                            lO = (byte) 0;
                        }
                    }
                }
            }
            tmsdk.common.utils.d.e("Apn", "NETWORK_TYPE : " + ((int) lR));
            tmsdk.common.utils.d.e("Apn", "M_APN_TYPE : " + lL);
            tmsdk.common.utils.d.e("Apn", "M_USE_PROXY : " + lP);
            tmsdk.common.utils.d.e("Apn", "M_APN_PROXY : " + lM);
            tmsdk.common.utils.d.e("Apn", "M_APN_PORT : " + lN);
        } catch (Exception e2) {
            e2.printStackTrace();
        }
        lU = a(context, networkInfo);
        tmsdk.common.utils.d.d("Apn", "init() Apn.APN_NAME_VALUE: " + ((int) lT) + " APN_NAME_DRI: " + lS + " NETWORK_TYPE: " + ((int) lR) + " ENT_VALUE: " + lU);
    }
}