360手机助手 v3.3.0版本的 MD5 值为:127c345ad16bbebee6e347381328afd0

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


package com.qihoo.appstore.http;

import android.content.Context;
import android.database.Cursor;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import com.qihoo.appstore.utils.bk;

public class a {

    public static final Uri f1681a = Uri.parse("content://telephony/carriers/preferapn");

    private String f1682b;
    private String c;
    private String d;
    private boolean e;
    private int f;

    public a(Context context) {
        b(context);
    }

    private void a(Context context) {
        try {
            Cursor query = context.getContentResolver().query(f1681a, new String[]{"apn", "proxy", "port"}, null, null, null);
            if (query == null) {
                this.e = false;
                this.f = 3;
            } else if (query.moveToFirst()) {
                this.f1682b = query.getString(query.getColumnIndex("apn"));
                this.d = query.getString(query.getColumnIndex("proxy"));
                this.c = query.getString(query.getColumnIndex("port"));
                bk.b("apn", "mapn=" + this.f1682b + "  mproxy=" + this.d + " mport=" + this.c);
                if (this.d == null || this.d.length() <= 0) {
                    String upperCase = this.f1682b.toUpperCase();
                    if (upperCase.equals("CMWAP") || upperCase.equals("UNIWAP") || upperCase.equals("3GWAP")) {
                        this.e = true;
                        this.d = "10.0.0.172";
                        this.c = "80";
                        this.f = 2;
                    } else if (upperCase.equals("CTWAP")) {
                        this.e = true;
                        this.d = "10.0.0.200";
                        this.c = "80";
                        this.f = 2;
                    }
                }
                if (this.d == null || this.d.length() <= 0) {
                    this.e = false;
                    this.f = 3;
                } else {
                    this.c = "80";
                    this.e = true;
                    this.f = 2;
                }
            }
            if (query != null) {
                try {
                    query.close();
                } catch (Exception e) {
                }
            }
        } catch (Exception e2) {
            NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getApplicationContext().getSystemService("connectivity")).getActiveNetworkInfo();
            bk.b("apn", "typeName=" + activeNetworkInfo.getTypeName() + " extroInfo=" + activeNetworkInfo.getExtraInfo());
            if ("mobile".equalsIgnoreCase(activeNetworkInfo.getTypeName())) {
                String extraInfo = activeNetworkInfo.getExtraInfo();
                if ("cmwap".equalsIgnoreCase(extraInfo) || "3gwap".equalsIgnoreCase(extraInfo) || "uniwap".equalsIgnoreCase(extraInfo)) {
                    this.e = true;
                    this.f = 2;
                    this.d = "10.0.0.172";
                    this.c = "80";
                    return;
                }
                if (!"ctwap".equalsIgnoreCase(extraInfo)) {
                    this.f = 3;
                    return;
                }
                this.e = true;
                this.f = 2;
                this.d = "10.0.0.200";
                this.c = "80";
            }
        }
    }

    private void b(Context context) {
        NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getApplicationContext().getSystemService("connectivity")).getActiveNetworkInfo();
        if (activeNetworkInfo != null) {
            bk.b("apn", "checkNetworkType  name=" + activeNetworkInfo.getTypeName().toLowerCase());
            if (!"wifi".equals(activeNetworkInfo.getTypeName().toLowerCase())) {
                a(context);
            } else {
                this.f = 1;
                this.e = false;
            }
        }
    }

    public int a() {
        return this.f;
    }

    public boolean b() {
        return this.e;
    }
}