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.a.d; import com.efs.sdk.base.core.util.e; import com.efs.sdk.base.http.HttpResponse; import com.efs.sdk.base.protocol.ILogProtocol; 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 { private static GlobalEnvStruct h; private int a = 0; private final int b = 0; /* renamed from: c reason: collision with root package name */ private final int f1770c = 1; /* renamed from: d reason: collision with root package name */ private final int f1771d = 2; /* renamed from: e reason: collision with root package name */ private final int f1772e = 3; /* renamed from: f reason: collision with root package name */ private volatile boolean f1773f = false; /* renamed from: g reason: collision with root package name */ private a f1774g; private Handler i; public ControllerCenter(EfsReporter.Builder builder) { h = builder.getGlobalEnvStruct(); Handler handler = new Handler(com.efs.sdk.base.core.util.a.a.a.getLooper(), this); this.i = handler; handler.sendEmptyMessage(0); } private void a() { if (this.f1774g == null) { this.f1774g = new a(); } try { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE"); h.mAppContext.registerReceiver(this.f1774g, intentFilter); } catch (Throwable th) { Log.w("efs.base", "register network change receiver error", th); int i2 = this.a + 1; this.a = i2; if (i2 < 3) { this.i.sendEmptyMessageDelayed(3, 6000); } } } private void b(final ILogProtocol iLogProtocol) { if (iLogProtocol != null) { d.a(new Runnable() { /* class com.efs.sdk.base.core.controller.ControllerCenter.AnonymousClass1 */ public final void run() { try { iLogProtocol.insertGlobal(b.a.a().a); if (!"wa".equalsIgnoreCase(iLogProtocol.getLogType())) { ControllerCenter.a(iLogProtocol); } if (ControllerCenter.getGlobalEnvStruct().isEnableSendLog()) { d.a( /* JADX ERROR: Method code generation error jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x0038: INVOKE (wrap: com.efs.sdk.base.core.e.d$1 : 0x0035: CONSTRUCTOR (r2v1 com.efs.sdk.base.core.e.d$1) = (wrap: com.efs.sdk.base.core.e.d : 0x002f: INVOKE (r1v5 com.efs.sdk.base.core.e.d) = type: STATIC call: com.efs.sdk.base.core.e.d.a.a():com.efs.sdk.base.core.e.d) (wrap: com.efs.sdk.base.core.d.b : 0x002b: INVOKE (r0v7 com.efs.sdk.base.core.d.b) = (wrap: com.efs.sdk.base.protocol.ILogProtocol : 0x0029: IGET (r0v6 com.efs.sdk.base.protocol.ILogProtocol) = (r3v0 'this' com.efs.sdk.base.core.controller.ControllerCenter$1 A[IMMUTABLE_TYPE, THIS]) com.efs.sdk.base.core.controller.ControllerCenter.1.a com.efs.sdk.base.protocol.ILogProtocol) type: STATIC call: com.efs.sdk.base.core.d.b.a(com.efs.sdk.base.protocol.ILogProtocol):com.efs.sdk.base.core.d.b) call: com.efs.sdk.base.core.e.d.1.<init>(com.efs.sdk.base.core.e.d, com.efs.sdk.base.core.d.b):void type: CONSTRUCTOR) type: STATIC call: com.efs.sdk.base.core.util.a.d.a(java.lang.Runnable):java.util.concurrent.Future in method: com.efs.sdk.base.core.controller.ControllerCenter.1.run():void, file: classes.dex at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:255) at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:217) at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:110) at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:56) at jadx.core.codegen.RegionGen.makeSimpleRegion(RegionGen.java:93) at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:59) at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:99) at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:143) at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:63) at jadx.core.codegen.RegionGen.makeSimpleRegion(RegionGen.java:93) at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:59) at jadx.core.codegen.RegionGen.makeSimpleRegion(RegionGen.java:93) at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:59) at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:99) at jadx.core.codegen.RegionGen.makeTryCatch(RegionGen.java:306) at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:69) at jadx.core.codegen.RegionGen.makeSimpleRegion(RegionGen.java:93) at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:59) at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:244) at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:237) at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:342) at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:295) at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$2(ClassGen.java:264) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.util.ArrayList.forEach(ArrayList.java:1259) at java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:390) at java.util.stream.Sink$ChainedReference.end(Sink.java:258) Caused by: jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x0035: CONSTRUCTOR (r2v1 com.efs.sdk.base.core.e.d$1) = (wrap: com.efs.sdk.base.core.e.d : 0x002f: INVOKE (r1v5 com.efs.sdk.base.core.e.d) = type: STATIC call: com.efs.sdk.base.core.e.d.a.a():com.efs.sdk.base.core.e.d) (wrap: com.efs.sdk.base.core.d.b : 0x002b: INVOKE (r0v7 com.efs.sdk.base.core.d.b) = (wrap: com.efs.sdk.base.protocol.ILogProtocol : 0x0029: IGET (r0v6 com.efs.sdk.base.protocol.ILogProtocol) = (r3v0 'this' com.efs.sdk.base.core.controller.ControllerCenter$1 A[IMMUTABLE_TYPE, THIS]) com.efs.sdk.base.core.controller.ControllerCenter.1.a com.efs.sdk.base.protocol.ILogProtocol) type: STATIC call: com.efs.sdk.base.core.d.b.a(com.efs.sdk.base.protocol.ILogProtocol):com.efs.sdk.base.core.d.b) call: com.efs.sdk.base.core.e.d.1.<init>(com.efs.sdk.base.core.e.d, com.efs.sdk.base.core.d.b):void type: CONSTRUCTOR in method: com.efs.sdk.base.core.controller.ControllerCenter.1.run():void, file: classes.dex at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:255) at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:119) at jadx.core.codegen.InsnGen.addArg(InsnGen.java:103) at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:806) at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:746) at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:367) at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:249) ... 26 more Caused by: jadx.core.utils.exceptions.JadxRuntimeException: Expected class to be processed at this point, class: com.efs.sdk.base.core.e.d, state: GENERATED_AND_UNLOADED at jadx.core.dex.nodes.ClassNode.ensureProcessed(ClassNode.java:215) at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:630) at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:363) at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:230) ... 32 more */ /* this = this; com.efs.sdk.base.protocol.ILogProtocol r0 = r2 // Catch:{ all -> 0x003c } com.efs.sdk.base.core.config.b r1 = com.efs.sdk.base.core.config.b.a.a() // Catch:{ all -> 0x003c } com.efs.sdk.base.core.config.a r1 = r1.a // Catch:{ all -> 0x003c } r0.insertGlobal(r1) // Catch:{ all -> 0x003c } java.lang.String r0 = "wa" com.efs.sdk.base.protocol.ILogProtocol r1 = r2 // Catch:{ all -> 0x003c } java.lang.String r1 = r1.getLogType() // Catch:{ all -> 0x003c } boolean r0 = r0.equalsIgnoreCase(r1) // Catch:{ all -> 0x003c } if (r0 != 0) goto L_0x001e com.efs.sdk.base.protocol.ILogProtocol r0 = r2 // Catch:{ all -> 0x003c } com.efs.sdk.base.core.controller.ControllerCenter.a(r0) // Catch:{ all -> 0x003c } L_0x001e: com.efs.sdk.base.core.config.GlobalEnvStruct r0 = com.efs.sdk.base.core.controller.ControllerCenter.getGlobalEnvStruct() // Catch:{ all -> 0x003c } boolean r0 = r0.isEnableSendLog() // Catch:{ all -> 0x003c } if (r0 != 0) goto L_0x0029 return L_0x0029: com.efs.sdk.base.protocol.ILogProtocol r0 = r2 // Catch:{ all -> 0x003c } com.efs.sdk.base.core.d.b r0 = com.efs.sdk.base.core.d.b.a(r0) // Catch:{ all -> 0x003c } com.efs.sdk.base.core.e.d r1 = com.efs.sdk.base.core.e.d.a.a() // Catch:{ all -> 0x003c } com.efs.sdk.base.core.e.d$1 r2 = new com.efs.sdk.base.core.e.d$1 // Catch:{ all -> 0x003c } r2.<init>(r0) // Catch:{ all -> 0x003c } com.efs.sdk.base.core.util.a.d.a(r2) // Catch:{ all -> 0x003c } return L_0x003c: r0 = move-exception java.lang.String r1 = "efs.base" java.lang.String r2 = "log send error" com.efs.sdk.base.core.util.Log.e(r1, r2, r0) return */ throw new UnsupportedOperationException("Method not decompiled: com.efs.sdk.base.core.controller.ControllerCenter.AnonymousClass1.run():void"); } }); } } public static GlobalEnvStruct getGlobalEnvStruct() { return h; } public boolean handleMessage(Message message) { String str; int i2 = message.what; if (i2 == 0) { b a2 = b.a.a(); com.efs.sdk.base.core.config.a aVar = new com.efs.sdk.base.core.config.a(); a2.a = aVar; aVar.a("appid", getGlobalEnvStruct().getAppid()); int a3 = com.efs.sdk.base.core.util.d.a(); a2.a.a("pid", Integer.valueOf(a3)); a2.a.a("ps", com.efs.sdk.base.core.util.d.a(a3)); String a4 = e.a(a2.b); a2.a.a("wid", a4); if (TextUtils.isEmpty(getGlobalEnvStruct().getUid())) { a2.a.a("uid", a4); } else { a2.a.a("uid", getGlobalEnvStruct().getUid()); } com.efs.sdk.base.core.config.a aVar2 = a2.a; com.efs.sdk.base.core.a.a.a(); aVar2.a("stime", Long.valueOf(com.efs.sdk.base.core.a.a.b() - Process.getElapsedCpuTime())); a2.a.a("pkg", PackageUtil.getPackageName(a2.b)); a2.a.a("ver", PackageUtil.getAppVersionName(a2.b)); a2.a.a("vcode", PackageUtil.getAppVersionCode(a2.b)); a2.a.a("sdk_ver", BuildConfig.VERSION_NAME); a2.a.a("brand", Build.BRAND.toLowerCase()); com.efs.sdk.base.core.config.a aVar3 = a2.a; String str2 = Build.MODEL; if (str2 == null) { str = NetworkUtil.NETWORK_CLASS_UNKNOWN; } else { str = str2.replace(" ", "-").replace("_", "-").toLowerCase(); } aVar3.a("model", str); a2.a.a("build_model", str2); DisplayMetrics displayMetrics = a2.b.getResources().getDisplayMetrics(); a2.a.a("dsp_w", Integer.valueOf(displayMetrics.widthPixels)); a2.a.a("dsp_h", Integer.valueOf(displayMetrics.heightPixels)); a2.a.a("fr", "android"); a2.a.a("rom", Build.VERSION.RELEASE); a2.a.a("sdk", Integer.valueOf(Build.VERSION.SDK_INT)); a2.a.a("lang", Locale.getDefault().getLanguage()); a2.a.a("tzone", TimeZone.getDefault().getID()); a2.a.a("net", NetworkUtil.getNetworkType(a2.b)); try { String[] networkAccessMode = NetworkUtil.getNetworkAccessMode(a2.b); if ("Wi-Fi".equals(networkAccessMode[0])) { a2.a.a(UMCrash.KEY_HEADER_ACCESS, NetworkUtil.NETWORK_TYPE_WIFI); } else if ("2G/3G".equals(networkAccessMode[0])) { a2.a.a(UMCrash.KEY_HEADER_ACCESS, "2G/3G"); } else { a2.a.a(UMCrash.KEY_HEADER_ACCESS, "unknow"); } if (!"".equals(networkAccessMode[1])) { a2.a.a(UMCrash.KEY_HEADER_ACCESS_SUBTYPE, networkAccessMode[1]); } a2.a.a(UMCrash.KEY_HEADER_NETWORK_TYPE, Integer.valueOf(NetworkUtil.getNetworkTypeUmeng(a2.b))); } 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.a; if (isIntl) { cVar.a = "https://errlogos.umeng.com/api/crashsdk/logcollect"; cVar.b = "4ea4e41a3993"; } else { cVar.a = "https://errlog.umeng.com/api/crashsdk/logcollect"; cVar.b = "28ef1713347d"; } a5.b = this; a5.f1790c.a = this; a5.f1791d.a = this; this.f1773f = 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.b != null && getGlobalEnvStruct().isEnableWaStat()) { a6.b.send(new com.efs.sdk.base.core.f.b("efs_core", "pvuv", a6.a.f1785c)); } } else if (i2 == 1) { Object obj = message.obj; if (obj != null && (obj instanceof ILogProtocol)) { b((ILogProtocol) obj); } } else if (i2 == 3) { a(); } return true; } public void send(ILogProtocol iLogProtocol) { if (!this.f1773f) { Message obtain = Message.obtain(); obtain.what = 1; obtain.obj = iLogProtocol; this.i.sendMessage(obtain); return; } b(iLogProtocol); } public HttpResponse sendSyncImmediately(String str, int i2, 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.f1781d = file; bVar.a(str2); bVar.a(i2); bVar.b.b = z; bVar.c(); d.a.a().a.a(bVar); return bVar.b.f1782c; } static /* synthetic */ 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(); } } }