百度手机卫士 v5.12.0版本的 MD5 值为:e6b73ca73976681820201475f735614c

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


package dxoptimizer;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import cn.opda.a.phonoalbumshoushou.R;
import com.dianxinos.optimizer.module.billguard.billinfo.parse.DataInfo;
import com.dianxinos.optimizer.utils.DxHttpClient;
import com.quickbird.mini.utils.Constants;
import com.quickbird.sdk.internal.HttpsClient;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import org.apache.http.client.utils.URIUtils;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class cep {
    public static boolean a(Context context) {
        String o = gsg.o(context);
        boolean z = !TextUtils.isEmpty(o);
        if (z) {
            try {
                cdx.g(context, new JSONObject(o).getJSONObject(DataInfo.ZH).toString());
            } catch (JSONException e) {
            }
        }
        return z;
    }

    public static boolean b(Context context) {
        boolean z = false;
        long currentTimeMillis = System.currentTimeMillis();
        if (hcw.a(context) != -1) {
            String str = null;
            try {
                hey.a(4615);
                str = hcm.a(context, gsp.c);
                hcf hcfVar = new hcf();
                JSONObject a = hcfVar.a(str);
                if (hcfVar.a()) {
                    cdx.f(context, a.getJSONArray("topKeys").toString());
                    cdx.e(context, currentTimeMillis);
                    cdx.b(context, currentTimeMillis);
                    z = true;
                    hey.a();
                } else {
                    hcq.c("QuickHelperUtils", "bad response: " + str);
                }
            } catch (DxHttpClient.HttpStatusException e) {
                int statusCode = e.getStatusCode();
                if (statusCode == 304) {
                    cdx.e(context, currentTimeMillis);
                } else {
                    hcq.c("QuickHelperUtils", "Unexpected http status exception: " + statusCode);
                }
            } catch (IOException e2) {
                hcq.a("QuickHelperUtils", "Unexpected excetpion", e2);
            } catch (JSONException e3) {
                hcq.a("QuickHelperUtils", "Bad response: " + str, e3);
            } finally {
                hey.a();
            }
        }
        return z;
    }

    private static String f(Context context) {
        String r = cdx.r(context);
        if (r != null) {
            try {
                return new JSONObject(r).getString("homeurl");
            } catch (JSONException e) {
            }
        }
        return "http://dxurl.cn/own/yhds/hao123";
    }

    private static boolean g(Context context) {
        String r = cdx.r(context);
        if (r != null) {
            try {
                return new JSONObject(r).getBoolean("oemsearchbox");
            } catch (JSONException e) {
            }
        }
        return false;
    }

    public static ArrayList c(Context context) {
        ArrayList arrayList = new ArrayList();
        String o = cdx.o(context);
        if (TextUtils.isEmpty(o)) {
            arrayList.add(context.getString(R.string.fw_default_search_hotword));
        } else {
            try {
                JSONArray jSONArray = new JSONArray(o);
                for (int i = 0; i < jSONArray.length(); i++) {
                    arrayList.add(jSONArray.getString(i));
                }
                if (arrayList.size() == 0) {
                    arrayList.add(context.getString(R.string.fw_default_search_hotword));
                }
            } catch (JSONException e) {
                arrayList.add(context.getString(R.string.fw_default_search_hotword));
            }
        }
        return arrayList;
    }

    public static boolean d(Context context) {
        PackageManager packageManager = context.getPackageManager();
        if (packageManager == null) {
            return false;
        }
        Intent intent = new Intent("com.baidu.searchbox.action.SEARCH");
        if (!g(context)) {
            intent.setPackage("com.baidu.searchbox");
        }
        return packageManager.resolveActivity(intent, 65536) != null;
    }

    public static void a(Context context, String str, boolean z) {
        Intent intent = new Intent("com.baidu.searchbox.action.SEARCH");
        if (!g(context)) {
            intent.setPackage("com.baidu.searchbox");
        }
        intent.addCategory("android.intent.category.DEFAULT");
        intent.addFlags(268435456);
        intent.putExtra("key_value", str);
        intent.putExtra("EXTRA_URL_NEW_WINDOW", z);
        intent.putExtra("search_source", "guard_ floatview_assign");
        context.startActivity(intent);
    }

    public static void a(Context context, String str) {
        if (TextUtils.isEmpty(str)) {
            Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(f(context)));
            intent.putExtra("com.android.browser.application_id", context.getPackageName());
            intent.addFlags(268435456);
            if (hco.a(context, intent)) {
                context.startActivity(intent);
                return;
            } else {
                gzs.b(context, context.getString(R.string.fw_uninstalled_baidusearchbox_and_browse), 1);
                return;
            }
        }
        try {
            URI uri = new URI("http://ak.dxsvr.com/rts/rd");
            ArrayList arrayList = new ArrayList();
            arrayList.add(new BasicNameValuePair("url", "http://m.baidu.com/s?from=1003582z&word=" + str));
            Intent intent2 = new Intent("android.intent.action.VIEW", Uri.parse(URIUtils.createURI(uri.getScheme(), uri.getHost(), uri.getPort(), uri.getPath(), URLEncodedUtils.format(arrayList, HttpsClient.HTTP_CHARSET), null).toString()));
            intent2.putExtra("com.android.browser.application_id", context.getPackageName());
            intent2.addFlags(268435456);
            if (hco.a(context, intent2)) {
                context.startActivity(intent2);
            } else {
                gzs.b(context, context.getString(R.string.fw_uninstalled_baidusearchbox_and_browse), 1);
            }
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
    }

    public static void b(Context context, String str) {
        if (!TextUtils.isEmpty(str)) {
            try {
                if (d(context)) {
                    URI uri = new URI("http://ak.dxsvr.com/rts/rd");
                    ArrayList arrayList = new ArrayList();
                    arrayList.add(new BasicNameValuePair("url", str));
                    Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(URIUtils.createURI(uri.getScheme(), uri.getHost(), uri.getPort(), uri.getPath(), URLEncodedUtils.format(arrayList, HttpsClient.HTTP_CHARSET), null).toString()));
                    intent.putExtra("com.android.browser.application_id", context.getPackageName());
                    if (!g(context)) {
                        intent.setPackage("com.baidu.searchbox");
                    }
                    intent.addFlags(268435456);
                    context.startActivity(intent);
                    return;
                }
                Intent intent2 = new Intent("android.intent.action.VIEW", Uri.parse(str));
                intent2.addFlags(268435456);
                context.startActivity(intent2);
            } catch (Exception e) {
                Toast.makeText(context, context.getString(R.string.bankdetail_paysecurity_dialog_web_error), 0).show();
            }
        }
    }

    public static void e(Context context) {
        a(context, false, true);
    }

    public static void a(Context context, boolean z, boolean z2) {
        if (cdx.n(context) == 0 && z2 && !z) {
            hcg.a(context, "com.dianxinos.optimizer.action.ALARM_EVENT_QUICKHELPER_PULL_HOMEPAGE_URL", System.currentTimeMillis() + Constants.MINUTE_MS);
            return;
        }
        int s = cdx.s(context);
        if (z && s < 3) {
            hcg.a(context, "com.dianxinos.optimizer.action.ALARM_EVENT_QUICKHELPER_PULL_HOMEPAGE_URL", System.currentTimeMillis() + 3600000);
            cdx.f(context, s + 1);
        } else {
            hcg.a(context, "com.dianxinos.optimizer.action.ALARM_EVENT_QUICKHELPER_PULL_HOMEPAGE_URL", System.currentTimeMillis() + 86400000);
            cdx.f(context, 0);
        }
    }

    public static Toast a(int i) {
        Context a = hau.a();
        View inflate = ((LayoutInflater) a.getSystemService("layout_inflater")).inflate(R.layout.quick_helper_process_checker_toast, (ViewGroup) null);
        Toast toast = new Toast(a);
        ((TextView) inflate.findViewById(R.id.process_toast_message)).setText(a.getString(i));
        toast.setGravity(17, 0, 0);
        toast.setDuration(1);
        toast.setView(inflate);
        hau.a(new ceq(toast));
        return toast;
    }
}