花瓣 v4.6.12版本的 MD5 值为:6a3515d4d16d98931f1b3d25a91b257e
以下内容为反编译后的 ControllerCenter.java 源代码,内容仅作参考
package com.efs.sdk.base.core.controller;
import android.content.IntentFilter;
import android.os.Handler;
import android.os.Message;
import android.util.Pair;
import android.webkit.ValueCallback;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
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.GlobalInfoManager;
import com.efs.sdk.base.core.config.a.c;
import com.efs.sdk.base.core.controller.a.a;
import com.efs.sdk.base.core.d.b;
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.concurrent.WorkThreadUtil;
import com.efs.sdk.base.http.HttpResponse;
import com.efs.sdk.base.protocol.ILogProtocol;
import java.io.File;
import java.util.HashMap;
public class ControllerCenter implements Handler.Callback {
private static GlobalEnvStruct f3443h;
private int a = 0;
private final int b = 0;
private final int c = 1;
private final int f3444d = 2;
private final int f3445e = 3;
private volatile boolean f3446f = false;
private a f3447g;
private Handler f3448i;
public ControllerCenter(EfsReporter.Builder builder) {
f3443h = builder.getGlobalEnvStruct();
Handler handler = new Handler(com.efs.sdk.base.core.util.concurrent.a.a.getLooper(), this);
this.f3448i = handler;
handler.sendEmptyMessage(0);
}
private void a() {
if (this.f3447g == null) {
this.f3447g = new a();
}
try {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE");
f3443h.mAppContext.registerReceiver(this.f3447g, 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.f3448i.sendEmptyMessageDelayed(3, 6000L);
}
}
}
private void b(final ILogProtocol iLogProtocol) {
if (iLogProtocol == null) {
return;
}
WorkThreadUtil.submit(new Runnable() {
@Override
public final void run() {
try {
iLogProtocol.insertGlobal(GlobalInfoManager.getInstance().getGlobalInfo());
if (!"wa".equalsIgnoreCase(iLogProtocol.getLogType())) {
ControllerCenter.a(iLogProtocol);
}
if (ControllerCenter.getGlobalEnvStruct().isEnableSendLog()) {
final b a = b.a(iLogProtocol);
final 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);
}
}
});
}
@NonNull
public static GlobalEnvStruct getGlobalEnvStruct() {
return f3443h;
}
@Override
public boolean handleMessage(@NonNull Message message) {
int i2 = message.what;
if (i2 == 0) {
GlobalInfoManager.getInstance().initGlobalInfo();
f.a.a();
c.a().b();
a();
com.efs.sdk.base.core.f.f a = f.a.a();
boolean isIntl = f3443h.isIntl();
com.efs.sdk.base.core.f.c cVar = a.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";
}
a.b = this;
a.c.a = this;
a.f3458d.a = this;
this.f3446f = true;
com.efs.sdk.base.core.c.d.a().sendEmptyMessageDelayed(0, f3443h.getLogSendDelayMills());
com.efs.sdk.base.core.f.f a2 = f.a.a();
if (a2.b != null && getGlobalEnvStruct().isEnableWaStat()) {
a2.b.send(new com.efs.sdk.base.core.f.b("efs_core", "pvuv", a2.a.c));
}
} 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.f3446f) {
Message obtain = Message.obtain();
obtain.what = 1;
obtain.obj = iLogProtocol;
this.f3448i.sendMessage(obtain);
return;
}
b(iLogProtocol);
}
@Nullable
public HttpResponse sendSyncImmediately(String str, int i2, String str2, boolean z, File file) {
b bVar = new b(str, (byte) 2);
bVar.b(1);
bVar.f3453d = file;
bVar.a(str2);
bVar.a(i2);
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();
}
}
}