西瓜看球 v2.9.13版本的 MD5 值为:755288f3c36852638c41cf20ae0d004e

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


package com.efs.sdk.base.core.controller;

import android.content.IntentFilter;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.os.Process;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Pair;
import android.webkit.ValueCallback;
import com.efs.sdk.base.BuildConfig;
import com.efs.sdk.base.EfsReporter;
import com.efs.sdk.base.core.c.f;
import com.efs.sdk.base.core.config.GlobalEnvStruct;
import com.efs.sdk.base.core.config.a.c;
import com.efs.sdk.base.core.config.b;
import com.efs.sdk.base.core.controller.a.a;
import com.efs.sdk.base.core.e.d;
import com.efs.sdk.base.core.f.f;
import com.efs.sdk.base.core.util.Log;
import com.efs.sdk.base.core.util.NetworkUtil;
import com.efs.sdk.base.core.util.PackageUtil;
import com.efs.sdk.base.core.util.ProcessUtil;
import com.efs.sdk.base.core.util.concurrent.WorkThreadUtil;
import com.efs.sdk.base.core.util.d;
import com.efs.sdk.base.http.HttpResponse;
import com.efs.sdk.base.protocol.ILogProtocol;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import com.umeng.umcrash.UMCrash;
import com.xiaomi.mipush.sdk.Constants;
import io.dcloud.common.constant.AbsoluteConst;
import io.dcloud.common.util.net.NetCheckReceiver;
import java.io.File;
import java.util.HashMap;
import java.util.Locale;
import java.util.TimeZone;
public class ControllerCenter implements Handler.Callback {
    private static GlobalEnvStruct h;
    private int a = 0;
    private final int b = 0;
    private final int c = 1;
    private final int d = 2;
    private final int e = 3;
    private volatile boolean f = false;
    private a g;
    private Handler i;

    public ControllerCenter(EfsReporter.Builder builder) {
        h = builder.getGlobalEnvStruct();
        Handler handler = new Handler(com.efs.sdk.base.core.util.concurrent.a.a.getLooper(), this);
        this.i = handler;
        handler.sendEmptyMessage(0);
    }

    @Override
    public boolean handleMessage(Message message) {
        int i = message.what;
        if (i == 0) {
            b a = b.a.a();
            Log.e("ballack", "initGlobalInfo called once.");
            a.a = new com.efs.sdk.base.core.config.a();
            a.a.a("appid", getGlobalEnvStruct().getAppid());
            int myPid = ProcessUtil.myPid();
            a.a.a("pid", Integer.valueOf(myPid));
            a.a.a("ps", ProcessUtil.getProcessName(myPid));
            String a2 = d.a(a.b);
            a.a.a("wid", a2);
            if (TextUtils.isEmpty(getGlobalEnvStruct().getUid())) {
                a.a.a("uid", a2);
            } else {
                a.a.a("uid", getGlobalEnvStruct().getUid());
            }
            com.efs.sdk.base.core.config.a aVar = a.a;
            com.efs.sdk.base.core.a.a.a();
            aVar.a("stime", Long.valueOf(com.efs.sdk.base.core.a.a.b() - Process.getElapsedCpuTime()));
            a.a.a("pkg", PackageUtil.getPackageName(a.b));
            a.a.a("ver", PackageUtil.getAppVersionName(a.b));
            a.a.a("vcode", PackageUtil.getAppVersionCode(a.b));
            a.a.a(HiAnalyticsConstant.BI_KEY_SDK_VER, BuildConfig.VERSION_NAME);
            a.a.a(Constants.PHONE_BRAND, Build.BRAND.toLowerCase());
            a.a.a("model", Build.MODEL == null ? "unknown" : Build.MODEL.replace(" ", "-").replace("_", "-").toLowerCase());
            a.a.a("build_model", Build.MODEL);
            DisplayMetrics displayMetrics = a.b.getResources().getDisplayMetrics();
            a.a.a("dsp_w", Integer.valueOf(displayMetrics.widthPixels));
            a.a.a("dsp_h", Integer.valueOf(displayMetrics.heightPixels));
            a.a.a("fr", "android");
            a.a.a("rom", Build.VERSION.RELEASE);
            a.a.a(com.umeng.ccg.a.o, Integer.valueOf(Build.VERSION.SDK_INT));
            a.a.a(AbsoluteConst.JSON_KEY_LANG, Locale.getDefault().getLanguage());
            a.a.a("tzone", TimeZone.getDefault().getID());
            a.a.a("net", NetworkUtil.getNetworkType(a.b));
            try {
                String[] networkAccessMode = NetworkUtil.getNetworkAccessMode(a.b);
                if ("Wi-Fi".equals(networkAccessMode[0])) {
                    a.a.a(UMCrash.KEY_HEADER_ACCESS, "wifi");
                } else if ("2G/3G".equals(networkAccessMode[0])) {
                    a.a.a(UMCrash.KEY_HEADER_ACCESS, "2G/3G");
                } else {
                    a.a.a(UMCrash.KEY_HEADER_ACCESS, "unknow");
                }
                if (!"".equals(networkAccessMode[1])) {
                    a.a.a(UMCrash.KEY_HEADER_ACCESS_SUBTYPE, networkAccessMode[1]);
                }
                a.a.a(UMCrash.KEY_HEADER_NETWORK_TYPE, Integer.valueOf(NetworkUtil.getNetworkTypeUmeng(a.b)));
            } catch (Throwable th) {
                th.printStackTrace();
            }
            f.a.a();
            c.a().b();
            a();
            com.efs.sdk.base.core.f.f a3 = f.a.a();
            boolean isIntl = h.isIntl();
            com.efs.sdk.base.core.f.c cVar = a3.a;
            if (isIntl) {
                cVar.a = "https://errnewlogos.umeng.com/api/crashsdk/logcollect";
                cVar.b = "4ea4e41a3993";
            } else {
                cVar.a = "https://errnewlog.umeng.com/api/crashsdk/logcollect";
                cVar.b = "28ef1713347d";
            }
            a3.b = this;
            a3.c.a = a3.b;
            a3.d.a = a3.b;
            this.f = true;
            com.efs.sdk.base.core.c.d.a().sendEmptyMessageDelayed(0, h.getLogSendDelayMills());
            com.efs.sdk.base.core.f.f a4 = f.a.a();
            if (a4.b != null && getGlobalEnvStruct().isEnableWaStat()) {
                a4.b.send(new com.efs.sdk.base.core.f.b("efs_core", "pvuv", a4.a.c));
            }
        } else if (i == 1) {
            Object obj = message.obj;
            if (obj != null && (obj instanceof ILogProtocol)) {
                b((ILogProtocol) obj);
            }
        } else if (i == 3) {
            a();
        }
        return true;
    }

