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

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


package com.qihoo.d.a;

import android.content.Context;
import android.database.Cursor;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;

class a {

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

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

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

    private void a(Context context) {
        try {
            Cursor query = context.getContentResolver().query(f4196a, new String[]{"apn", "proxy", "port"}, null, null, null);
            if (query == null) {
                this.e = false;
                this.f = 3;
            } else if (query.moveToFirst()) {
                this.f4197b = query.getString(query.getColumnIndex("apn"));
                this.d = query.getString(query.getColumnIndex("proxy"));
                this.c = query.getString(query.getColumnIndex("port"));
                if (com.qihoo.d.b.a.c) {
                    com.qihoo.d.b.p.a("Apn: " + this.f4197b + " , Proxy: " + this.d + " , Port: " + this.c);
                }
                if (this.d == null || this.d.length() <= 0) {
                    String upperCase = this.f4197b.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.c == null || this.c.length() <= 0) {
                    this.e = false;
                    this.f = 3;
                } else {
                    b(context);
                    this.e = true;
                }
            }
            if (query != null) {
                try {
                    query.close();
                } catch (Exception e) {
                }
            }
        } catch (Exception e2) {
            this.e = b(context);
        }
    }

    private boolean b(Context context) {
        NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getApplicationContext().getSystemService("connectivity")).getActiveNetworkInfo();
        if ("mobile".equalsIgnoreCase(activeNetworkInfo.getTypeName())) {
            String extraInfo = activeNetworkInfo.getExtraInfo();
            if ("cmwap".equalsIgnoreCase(extraInfo) || "3gwap".equalsIgnoreCase(extraInfo) || "uniwap".equalsIgnoreCase(extraInfo)) {
                this.f = 2;
                this.d = "10.0.0.172";
                this.c = "80";
                return true;
            }
            if ("ctwap".equalsIgnoreCase(extraInfo)) {
                this.f = 2;
                this.d = "10.0.0.200";
                this.c = "80";
                return true;
            }
            this.f = 3;
        }
        return false;
    }

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

    public String a() {
        return this.d;
    }

    public String b() {
        return this.c;
    }

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