笔 趣 阁 破 解 版2023 v4.18.00版本的 MD5 值为:35c48a89f5572ff5a659afd7c5a81cad
以下内容为反编译后的 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 androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.anythink.basead.b.a;
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.NetworkUtil;
import com.efs.sdk.base.core.util.PackageUtil;
import com.efs.sdk.base.core.util.d;
import com.efs.sdk.base.core.util.e;
import com.efs.sdk.base.core.util.f;
import com.efs.sdk.base.http.HttpResponse;
import com.efs.sdk.base.protocol.ILogProtocol;
import com.kwad.components.offline.api.tk.model.report.TKDownloadReason;
import com.kwad.sdk.core.imageloader.utils.MemoryCacheUtils;
import com.umeng.umcrash.UMCrash;
import java.io.File;
import java.util.HashMap;
import java.util.Locale;
import java.util.TimeZone;
public class ControllerCenter implements Handler.Callback {
public static GlobalEnvStruct h;
public int f7198a = 0;
public final int f7199b = 0;
public final int f7200c = 1;
public final int f7201d = 2;
public final int e = 3;
public volatile boolean f = false;
public a g;
public Handler i;
public ControllerCenter(EfsReporter.Builder builder) {
h = builder.getGlobalEnvStruct();
Handler handler = new Handler(com.efs.sdk.base.core.util.a.a.f7245a.getLooper(), this);
this.i = handler;
handler.sendEmptyMessage(0);
}
private void a() {
if (this.g == null) {
this.g = new a();
}
try {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE");
h.mAppContext.registerReceiver(this.g, intentFilter);
} catch (Throwable th) {
d.a("efs.base", "register network change receiver error", th);
int i = this.f7198a + 1;
this.f7198a = i;
if (i < 3) {
this.i.sendEmptyMessageDelayed(3, 6000L);
}
}
}
private void b(final ILogProtocol iLogProtocol) {
if (iLogProtocol == null) {
return;
}
com.efs.sdk.base.core.util.a.d.a(new Runnable() {
@Override
public final void run() {
try {
iLogProtocol.insertGlobal(b.a.a().f7195a);
if (!"wa".equalsIgnoreCase(iLogProtocol.getLogType())) {
ControllerCenter.a(iLogProtocol);
}
if (ControllerCenter.getGlobalEnvStruct().isEnableSendLog()) {
final com.efs.sdk.base.core.d.b a2 = com.efs.sdk.base.core.d.b.a(iLogProtocol);
final com.efs.sdk.base.core.e.d a3 = d.a.a();
com.efs.sdk.base.core.util.a.d.a(new Runnable() {
@Override
public final void run() {
a3.f7218a.a(a2);
}
});
}
} catch (Throwable th) {
com.efs.sdk.base.core.util.d.b("efs.base", "log send error", th);
}
}
});
}
@NonNull
public static GlobalEnvStruct getGlobalEnvStruct() {
return h;
}
@Override
public boolean handleMessage(@NonNull Message message) {
int i = message.what;
if (i == 0) {
b a2 = b.a.a();
com.efs.sdk.base.core.config.a aVar = new com.efs.sdk.base.core.config.a();
a2.f7195a = aVar;
aVar.a("appid", getGlobalEnvStruct().getAppid());
int a3 = e.a();
a2.f7195a.a(com.anythink.expressad.d.a.b.aB, Integer.valueOf(a3));
a2.f7195a.a("ps", e.a(a3));
String a4 = f.a(a2.f7196b);
a2.f7195a.a("wid", a4);
if (TextUtils.isEmpty(getGlobalEnvStruct().getUid())) {
a2.f7195a.a("uid", a4);
} else {
a2.f7195a.a("uid", getGlobalEnvStruct().getUid());
}
com.efs.sdk.base.core.config.a aVar2 = a2.f7195a;
com.efs.sdk.base.core.a.a.a();
aVar2.a("stime", Long.valueOf(com.efs.sdk.base.core.a.a.b() - Process.getElapsedCpuTime()));
a2.f7195a.a(a.C0133a.A, PackageUtil.getPackageName(a2.f7196b));
a2.f7195a.a("ver", PackageUtil.getAppVersionName(a2.f7196b));
a2.f7195a.a("vcode", PackageUtil.getAppVersionCode(a2.f7196b));
a2.f7195a.a("sdk_ver", BuildConfig.VERSION_NAME);
a2.f7195a.a("brand", Build.BRAND.toLowerCase());
com.efs.sdk.base.core.config.a aVar3 = a2.f7195a;
String str = Build.MODEL;
aVar3.a("model", str == null ? "unknown" : str.replace(" ", "-").replace(MemoryCacheUtils.URI_AND_SIZE_SEPARATOR, "-").toLowerCase());
a2.f7195a.a("build_model", Build.MODEL);
DisplayMetrics displayMetrics = a2.f7196b.getResources().getDisplayMetrics();
a2.f7195a.a("dsp_w", Integer.valueOf(displayMetrics.widthPixels));
a2.f7195a.a("dsp_h", Integer.valueOf(displayMetrics.heightPixels));
a2.f7195a.a(com.anythink.expressad.video.dynview.a.a.Q, b.c.a.n.m.e.e.f2232b);
a2.f7195a.a("rom", Build.VERSION.RELEASE);
a2.f7195a.a("sdk", Integer.valueOf(Build.VERSION.SDK_INT));
a2.f7195a.a("lang", Locale.getDefault().getLanguage());
a2.f7195a.a("tzone", TimeZone.getDefault().getID());
a2.f7195a.a(TKDownloadReason.KSAD_TK_NET, NetworkUtil.getNetworkType(a2.f7196b));
try {
String[] networkAccessMode = NetworkUtil.getNetworkAccessMode(a2.f7196b);
if ("Wi-Fi".equals(networkAccessMode[0])) {
a2.f7195a.a(UMCrash.KEY_HEADER_ACCESS, NetworkUtil.NETWORK_TYPE_WIFI);
} else if ("2G/3G".equals(networkAccessMode[0])) {
a2.f7195a.a(UMCrash.KEY_HEADER_ACCESS, "2G/3G");
} else {
a2.f7195a.a(UMCrash.KEY_HEADER_ACCESS, "unknow");
}
if (!"".equals(networkAccessMode[1])) {
a2.f7195a.a(UMCrash.KEY_HEADER_ACCESS_SUBTYPE, networkAccessMode[1]);
}
a2.f7195a.a(UMCrash.KEY_HEADER_NETWORK_TYPE, Integer.valueOf(NetworkUtil.getNetworkTypeUmeng(a2.f7196b)));
} catch (Throwable th) {
th.printStackTrace();
}
f.a.a();
c.a().b();
a();
com.efs.sdk.base.core.f.f a5 = f.a.a();
boolean isIntl = h.isIntl();
com.efs.sdk.base.core.f.c cVar = a5.f7233a;
if (isIntl) {
cVar.f7227a = "https://errlogos.umeng.com/api/crashsdk/logcollect";
cVar.f7228b = "4ea4e41a3993";
} else {
cVar.f7227a = "https://errlog.umeng.com/api/crashsdk/logcollect";
cVar.f7228b = "28ef1713347d";
}
a5.f7234b = this;
a5.f7235c.f7222a = this;
a5.f7236d.f7222a = this;
this.f = true;
com.efs.sdk.base.core.c.d.a().sendEmptyMessageDelayed(0, h.getLogSendDelayMills());
com.efs.sdk.base.core.f.f a6 = f.a.a();
if (a6.f7234b != null && getGlobalEnvStruct().isEnableWaStat()) {
a6.f7234b.send(new com.efs.sdk.base.core.f.b("efs_core", "pvuv", a6.f7233a.f7229c));
}
} 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 void send(ILogProtocol iLogProtocol) {
if (!this.f) {
Message obtain = Message.obtain();
obtain.what = 1;
obtain.obj = iLogProtocol;
this.i.sendMessage(obtain);
return;
}
b(iLogProtocol);
}
@Nullable
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.f7211d = file;
bVar.a(str2);
bVar.a(i);
bVar.f7209b.f7213b = z;
bVar.c();
d.a.a().f7218a.a(bVar);
return bVar.f7209b.f7214c;
}
public 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();
}
}
}