湘游汇 v1.0版本的 MD5 值为:85338391d88b5d57da66e240ece801c7
以下内容为反编译后的 d.java 源代码,内容仅作参考
package a.a.a.a.d;
import android.text.TextUtils;
import android.util.Log;
import cn.net.shoot.sharetracesdk.AppData;
import cn.net.shoot.sharetracesdk.ShareTraceInstallListener;
import java.util.HashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class d {
public static volatile d f12a;
public ExecutorService b = Executors.newSingleThreadExecutor();
public static class a implements Runnable {
public ShareTraceInstallListener f13a;
public class RunnableC0001a implements Runnable {
public final c f14a;
public RunnableC0001a(c cVar) {
this.f14a = cVar;
}
@Override
public void run() {
c cVar = this.f14a;
int i = cVar.f11a;
if (i == 200) {
ShareTraceInstallListener shareTraceInstallListener = a.this.f13a;
AppData appData = cVar.d;
if (appData == null) {
appData = new AppData();
}
shareTraceInstallListener.onInstall(appData);
} else {
a.this.f13a.onError(i, cVar.b);
}
a.this.f13a = null;
}
}
public a(ShareTraceInstallListener shareTraceInstallListener) {
this.f13a = shareTraceInstallListener;
}
public final void a(c cVar) {
a.a.a.a.b.b.a().c.post(new RunnableC0001a(cVar));
}
@Override
public void run() {
a.a.a.a.b.b a2;
String str;
try {
if (!a.a.a.a.b.b.a().b()) {
String c = a.a.a.a.c.b.c("share_trace_init");
String str2 = "Get tid from cache. tid is " + c;
AppData b = a.a.a.a.c.b.b(a.a.a.a.b.b.a().c());
String str3 = "Get appData from cache. appData is " + b.toString();
c cVar = new c();
cVar.c = c;
cVar.d = b;
cVar.f11a = 200;
a(cVar);
return;
}
HashMap<String, String> b2 = a.a.a.a.d.a.a().b();
String str4 = "report params:" + b2.toString();
String str5 = a.a.a.a.b.b.a().d;
String replace = a.a.a.a.b.b.a().e ? "https://api.sharetrace.com".replace("api", "apitest") : "https://api.sharetrace.com";
StringBuilder sb = new StringBuilder();
sb.append(replace);
sb.append(String.format("/api/trace/client/report/%s", str5));
c a3 = a.a.a.a.c.b.a(sb.toString(), b2);
String str6 = "Network is response data is " + a3;
if (a3.f11a == 200) {
if (TextUtils.isEmpty(a3.c)) {
a2 = a.a.a.a.b.b.a();
str = "init";
} else {
a2 = a.a.a.a.b.b.a();
str = a3.c;
}
a2.b(str);
if (a3.d != null) {
a.a.a.a.b.b.a().a(a.a.a.a.c.b.a(a3.d));
}
if (!TextUtils.isEmpty(b2.get("clip"))) {
a.a.a.a.a.a.a().b();
}
b a4 = b.a();
if (a4.e != null) {
a4.d.clear();
a4.e.unregisterActivityLifecycleCallbacks(a4.b);
}
}
a(a3);
} catch (Exception e) {
Log.e("ShareTrace", "trace report error . msg =" + e.getMessage());
c cVar2 = new c();
cVar2.f11a = -1;
cVar2.b = "unknown error.";
a(cVar2);
}
}
}
public static d a() {
if (f12a == null) {
synchronized (d.class) {
if (f12a == null) {
f12a = new d();
}
}
}
return f12a;
}
public synchronized void a(ShareTraceInstallListener shareTraceInstallListener) {
this.b.execute(new a(shareTraceInstallListener));
}
}