    public static GlobalEnvStruct getGlobalEnvStruct() {
        return h;
    }

    private void a() {
        if (this.g == null) {
            this.g = new a();
        }
        try {
            IntentFilter intentFilter = new IntentFilter();
            intentFilter.addAction(NetCheckReceiver.netACTION);
            h.mAppContext.registerReceiver(this.g, intentFilter);
        } catch (Throwable th) {
            Log.w("efs.base", "register network change receiver error", th);
            int i = this.a + 1;
            this.a = i;
            if (i < 3) {
                this.i.sendEmptyMessageDelayed(3, 6000L);
            }
        }
    }

    public void send(ILogProtocol iLogProtocol) {
        if (!this.f) {
            Message obtain = Message.obtain();
            obtain.what = 1;
            obtain.obj = iLogProtocol;
            this.i.sendMessage(obtain);
            return;
        }
        b(iLogProtocol);
    }

    private void b(final ILogProtocol iLogProtocol) {
        if (iLogProtocol == null) {
            return;
        }
        WorkThreadUtil.submit(new Runnable() {
            @Override
            public final void run() {
                try {
                    iLogProtocol.insertGlobal(b.a.a().a());
                    if (!"wa".equalsIgnoreCase(iLogProtocol.getLogType())) {
                        ControllerCenter.a(iLogProtocol);
                    }
                    if (ControllerCenter.getGlobalEnvStruct().isEnableSendLog()) {
                        final com.efs.sdk.base.core.d.b a = com.efs.sdk.base.core.d.b.a(iLogProtocol);
                        final com.efs.sdk.base.core.e.d a2 = d.a.a();
                        WorkThreadUtil.submit(new Runnable() {
                            @Override
                            public final void run() {
                                a2.a.a(a);
                            }
                        });
                    }
                } catch (Throwable th) {
                    Log.e("efs.base", "log send error", th);
                }
            }
        });
    }

    public HttpResponse sendSyncImmediately(String str, int i, String str2, boolean z, File file) {
        com.efs.sdk.base.core.d.b bVar = new com.efs.sdk.base.core.d.b(str, (byte) 2);
        bVar.b(1);
        bVar.d = file;
        bVar.a(str2);
        bVar.a(i);
        bVar.b.b = z;
        bVar.c();
        d.a.a().a.a(bVar);
        return bVar.b.c;
    }

    static void a(ILogProtocol iLogProtocol) {
        for (ValueCallback<Pair<Message, Message>> valueCallback : getGlobalEnvStruct().getCallback(9)) {
            HashMap hashMap = new HashMap(4);
            hashMap.put("log_type", iLogProtocol.getLogType());
            hashMap.put("log_data", iLogProtocol.generateString());
            hashMap.put("link_key", iLogProtocol.getLinkKey());
            hashMap.put("link_id", iLogProtocol.getLinkId());
            Message obtain = Message.obtain(null, 9, hashMap);
            Message obtain2 = Message.obtain();
            valueCallback.onReceiveValue(new Pair<>(obtain, obtain2));
            obtain.recycle();
            obtain2.recycle();
        }
    }
}