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

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


package com.cx.module.launcher.ui;

import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.os.Process;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.view.View;
import android.webkit.WebView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import com.cx.base.CXApplication;
import com.cx.base.h.w;
import com.cx.module.data.apk.ah;
import com.cx.module.launcher.p;
import com.cx.module.launcher.q;
import com.cx.module.launcher.ui.a.j;
import com.cx.module.launcher.ui.a.k;
import com.cx.module.launcher.ui.a.l;
import com.cx.tools.e.e;
import com.cx.tools.i.f;
import com.tencent.stat.DeviceInfo;
import com.umeng.socialize.net.utils.SocializeProtocolConstants;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import org.apache.http.HttpHost;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class NearbyHotActivity extends BaseBrowserActivity implements k {
    public static String g = "type";
    private List h = new ArrayList();
    private TextView i;
    private ImageView j;
    private ImageButton k;
    private j l;

    private boolean b(String str) {
        return (TextUtils.isEmpty(str) || str.endsWith("isPressBack") || this.l.b(str) || (!str.startsWith(HttpHost.DEFAULT_SCHEME_NAME) && !str.startsWith("https")) || str.contains(".alipay.com")) ? false : true;
    }

    @Override
    public int a() {
        com.cx.tools.e.a.b("webview", "method --> 1");
        return 1;
    }

    @Override
    public void a(WebView webView, int i, String str, String str2) {
        if (isFinishing()) {
            return;
        }
        a("file:///android_asset/error/error.html");
    }

    @Override
    public void a(WebView webView, String str, Bitmap bitmap) {
        super.a(webView, str, bitmap);
        if (isFinishing()) {
        }
    }

    @Override
    public boolean a(WebView webView, String str) {
        com.cx.tools.e.a.c("jscall", str);
        if (TextUtils.isEmpty(str) || str.length() < "addPlan://".length()) {
            a(str);
        } else if ("addPlan://".equalsIgnoreCase(str.substring(0, "addPlan://".length()))) {
            l a2 = this.f.a(str);
            if (a2 instanceof com.cx.module.launcher.ui.a.a) {
                this.h.add((com.cx.module.launcher.ui.a.a) a2);
            }
        } else {
            a(str);
        }
        if (!b(str)) {
            return true;
        }
        this.l.a(str);
        return true;
    }

    @Override
    public String b() {
        com.cx.tools.e.a.b("webview", "url --> " + com.cx.base.b.c.l);
        return com.cx.base.b.c.l;
    }

    @Override
    public void b(WebView webView, String str) {
        super.b(webView, str);
        if (isFinishing()) {
            return;
        }
        if (b(str)) {
            this.l.a(str);
        }
        this.f3958c.loadUrl("javascript:getPageShowAppList()");
    }

    @Override
    public HashMap c() {
        HashMap hashMap = new HashMap();
        hashMap.put("lang", Locale.CHINESE.getLanguage());
        hashMap.put(DeviceInfo.TAG_VERSION, String.valueOf(com.cx.module.launcher.e.d.c(this)));
        if (com.cx.tools.i.k.a(com.cx.tools.d.c.f4596a)) {
            hashMap.put("usr", "0");
        } else {
            hashMap.put("usr", com.cx.tools.d.c.f4596a);
        }
        hashMap.put("pkg", getPackageName());
        hashMap.put("grp", f.a(this));
        TelephonyManager telephonyManager = (TelephonyManager) getSystemService("phone");
        hashMap.put(SocializeProtocolConstants.PROTOCOL_KEY_IMEI, telephonyManager.getDeviceId());
        hashMap.put("imsi", telephonyManager.getSubscriberId());
        hashMap.put("os_version", String.valueOf(Build.VERSION.SDK_INT));
        hashMap.put("brand", Build.BRAND);
        hashMap.put("model", Build.MODEL);
        hashMap.put("resolution", getResources().getDisplayMetrics().heightPixels + "X" + getResources().getDisplayMetrics().widthPixels);
        hashMap.put(SocializeProtocolConstants.PROTOCOL_KEY_MAC, w.a(this));
        JSONObject jSONObject = new JSONObject();
        JSONArray jSONArray = new JSONArray();
        List g2 = com.cx.module.data.apk.k.a(getApplicationContext()).g();
        List d = ah.a(getApplicationContext()).d();
        if (g2 != null) {
            int size = g2.size();
            for (int i = 0; i < size; i++) {
                com.cx.module.data.d.a aVar = (com.cx.module.data.d.a) g2.get(i);
                if (aVar != null) {
                    JSONObject jSONObject2 = new JSONObject();
                    try {
                        jSONObject2.put("pkg_name", aVar.E());
                        jSONObject2.put("ver_code", aVar.F());
                        jSONObject2.put("state", 0);
                        jSONArray.put(jSONObject2);
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
        if (d != null) {
            int size2 = d.size();
            for (int i2 = 0; i2 < size2; i2++) {
                com.cx.module.data.d.a aVar2 = (com.cx.module.data.d.a) d.get(i2);
                if (aVar2 != null) {
                    JSONObject jSONObject3 = new JSONObject();
                    try {
                        jSONObject3.put("pkg_name", aVar2.E());
                        jSONObject3.put("ver_code", aVar2.F());
                        jSONObject3.put("state", 0);
                        jSONArray.put(jSONObject3);
                    } catch (JSONException e2) {
                        e2.printStackTrace();
                    }
                }
            }
        }
        try {
            jSONObject.put("list", jSONArray);
        } catch (JSONException e3) {
            e3.printStackTrace();
        }
        hashMap.put("jsondata", jSONObject.toString());
        com.cx.tools.e.a.b("webview", "params --> " + hashMap);
        return hashMap;
    }

    @Override
    public void c(WebView webView, String str) {
        if (TextUtils.isEmpty(str) || "找不到网页".equalsIgnoreCase(str)) {
            return;
        }
        if (str.length() > 8) {
            this.i.setText(str.substring(0, 8) + "...");
        } else {
            this.i.setText(str);
        }
    }

    @Override
    public int f() {
        return q.lau_mo_snapshot_activity;
    }

    @Override
    public void g() {
        super.g();
        this.i = (TextView) findViewById(p.head_title_txt);
        this.j = (ImageView) findViewById(p.back_btn_goback);
        this.k = (ImageButton) findViewById(p.ib_download);
        this.k.setVisibility(8);
        this.l = new j();
        this.l.a(this);
    }

    public void goBack(View view) {
        String packageName = getPackageName();
        e.a("click-event", new String[]{"one-goback-arrow", "pkg", "page"}, new String[]{packageName, packageName, NearbyHotActivity.class.getSimpleName()});
        k();
    }

    public void gotoDownloadTask(View view) {
        String packageName = getPackageName();
        e.a("click-event", new String[]{"one-download-open", "pkg", "page"}, new String[]{packageName, packageName, NearbyHotActivity.class.getSimpleName()});
        startActivity(new Intent("com.cx.huanji.DownloadTask"));
    }

    @Override
    public int h() {
        return 2;
    }

    public void k() {
        if (this.l.a() <= 0) {
            finish();
            return;
        }
        try {
            this.l.a(this.l.a() - 1);
            int a2 = this.l.a() - 1;
            if (a2 < 0) {
                finish();
            }
            if (a2 != 0) {
                String b2 = this.l.b(a2);
                a(b2.contains("?") ? b2 + "&isPressBack" : b2 + "?isPressBack");
            } else {
                String b3 = b();
                this.f3958c.postUrl(b3.contains("?") ? b3 + "&isPressBack" : b3 + "?isPressBack", a(c()).getBytes());
            }
        } catch (Exception e) {
            finish();
        }
    }

    @Override
    public void l() {
        if (this.l == null || this.l.a() <= 1) {
            this.j.setVisibility(8);
        } else {
            this.j.setVisibility(0);
        }
    }

    public void m() {
        if (this.h != null) {
            for (com.cx.module.launcher.ui.a.a aVar : this.h) {
                if (aVar != null) {
                    aVar.f();
                }
            }
        }
    }

    @Override
    public void onBackPressed() {
        String packageName = getPackageName();
        e.a("click-event", new String[]{"one-goback-physical", "pkg", "page"}, new String[]{packageName, packageName, NearbyHotActivity.class.getSimpleName()});
        k();
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        if (CXApplication.f998b == null) {
            com.cx.tools.e.a.d(this.f995a, "onCreate check application is null.");
            Process.killProcess(Process.myPid());
        }
        if (getIntent().getIntExtra(g, 0) != 1) {
            com.cx.base.h.c.a("MoreCut", "Launcher");
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }

    @Override
    public void onResume() {
        super.onResume();
        m();
        if (this.h != null) {
            Iterator it = this.h.iterator();
            while (it.hasNext()) {
                ((com.cx.module.launcher.ui.a.a) it.next()).e();
            }
        }
    }

    @Override
    protected void onStart() {
        super.onStart();
        this.f3958c.loadUrl("javascript:getPageShowAppList()");
    }
}