花瓣 v4.6.12版本的 MD5 值为:6a3515d4d16d98931f1b3d25a91b257e
以下内容为反编译后的 a0.java 源代码,内容仅作参考
package com.gaoding.analytics.android.sdk;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Application;
import android.app.Dialog;
import android.content.Context;
import android.content.pm.PackageManager;
import android.graphics.Point;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebView;
import androidx.annotation.Nullable;
import com.gaoding.analytics.android.sdk.data.e;
import com.gaoding.analytics.android.sdk.exceptions.InvalidDataException;
import com.gaoding.analytics.android.sdk.i;
import com.gaoding.foundations.framework.application.GaodingApplication;
import com.gaoding.gdstorage.shadow.AbsShadowGDKVStorage;
import com.huawei.hms.framework.common.hianalytics.CrashHianalyticsData;
import com.liulishuo.filedownloader.model.FileDownloadModel;
import com.sigmob.sdk.base.mta.PointCategory;
import com.umeng.analytics.pro.bi;
import java.lang.reflect.Method;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class a0 implements com.gaoding.analytics.android.sdk.q {
static final int e0 = 16;
static final String f0 = "1.0.4";
static final String g0 = "3.0.0";
private static final String j0 = "GD.SensorsDataAPI";
private static final String k0 = "event_timer";
private static p0 p0;
private static com.gaoding.analytics.android.sdk.i0 q0;
private JSONObject A;
private boolean B;
private boolean C;
private boolean D;
private boolean E;
private boolean F;
private boolean G;
private final Context H;
private final com.gaoding.analytics.android.sdk.b I;
private final com.gaoding.analytics.android.sdk.data.h.f J;
private final com.gaoding.analytics.android.sdk.data.h.l K;
private final com.gaoding.analytics.android.sdk.data.h.p L;
private final com.gaoding.analytics.android.sdk.data.h.h M;
private final com.gaoding.analytics.android.sdk.data.h.g N;
private final com.gaoding.analytics.android.sdk.data.h.i O;
private final com.gaoding.analytics.android.sdk.data.h.j P;
private final com.gaoding.analytics.android.sdk.data.h.m Q;
private final Map<String, com.gaoding.analytics.android.sdk.l> R;
private List<Integer> S;
private List<Integer> T;
private Set<Integer> U;
private int V;
private String W;
private z0 X;
private a1 Y;
private y0 Z;
private final String a;
private r0 a0;
private String b;
private q0 b0;
private String c;
private List<com.gaoding.analytics.android.sdk.f0> c0;
@Nullable
private String f3621d;
private SimpleDateFormat d0;
private String f3622e;
private String f3623f;
private String f3624g;
private String f3625h;
private h0 f3626i;
private String j;
private int k;
private int l;
private boolean m;
private CountDownTimer n;
private final Map<String, Object> o;
private String p;
private String q;
private boolean r;
private com.gaoding.foundations.framework.h.e s;
private boolean t;
private boolean u;
private long v;
private final com.gaoding.analytics.android.sdk.data.h.n w;
private Set<g0> x;
private List<Class> y;
private boolean z;
private static final Map<Context, a0> h0 = new HashMap();
static String i0 = null;
static boolean l0 = false;
static Boolean m0 = Boolean.FALSE;
static Boolean n0 = Boolean.TRUE;
private static final Pattern o0 = Pattern.compile("^((?!^distinct_id$|^original_id$|^time$|^properties$|^id$|^first_id$|^second_id$|^users$|^events$|^event$|^date$|^datetime$)[a-zA-Z_$][a-zA-Z\\d_$]{0,99})$", 2);
class a implements Runnable {
final Object a;
a(Object obj) {
this.a = obj;
}
@Override
public void run() {
try {
JSONObject jSONObject = new JSONObject();
String canonicalName = this.a.getClass().getCanonicalName();
if (Build.VERSION.SDK_INT >= 11) {
Activity activity = null;
try {
Method method = this.a.getClass().getMethod("getActivity", new Class[0]);
if (method != null) {
activity = (Activity) method.invoke(this.a, new Object[0]);
}
} catch (Exception unused) {
}
if (activity != null) {
canonicalName = activity.getClass().getCanonicalName();
}
}
jSONObject.put("page", canonicalName);
jSONObject.put(com.gaoding.analytics.android.sdk.c.z, System.currentTimeMillis());
jSONObject.put(com.gaoding.analytics.android.sdk.c.B, 29003);
a0.this.f1(com.gaoding.analytics.android.sdk.c.f3659i, jSONObject);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
public class RunnableC0152a0 implements Runnable {
final String a;
RunnableC0152a0(String str) {
this.a = str;
}
@Override
public void run() {
try {
a0.this.z2(com.gaoding.analytics.android.sdk.m.TRACK, this.a, null, null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
public class b implements Runnable {
final boolean a;
final JSONObject b;
final String c;
b(boolean z, JSONObject jSONObject, String str) {
this.a = z;
this.b = jSONObject;
this.c = str;
}
@Override
public void run() {
try {
if (!a0.l0) {
return;
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
try {
if (this.a ? a0.this.P.b().booleanValue() : a0.this.O.b().booleanValue()) {
try {
if (!com.gaoding.analytics.android.sdk.g1.e.w(this.b)) {
HashMap hashMap = new HashMap();
hashMap.put("SENSORS_ANALYTICS_UTM_SOURCE", "$utm_source");
hashMap.put("SENSORS_ANALYTICS_UTM_MEDIUM", "$utm_medium");
hashMap.put("SENSORS_ANALYTICS_UTM_TERM", "$utm_term");
hashMap.put("SENSORS_ANALYTICS_UTM_CONTENT", "$utm_content");
hashMap.put("SENSORS_ANALYTICS_UTM_CAMPAIGN", "$utm_campaign");
for (Map.Entry entry : hashMap.entrySet()) {
if (entry != null) {
String e3 = com.gaoding.analytics.android.sdk.g1.e.e(a0.this.H, (String) entry.getKey());
if (!TextUtils.isEmpty(e3)) {
this.b.put((String) entry.getValue(), e3);
}
}
}
}
if (!com.gaoding.analytics.android.sdk.g1.e.w(this.b)) {
this.b.put("$ios_install_source", String.format("android_id=%s##imei=%s##mac=%s", a0.i0, com.gaoding.analytics.android.sdk.g1.e.k(a0.this.H), ""));
}
if (this.a) {
this.b.put("$ios_install_disable_callback", this.a);
}
} catch (Exception e4) {
com.gaoding.analytics.android.sdk.x.h(e4);
}
a0.this.z2(com.gaoding.analytics.android.sdk.m.TRACK, this.c, this.b, null);
JSONObject jSONObject = new JSONObject();
if (this.b != null) {
jSONObject = new JSONObject(this.b.toString());
}
jSONObject.put("$first_visit_time", new Date());
a0.this.z2(com.gaoding.analytics.android.sdk.m.PROFILE_SET_ONCE, null, jSONObject, null);
if (this.a) {
a0.this.P.a(Boolean.FALSE);
} else {
a0.this.O.a(Boolean.FALSE);
}
}
a0.this.flush();
} catch (Exception e5) {
com.gaoding.analytics.android.sdk.x.h(e5);
}
}
}
class b0 implements Runnable {
final String a;
b0(String str) {
this.a = str;
}
@Override
public void run() {
try {
a0.this.K1(this.a);
synchronized (a0.this.R) {
a0.this.R.remove(this.a);
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class c implements Runnable {
c() {
}
@Override
public void run() {
a0.this.I.p();
}
}
class c0 implements Runnable {
c0() {
}
@Override
public void run() {
try {
synchronized (a0.this.R) {
a0.this.R.clear();
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class d implements Runnable {
final JSONObject a;
d(JSONObject jSONObject) {
this.a = jSONObject;
}
@Override
public void run() {
try {
a0.this.z2(com.gaoding.analytics.android.sdk.m.PROFILE_SET, null, this.a, null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
public class d0 implements Runnable {
final String a;
final JSONObject b;
d0(String str, JSONObject jSONObject) {
this.a = str;
this.b = jSONObject;
}
@Override
public void run() {
try {
synchronized (a0.this.K) {
if (!this.a.equals(a0.this.K.b())) {
a0.this.K.a(this.a);
if (!this.a.equals(a0.this.C())) {
a0.this.z2(com.gaoding.analytics.android.sdk.m.TRACK_SIGNUP, "SignUp", this.b, a0.this.C());
}
}
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
public class e implements Runnable {
final String a;
final Object b;
e(String str, Object obj) {
this.a = str;
this.b = obj;
}
@Override
public void run() {
try {
a0.this.z2(com.gaoding.analytics.android.sdk.m.PROFILE_SET, null, new JSONObject().put(this.a, this.b), null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class e0 implements Runnable {
final String a;
final JSONObject b;
e0(String str, JSONObject jSONObject) {
this.a = str;
this.b = jSONObject;
}
@Override
public void run() {
try {
String X0 = a0.this.X0();
synchronized (a0.this.J) {
a0.this.J.a(this.a);
}
a0.this.z2(com.gaoding.analytics.android.sdk.m.TRACK_SIGNUP, "SignUp", this.b, X0);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class f implements Runnable {
final JSONObject a;
f(JSONObject jSONObject) {
this.a = jSONObject;
}
@Override
public void run() {
try {
a0.this.z2(com.gaoding.analytics.android.sdk.m.PROFILE_SET_ONCE, null, this.a, null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class f0 implements Runnable {
final String a;
f0(String str) {
this.a = str;
}
@Override
public void run() {
try {
String X0 = a0.this.X0();
synchronized (a0.this.J) {
a0.this.J.a(this.a);
}
a0.this.z2(com.gaoding.analytics.android.sdk.m.TRACK_SIGNUP, "SignUp", null, X0);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class g implements Runnable {
final String a;
final Object b;
g(String str, Object obj) {
this.a = str;
this.b = obj;
}
@Override
public void run() {
try {
a0.this.z2(com.gaoding.analytics.android.sdk.m.PROFILE_SET_ONCE, null, new JSONObject().put(this.a, this.b), null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
public enum g0 {
APP_START("AppStart", 1),
APP_END("AppEnd", 2),
APP_CLICK("Click", 4),
APP_VIEW_SCREEN(com.gaoding.analytics.android.sdk.c.f3659i, 8);
private final String a;
private final int b;
g0(String str, int i2) {
this.a = str;
this.b = i2;
}
public static g0 a(String str) {
if (TextUtils.isEmpty(str)) {
return null;
}
if (APP_START.b().equals(str)) {
return APP_START;
}
if (APP_END.b().equals(str)) {
return APP_END;
}
if (APP_CLICK.b().equals(str)) {
return APP_CLICK;
}
if (APP_VIEW_SCREEN.b().equals(str)) {
return APP_VIEW_SCREEN;
}
return null;
}
public String b() {
return this.a;
}
public int c() {
return this.b;
}
}
class h implements Runnable {
final Map a;
h(Map map) {
this.a = map;
}
@Override
public void run() {
try {
a0.this.z2(com.gaoding.analytics.android.sdk.m.PROFILE_INCREMENT, null, new JSONObject(this.a), null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
public enum h0 {
DEBUG_OFF(false, false),
DEBUG_ONLY(true, false),
DEBUG_AND_TRACK(true, true);
private final boolean a;
private final boolean b;
h0(boolean z, boolean z2) {
this.a = z;
this.b = z2;
}
boolean a() {
return this.a;
}
boolean b() {
return this.b;
}
}
class i implements Runnable {
final String a;
final Number b;
i(String str, Number number) {
this.a = str;
this.b = number;
}
@Override
public void run() {
try {
a0.this.z2(com.gaoding.analytics.android.sdk.m.PROFILE_INCREMENT, null, new JSONObject().put(this.a, this.b), null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
interface i0 {
void a(a0 a0Var);
}
class j implements Runnable {
final String a;
final String b;
j(String str, String str2) {
this.a = str;
this.b = str2;
}
@Override
public void run() {
try {
JSONArray jSONArray = new JSONArray();
jSONArray.put(this.a);
JSONObject jSONObject = new JSONObject();
jSONObject.put(this.b, jSONArray);
a0.this.z2(com.gaoding.analytics.android.sdk.m.PROFILE_APPEND, null, jSONObject, null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
public final class j0 {
public static final int b = 0;
public static final int c = 1;
public static final int f3635d = 2;
public static final int f3636e = 4;
public static final int f3637f = 8;
public static final int f3638g = 255;
public j0() {
}
}
class k implements Runnable {
final String a;
k(String str) {
this.a = str;
}
@Override
public void run() {
try {
synchronized (a0.this.J) {
a0.this.J.a(this.a);
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class l implements Runnable {
final Set a;
final String b;
l(Set set, String str) {
this.a = set;
this.b = str;
}
@Override
public void run() {
try {
JSONArray jSONArray = new JSONArray();
for (String str : this.a) {
jSONArray.put(str);
}
JSONObject jSONObject = new JSONObject();
jSONObject.put(this.b, jSONArray);
a0.this.z2(com.gaoding.analytics.android.sdk.m.PROFILE_APPEND, null, jSONObject, null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class m implements Runnable {
final String a;
m(String str) {
this.a = str;
}
@Override
public void run() {
try {
a0.this.z2(com.gaoding.analytics.android.sdk.m.PROFILE_UNSET, null, new JSONObject().put(this.a, true), null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class n implements Runnable {
n() {
}
@Override
public void run() {
try {
a0.this.z2(com.gaoding.analytics.android.sdk.m.PROFILE_DELETE, null, null, null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class o implements Runnable {
final JSONObject a;
o(JSONObject jSONObject) {
this.a = jSONObject;
}
@Override
public void run() {
try {
a0.this.z2(com.gaoding.analytics.android.sdk.m.TRACK_LOG, "log", this.a, null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class p implements Runnable {
final JSONObject a;
p(JSONObject jSONObject) {
this.a = jSONObject;
}
@Override
public void run() {
try {
a0.this.z2(com.gaoding.analytics.android.sdk.m.TRACK_APM, "apm", this.a, null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
public class q implements Runnable {
q() {
}
@Override
public void run() {
if (a0.this.f3626i == h0.DEBUG_ONLY) {
return;
}
h0 unused = a0.this.f3626i;
h0 h0Var = h0.DEBUG_AND_TRACK;
}
}
class r implements Runnable {
r() {
}
@Override
public void run() {
a0.this.Y.a(true);
a0.this.Z.a(true);
}
}
public class s implements Runnable {
final String a;
final TimeUnit b;
s(String str, TimeUnit timeUnit) {
this.a = str;
this.b = timeUnit;
}
@Override
public void run() {
try {
a0.this.K1(this.a);
synchronized (a0.this.R) {
a0.this.R.put(this.a, new com.gaoding.analytics.android.sdk.l(this.b));
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
public class t implements Runnable {
final String a;
final com.gaoding.analytics.android.sdk.l b;
t(String str, com.gaoding.analytics.android.sdk.l lVar) {
this.a = str;
this.b = lVar;
}
@Override
public void run() {
try {
a0.this.K1(this.a);
synchronized (a0.this.R) {
a0.this.R.put(this.a, this.b);
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class u implements Runnable {
final String a;
final JSONObject b;
u(String str, JSONObject jSONObject) {
this.a = str;
this.b = jSONObject;
}
@Override
public void run() {
try {
a0.this.z2(com.gaoding.analytics.android.sdk.m.TRACK, this.a, this.b, null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class v implements Runnable {
v() {
}
@Override
public void run() {
try {
synchronized (a0.this.K) {
a0.this.K.a(null);
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class w implements Runnable {
final String a;
w(String str) {
this.a = str;
}
@Override
public void run() {
try {
a0.this.z2(com.gaoding.analytics.android.sdk.m.TRACK, this.a, null, null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
public class x implements Runnable {
final String a;
final JSONObject b;
x(String str, JSONObject jSONObject) {
this.a = str;
this.b = jSONObject;
}
@Override
public void run() {
try {
if (TextUtils.isEmpty(this.a) && this.b == null) {
return;
}
JSONObject jSONObject = new JSONObject();
a0.this.A = this.b;
if (!TextUtils.isEmpty(a0.this.q)) {
jSONObject.put("referrer", a0.this.q);
}
jSONObject.put("url", this.a);
a0.this.q = this.a;
if (this.b != null) {
com.gaoding.analytics.android.sdk.g1.e.B(this.b, jSONObject);
}
jSONObject.put(com.gaoding.analytics.android.sdk.c.B, 29003);
a0.this.f1(com.gaoding.analytics.android.sdk.c.f3659i, jSONObject);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
class y implements Runnable {
final Activity a;
y(Activity activity) {
this.a = activity;
}
@Override
public void run() {
try {
if (this.a == null) {
return;
}
JSONObject jSONObject = new JSONObject();
jSONObject.put(com.gaoding.analytics.android.sdk.c.f3656f, this.a.getClass().getCanonicalName());
com.gaoding.analytics.android.sdk.g1.e.r(jSONObject, this.a);
if (this.a instanceof com.gaoding.analytics.android.sdk.y) {
com.gaoding.analytics.android.sdk.y yVar = (com.gaoding.analytics.android.sdk.y) this.a;
String b = yVar.b();
JSONObject a = yVar.a();
if (a != null) {
com.gaoding.analytics.android.sdk.g1.e.B(a, jSONObject);
}
a0.this.z0(b, jSONObject);
return;
}
a0.this.f1(com.gaoding.analytics.android.sdk.c.f3659i, jSONObject);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
public class z implements Runnable {
final String a;
final JSONObject b;
final boolean c;
z(String str, JSONObject jSONObject, boolean z) {
this.a = str;
this.b = jSONObject;
this.c = z;
}
@Override
public void run() {
try {
a0.this.A2(com.gaoding.analytics.android.sdk.m.TRACK, this.a, this.b, null, this.c);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
a0(Context context, String str, String str2, h0 h0Var) {
this.f3625h = "";
this.f3626i = h0.DEBUG_OFF;
this.t = true;
this.u = true;
this.v = 33554432L;
this.y = new ArrayList();
this.D = false;
this.E = true;
this.F = false;
this.G = false;
this.V = 14;
this.c0 = new ArrayList();
this.H = context;
this.f3626i = h0Var;
String packageName = context.getApplicationContext().getPackageName();
this.S = new ArrayList();
this.T = new ArrayList();
this.x = new CopyOnWriteArraySet();
try {
com.gaoding.analytics.android.sdk.g1.e.b(this.H);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
Bundle bundle = null;
try {
com.gaoding.analytics.android.sdk.x.g(this);
bundle = context.getApplicationContext().getPackageManager().getApplicationInfo(packageName, 128).metaData;
} catch (PackageManager.NameNotFoundException e3) {
com.gaoding.analytics.android.sdk.x.h(e3);
}
bundle = bundle == null ? new Bundle() : bundle;
setServerUrl(str);
d(str2);
if (h0Var == h0.DEBUG_OFF) {
m0 = Boolean.valueOf(bundle.getBoolean("com.gaoding.analytics.android.EnableLogging", false));
} else {
m0 = Boolean.valueOf(bundle.getBoolean("com.gaoding.analytics.android.EnableLogging", true));
}
n0 = Boolean.valueOf(bundle.getBoolean("com.gaoding.analytics.android.ShowDebugInfoView", true));
this.k = bundle.getInt("com.gaoding.analytics.android.FlushInterval", 15000);
this.l = bundle.getInt("com.gaoding.analytics.android.FlushBulkSize", 100);
this.m = bundle.getBoolean("com.gaoding.analytics.android.AutoTrack", false);
this.z = bundle.getBoolean("com.gaoding.analytics.android.HeatMap", false);
this.F = bundle.getBoolean("com.gaoding.analytics.android.DisableDefaultRemoteConfig", false);
this.B = bundle.getBoolean("com.gaoding.analytics.android.ButterknifeOnClick", false);
this.t = bundle.getBoolean("com.gaoding.analytics.android.FlushInBackground", true);
this.u = bundle.getBoolean("com.gaoding.analytics.android.HeatMapSSLCertificateCheck", true);
String o2 = com.gaoding.analytics.android.sdk.g1.e.o(context);
if (TextUtils.isEmpty(o2)) {
this.a = bundle.getString("com.gaoding.analytics.android.MainProcessName");
} else {
this.a = o2;
}
l0 = com.gaoding.analytics.android.sdk.g1.e.y(context, this.a);
this.E = bundle.getBoolean("com.gaoding.analytics.android.EnableHeatMapConfirmDialog", true);
this.G = bundle.getBoolean("com.gaoding.analytics.android.DisableTrackDeviceId", false);
int i2 = bundle.getInt("com.gaoding.analytics.android.FlushCacheSize", 5);
com.gaoding.analytics.android.sdk.data.a.w(context, packageName);
this.I = com.gaoding.analytics.android.sdk.b.s(this.H, i2);
i0 = com.gaoding.analytics.android.sdk.g1.e.d(this.H);
com.gaoding.analytics.android.sdk.data.e.a(context);
this.J = (com.gaoding.analytics.android.sdk.data.h.f) com.gaoding.analytics.android.sdk.data.e.b(e.b.f3698h);
this.K = (com.gaoding.analytics.android.sdk.data.h.l) com.gaoding.analytics.android.sdk.data.e.b("events_login_id");
this.L = (com.gaoding.analytics.android.sdk.data.h.p) com.gaoding.analytics.android.sdk.data.e.b(e.b.o);
this.M = (com.gaoding.analytics.android.sdk.data.h.h) com.gaoding.analytics.android.sdk.data.e.b(e.b.j);
this.O = (com.gaoding.analytics.android.sdk.data.h.i) com.gaoding.analytics.android.sdk.data.e.b(e.b.k);
this.P = (com.gaoding.analytics.android.sdk.data.h.j) com.gaoding.analytics.android.sdk.data.e.b(e.b.l);
this.Q = (com.gaoding.analytics.android.sdk.data.h.m) com.gaoding.analytics.android.sdk.data.e.b(e.b.n);
this.N = (com.gaoding.analytics.android.sdk.data.h.g) com.gaoding.analytics.android.sdk.data.e.b(e.b.f3699i);
this.w = (com.gaoding.analytics.android.sdk.data.h.n) com.gaoding.analytics.android.sdk.data.e.b("session_id");
this.X = z0.d();
this.Y = new a1();
this.Z = new y0();
r0 b2 = r0.b();
this.a0 = b2;
b2.a(this.Y);
this.a0.a(this.Z);
this.s = new com.gaoding.foundations.framework.h.e();
I1();
if (this.f3626i != h0.DEBUG_OFF && l0 && n0.booleanValue() && !a2()) {
u2();
}
if (Build.VERSION.SDK_INT >= 14) {
((Application) context.getApplicationContext()).registerActivityLifecycleCallbacks(new com.gaoding.analytics.android.sdk.c0(this, this.M, this.N, context));
}
if (h0Var != h0.DEBUG_OFF) {
com.gaoding.analytics.android.sdk.x.c(j0, String.format(Locale.CHINA, "Initialized the instance of Sensors Analytics SDK with server url '%s', flush interval %d ms, debugMode: %s", this.f3623f, Integer.valueOf(this.k), h0Var));
}
HashMap hashMap = new HashMap();
hashMap.put("project", U1());
hashMap.put("sdk_version", "1.0.4");
String g2 = com.gaoding.analytics.android.sdk.g1.e.g(this.H);
if (!TextUtils.isEmpty(g2)) {
hashMap.put(bi.P, g2);
}
if (!this.G && !TextUtils.isEmpty(i0)) {
hashMap.put("device_id", i0);
}
hashMap.put(bi.ai, Q1());
String str3 = Build.VERSION.RELEASE;
hashMap.put("os_ver", str3 == null ? "UNKNOWN" : str3);
try {
hashMap.put("project_ver", this.H.getPackageManager().getPackageInfo(this.H.getPackageName(), 0).versionName);
} catch (Exception e4) {
if (h0Var != h0.DEBUG_OFF) {
com.gaoding.analytics.android.sdk.x.d(j0, "Exception getting app version name", e4);
}
}
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("os", "Android");
} catch (JSONException e5) {
com.gaoding.analytics.android.sdk.x.h(e5);
}
try {
jSONObject.put("version", String.valueOf(com.gaoding.foundations.sdk.b.i0.p()));
} catch (JSONException e6) {
com.gaoding.analytics.android.sdk.x.h(e6);
}
try {
jSONObject.put("manufacturer", com.gaoding.analytics.android.sdk.g1.e.p());
} catch (JSONException e7) {
com.gaoding.analytics.android.sdk.x.h(e7);
}
try {
jSONObject.put("os_version", String.valueOf(Build.VERSION.SDK_INT));
} catch (Exception e8) {
com.gaoding.analytics.android.sdk.x.h(e8);
}
if (TextUtils.isEmpty(Build.MODEL)) {
try {
jSONObject.put("model", "UNKNOWN");
} catch (JSONException e9) {
com.gaoding.analytics.android.sdk.x.h(e9);
}
} else {
try {
jSONObject.put("model", Build.MODEL.trim());
} catch (JSONException e10) {
com.gaoding.analytics.android.sdk.x.h(e10);
}
}
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
try {
jSONObject.put("screen_height", displayMetrics.heightPixels);
} catch (JSONException e11) {
com.gaoding.analytics.android.sdk.x.h(e11);
}
try {
jSONObject.put("screen_width", displayMetrics.widthPixels);
} catch (JSONException e12) {
com.gaoding.analytics.android.sdk.x.h(e12);
}
try {
WindowManager windowManager = (WindowManager) this.H.getSystemService("window");
if (Build.VERSION.SDK_INT >= 17) {
Point point = new Point();
if (windowManager != null) {
windowManager.getDefaultDisplay().getRealSize(point);
jSONObject.put("screen_height", point.y);
}
}
} catch (Exception e13) {
try {
jSONObject.put("screen_height", displayMetrics.heightPixels);
} catch (JSONException unused) {
com.gaoding.analytics.android.sdk.x.h(e13);
}
}
try {
jSONObject.put("imei", com.gaoding.analytics.android.sdk.g1.e.k(context));
} catch (JSONException e14) {
com.gaoding.analytics.android.sdk.x.h(e14);
}
hashMap.put("runtime", jSONObject);
ArrayList<String> f2 = com.gaoding.analytics.android.sdk.g1.e.f(context);
if (f2.size() > 0) {
this.U = new CopyOnWriteArraySet();
Iterator<String> it = f2.iterator();
while (it.hasNext()) {
this.U.add(Integer.valueOf(it.next().hashCode()));
}
}
this.o = Collections.unmodifiableMap(hashMap);
this.R = new HashMap();
}
public void A2(com.gaoding.analytics.android.sdk.m mVar, String str, JSONObject jSONObject, String str2, boolean z2) {
com.gaoding.analytics.android.sdk.l lVar;
JSONObject jSONObject2;
if (str != null) {
synchronized (this.R) {
lVar = this.R.get(str);
this.R.remove(str);
}
} else {
lVar = null;
}
try {
if (mVar.c()) {
K1(str);
}
L1(jSONObject);
try {
if (mVar.c()) {
jSONObject2 = new JSONObject();
synchronized (this.L) {
com.gaoding.analytics.android.sdk.g1.e.B(this.L.b(), jSONObject2);
}
try {
if (TextUtils.isEmpty(this.o.containsKey(bi.P) ? (String) this.o.get(bi.P) : "")) {
String g2 = com.gaoding.analytics.android.sdk.g1.e.g(this.H);
if (!TextUtils.isEmpty(g2)) {
jSONObject2.put(bi.P, g2);
}
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
e2(jSONObject2);
} else if (!mVar.b()) {
return;
} else {
jSONObject2 = new JSONObject();
}
JSONObject a2 = new com.gaoding.analytics.android.sdk.i().a(new i.c().d(this.H).e(this.f3625h).g(str).i(mVar).k(jSONObject).l(jSONObject2).c(this.w).j(Z1()).f(this.o).h(lVar).b());
this.I.l(mVar.a(), a2, z2);
com.gaoding.analytics.android.sdk.x.c(j0, "track event:\n" + com.gaoding.analytics.android.sdk.g1.c.b(a2.toString()));
} catch (JSONException unused) {
throw new InvalidDataException("Unexpected property");
}
} catch (Exception e3) {
com.gaoding.analytics.android.sdk.x.h(e3);
}
}
public static void F1(i0 i0Var) {
synchronized (h0) {
for (a0 a0Var : h0.values()) {
i0Var.a(a0Var);
}
}
}
private void J1(String str) throws InvalidDataException {
if (str != null && str.length() >= 1) {
if (str.length() > 255) {
throw new InvalidDataException("The max length of distinct_id or original_id or login_id is 255.");
}
return;
}
throw new InvalidDataException("The distinct_id or original_id or login_id is empty.");
}
public void K1(String str) throws InvalidDataException {
if (str == null || str.length() < 1) {
throw new InvalidDataException("The key is empty.");
}
}
private void L1(JSONObject jSONObject) throws InvalidDataException {
if (jSONObject == null) {
return;
}
Iterator<String> keys = jSONObject.keys();
while (keys.hasNext()) {
String next = keys.next();
K1(next);
try {
Object obj = jSONObject.get(next);
if ("app_crashed_reason".equals(next)) {
if ((obj instanceof String) && ((String) obj).length() > 16382) {
jSONObject.put(next, ((String) obj).substring(0, 16382) + "$");
com.gaoding.analytics.android.sdk.x.a(j0, "The property value is too long. [key='" + next + "', value='" + obj.toString() + "']");
}
} else if ((obj instanceof String) && ((String) obj).length() > 8191) {
jSONObject.put(next, ((String) obj).substring(0, 8191) + "$");
com.gaoding.analytics.android.sdk.x.a(j0, "The property value is too long. [key='" + next + "', value='" + obj.toString() + "']");
}
} catch (JSONException unused) {
throw new InvalidDataException("Unexpected property key. [key='" + next + "']");
}
}
}
private String Q1() {
return com.gaoding.foundations.sdk.b.o.v(GaodingApplication.c()) ? "1" : "0";
}
private static a0 R1(Context context, String str, String str2, h0 h0Var) {
a0 a0Var;
if (context == null) {
return new com.gaoding.analytics.android.sdk.b0();
}
synchronized (h0) {
Context applicationContext = context.getApplicationContext();
a0Var = h0.get(applicationContext);
if (a0Var == null) {
a0Var = new a0(applicationContext, str, str2, h0Var);
h0.put(applicationContext, a0Var);
}
}
return a0Var;
}
private String S1() {
return TextUtils.isEmpty(this.c) ? "gd_app_log" : this.c;
}
private String U1() {
return TextUtils.isEmpty(this.b) ? "gd_app" : this.b;
}
private boolean Z1() {
String b2 = this.N.b();
if (b2 == null) {
return true;
}
try {
if (this.d0 == null) {
this.d0 = new SimpleDateFormat(com.ubixnow.utils.monitor.util.e.a, Locale.getDefault());
}
return b2.equals(this.d0.format(Long.valueOf(System.currentTimeMillis())));
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
return true;
}
}
public static boolean a2() {
p0 p0Var = p0;
if (p0Var == null) {
return false;
}
return p0Var.k();
}
private void e2(JSONObject jSONObject) {
if (jSONObject == null) {
return;
}
for (com.gaoding.analytics.android.sdk.f0 f0Var : this.c0) {
JSONObject a2 = f0Var.a();
if (a2 != null) {
com.gaoding.analytics.android.sdk.g1.e.B(a2, jSONObject);
}
}
}
private void h2() {
String s2 = com.gaoding.analytics.android.sdk.g1.e.s();
com.gaoding.analytics.android.sdk.data.h.n nVar = this.w;
if (nVar != null) {
nVar.a(s2);
}
}
private void o2(p0 p0Var, boolean z2) {
try {
if (p0Var.k() && !com.gaoding.analytics.android.sdk.g1.e.F(this.Q.b()).k()) {
track("DisableSensorsDataSDK");
}
this.Q.a(p0Var.t().toString());
if (z2) {
p0 = p0Var;
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
public static a0 p2() {
if (a2()) {
return new com.gaoding.analytics.android.sdk.b0();
}
synchronized (h0) {
if (h0.size() > 0) {
Iterator<a0> it = h0.values().iterator();
if (it.hasNext()) {
return it.next();
}
}
return new com.gaoding.analytics.android.sdk.b0();
}
}
public static a0 q2(Context context) {
if (a2()) {
return new com.gaoding.analytics.android.sdk.b0();
}
if (context == null) {
return new com.gaoding.analytics.android.sdk.b0();
}
synchronized (h0) {
a0 a0Var = h0.get(context.getApplicationContext());
if (a0Var == null) {
com.gaoding.analytics.android.sdk.x.c(j0, "The static method sharedInstance(context, serverURL, debugMode) should be called before calling sharedInstance()");
return new com.gaoding.analytics.android.sdk.b0();
}
return a0Var;
}
}
public static a0 r2(Context context, String str, h0 h0Var) {
return R1(context, str, null, h0Var);
}
public static a0 s2(Context context, String str, String str2) {
return R1(context, str, str2, h0.DEBUG_AND_TRACK);
}
public static a0 t2(Context context, String str, String str2, h0 h0Var) {
return R1(context, str, str2, h0Var);
}
private void u2() {
try {
if (this.f3626i == h0.DEBUG_OFF || TextUtils.isEmpty(W1())) {
return;
}
new Handler(Looper.getMainLooper()).post(new q());
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
private int w2(String str) {
if ("NULL".equals(str)) {
return 255;
}
if ("WIFI".equals(str)) {
return 8;
}
if ("2G".equals(str)) {
return 1;
}
if ("3G".equals(str)) {
return 2;
}
return "4G".equals(str) ? 4 : 255;
}
private void y2() {
com.gaoding.analytics.android.sdk.data.a v2 = com.gaoding.analytics.android.sdk.data.a.v();
if (v2.q()) {
return;
}
com.gaoding.analytics.android.sdk.x.a(j0, "track App End method run");
try {
w();
g2();
com.gaoding.analytics.android.sdk.n.a().d();
H1();
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
com.gaoding.analytics.android.sdk.x.a(j0, "track App End method run isAutoTrackEventTypeIgnored end");
String p2 = v2.p();
if (!TextUtils.isEmpty(p2)) {
try {
JSONObject jSONObject = new JSONObject(p2);
if (jSONObject.has(k0)) {
long u2 = v2.u();
long j2 = jSONObject.getLong(k0);
com.gaoding.analytics.android.sdk.l lVar = new com.gaoding.analytics.android.sdk.l(TimeUnit.SECONDS, u2, j2);
com.gaoding.analytics.android.sdk.x.a(j0, "startTime:" + u2 + "--endTime:" + j2 + "--event_duration:" + lVar.a());
I("AppEnd", lVar);
jSONObject.remove(k0);
new JSONObject();
JSONObject jSONObject2 = new JSONObject(jSONObject.toString());
H0();
jSONObject2.put("event_time", v2.r());
jSONObject2.put(com.gaoding.analytics.android.sdk.c.B, 29002);
f1("AppEnd", jSONObject2);
}
} catch (JSONException e3) {
e3.printStackTrace();
}
}
try {
v2.g(true);
} catch (Exception e4) {
com.gaoding.analytics.android.sdk.x.h(e4);
}
}
public void z2(com.gaoding.analytics.android.sdk.m mVar, String str, JSONObject jSONObject, String str2) {
A2(mVar, str, jSONObject, str2, false);
}
@Override
public List<Class> A() {
if (this.y == null) {
this.y = new ArrayList();
}
return this.y;
}
@Override
public void A0(String str, JSONObject jSONObject) {
l(str, jSONObject, false);
}
@Override
@Deprecated
public void B(String str) {
K0(str);
}
@Override
public void B0() {
com.gaoding.analytics.android.sdk.g0.a();
}
@Override
public String C() {
String b2;
synchronized (this.J) {
b2 = this.J.b();
}
return b2;
}
@Override
public void C0(List<Class<?>> list) {
if (list != null) {
try {
if (list.size() == 0) {
return;
}
for (Class<?> cls : list) {
if (cls != null && !this.T.contains(Integer.valueOf(cls.hashCode()))) {
this.T.add(Integer.valueOf(cls.hashCode()));
}
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
@Override
public void D(com.gaoding.analytics.android.sdk.f0 f0Var) {
if (this.c0.contains(f0Var)) {
return;
}
this.c0.add(f0Var);
}
@Override
@Deprecated
public void D0(String str, TimeUnit timeUnit) {
i(str, timeUnit);
}
@Override
public void E(Class<?> cls) {
if (cls == null) {
return;
}
if (this.S == null) {
this.S = new ArrayList();
}
try {
int hashCode = cls.hashCode();
if (this.S.contains(Integer.valueOf(hashCode))) {
return;
}
this.S.add(Integer.valueOf(hashCode));
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public boolean E0() {
return this.r;
}
@Override
public void F(String str) {
this.X.b(new m(str));
}
@Override
public void F0(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
if (this.U == null) {
this.U = new CopyOnWriteArraySet();
}
try {
this.U.add(Integer.valueOf(str.hashCode()));
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void G(Class<?> cls) {
if (cls == null) {
return;
}
if (this.U == null) {
this.U = new CopyOnWriteArraySet();
}
try {
this.U.add(Integer.valueOf(cls.hashCode()));
this.U.add(Integer.valueOf(cls.getCanonicalName().hashCode()));
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void G0(View view, Activity activity) {
if (view == null || activity == null) {
return;
}
try {
view.setTag(R.id.gaoding_analytics_tag_view_activity, activity);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
public void G1() {
com.gaoding.analytics.android.sdk.l value;
synchronized (this.R) {
try {
for (Map.Entry<String, com.gaoding.analytics.android.sdk.l> entry : this.R.entrySet()) {
if (entry != null && (value = entry.getValue()) != null) {
value.e(SystemClock.elapsedRealtime());
}
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.c(j0, "appBecomeActive error:" + e2.getMessage());
}
}
}
@Override
public boolean H(Class<?> cls) {
if (cls == null) {
return false;
}
List<Integer> list = this.S;
return ((list == null || !list.contains(Integer.valueOf(cls.hashCode()))) && cls.getAnnotation(m0.class) == null && cls.getAnnotation(k0.class) == null) ? false : true;
}
@Override
public void H0() {
if (this.D) {
this.q = null;
}
}
public void H1() {
com.gaoding.analytics.android.sdk.l value;
synchronized (this.R) {
try {
for (Map.Entry<String, com.gaoding.analytics.android.sdk.l> entry : this.R.entrySet()) {
if (entry != null && !"AppEnd".equals(entry.getKey().toString()) && (value = entry.getValue()) != null) {
value.d((value.b() + SystemClock.elapsedRealtime()) - value.c());
value.e(SystemClock.elapsedRealtime());
}
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.c(j0, "appEnterBackground error:" + e2.getMessage());
}
}
}
@Override
@Deprecated
public void I(String str, com.gaoding.analytics.android.sdk.l lVar) {
this.X.b(new t(str, lVar));
}
@Override
public void I0(Class cls) {
if (cls == null) {
return;
}
if (this.y == null) {
this.y = new ArrayList();
}
if (this.y.contains(cls)) {
return;
}
this.y.add(cls);
}
public void I1() {
try {
p0 F = com.gaoding.analytics.android.sdk.g1.e.F(this.Q.b());
if (F == null) {
F = new p0();
}
if (F.j()) {
k2(h0.DEBUG_OFF);
}
List<g0> a2 = F.a();
if (a2 != null) {
h0(a2);
}
if (F.k()) {
try {
flush();
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
p0 = F;
} catch (Exception e3) {
com.gaoding.analytics.android.sdk.x.h(e3);
}
}
@Override
public void J(View view, String str) {
if (view != null) {
try {
if (TextUtils.isEmpty(str)) {
return;
}
view.setTag(R.id.gaoding_analytics_tag_view_fragment_name2, str);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
@Override
public void J0(String str) {
R0(str, null);
}
@Override
public void K(Object obj, JSONObject jSONObject, boolean z2, boolean z3) {
Method method;
try {
if (Build.VERSION.SDK_INT < 17 && !z2) {
com.gaoding.analytics.android.sdk.x.a(j0, "For applications targeted to API level JELLY_BEAN or below, this feature NOT SUPPORTED");
} else if (obj == null || (method = obj.getClass().getMethod("addJavascriptInterface", Object.class, String.class)) == null) {
} else {
method.invoke(obj, new com.gaoding.analytics.android.sdk.e(this.H, jSONObject, z3), "SensorsData_APP_JS_Bridge");
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
@Deprecated
public void K0(String str) {
i(str, TimeUnit.MILLISECONDS);
}
@Override
public void L() {
this.I.g();
}
@Override
public void L0(Class<?> cls) {
if (cls == null) {
return;
}
if (this.S == null) {
this.S = new ArrayList();
}
try {
int hashCode = cls.hashCode();
if (this.S.contains(Integer.valueOf(hashCode))) {
this.S.remove(Integer.valueOf(hashCode));
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void M(Object obj, String str) {
Class<?> cls;
Method method;
Window window;
if (obj == null) {
return;
}
Class<?> cls2 = null;
try {
cls = Class.forName("android.support.v7.app.AlertDialog");
} catch (Exception unused) {
cls = null;
}
try {
cls2 = Class.forName("androidx.appcompat.app.AlertDialog");
} catch (Exception unused2) {
}
if (cls == null) {
cls = cls2;
}
if (cls == null) {
return;
}
try {
if (!cls.isInstance(obj) || TextUtils.isEmpty(str) || (method = obj.getClass().getMethod("getWindow", new Class[0])) == null || (window = (Window) method.invoke(obj, new Object[0])) == null) {
return;
}
window.getDecorView().setTag(R.id.gaoding_analytics_tag_view_id, str);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void M0() {
q0 = null;
}
public void M1(long j2) {
this.I.o(j2);
}
@Override
public JSONObject N() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put(PointCategory.APP, com.gaoding.shadowinterface.f.a.c().getAppName());
jSONObject.put("sdk_version", "1.0.4");
jSONObject.put("channel_code", this.f3622e);
jSONObject.put(FileDownloadModel.q, "/apm");
jSONObject.put("runtime", this.o.get("runtime"));
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
return jSONObject;
}
@Override
public void N0(String str, JSONObject jSONObject, boolean z2) {
this.X.b(new z(str, jSONObject, z2));
}
public void N1() {
this.X.a(new c());
}
@Override
public void O(Class<?> cls) {
if (cls == null) {
return;
}
try {
this.T.add(Integer.valueOf(cls.hashCode()));
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void O0(JSONObject jSONObject) {
this.X.b(new o(jSONObject));
}
public String O1() {
String k1 = k1();
return !TextUtils.isEmpty(k1) ? k1 : C();
}
@Override
public void P() {
Log.e(j0, "Application trackStart");
boolean booleanValue = this.M.b().booleanValue();
com.gaoding.analytics.android.sdk.data.a v2 = com.gaoding.analytics.android.sdk.data.a.v();
boolean z2 = System.currentTimeMillis() - v2.r() > ((long) v2.y());
com.gaoding.analytics.android.sdk.x.a(j0, "SessionTimeOut:" + z2);
com.gaoding.analytics.android.sdk.x.a(j0, "AppEndState():" + v2.q());
if (!booleanValue && !v2.q()) {
y2();
}
if (v2.q()) {
try {
v2.g(false);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
if (this.N.b() == null) {
if (this.d0 == null) {
this.d0 = new SimpleDateFormat(com.ubixnow.utils.monitor.util.e.a, Locale.getDefault());
}
this.N.a(this.d0.format(Long.valueOf(System.currentTimeMillis())));
}
}
@Override
public int P0() {
if (com.gaoding.analytics.android.sdk.data.a.v() == null) {
com.gaoding.analytics.android.sdk.x.c(j0, "The static method sharedInstance(context, serverURL, debugMode) should be called before calling sharedInstance()");
return 30000;
}
return com.gaoding.analytics.android.sdk.data.a.v().y();
}
public h0 P1() {
return this.f3626i;
}
@Override
public void Q(String str, Object obj) {
this.X.b(new e(str, obj));
}
@Override
public void Q0() {
this.D = true;
}
@Override
public void R(String str) {
this.f3625h = str;
}
@Override
public void R0(String str, JSONObject jSONObject) {
try {
J1(str);
this.X.b(new d0(str, jSONObject));
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void S() {
synchronized (this.L) {
this.L.a(new JSONObject());
}
}
@Override
public void S0() {
this.X.b(new n());
}
@Override
public void T(View view, JSONObject jSONObject) {
if (view == null || jSONObject == null) {
return;
}
view.setTag(R.id.gaoding_analytics_tag_view_properties, jSONObject);
}
@Override
public void T0(String str, Set<String> set) {
this.X.b(new l(set, str));
}
public String T1() {
return this.f3624g;
}
@Override
public JSONObject U() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("project", S1());
jSONObject.put("sdk_version", "1.0.4");
jSONObject.put("channel_code", this.f3622e);
jSONObject.put(FileDownloadModel.q, "/log");
jSONObject.put("runtime", this.o.get("runtime"));
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
return jSONObject;
}
@Override
public void U0(String str, String str2) {
this.X.b(new j(str2, str));
}
@Override
public JSONObject V() {
JSONObject b2;
synchronized (this.L) {
b2 = this.L.b();
}
return b2;
}
@Override
public void V0(String str) {
try {
J1(str);
this.X.b(new k(str));
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Nullable
public String V1() {
return this.f3621d;
}
@Override
public void W(String str, String str2) {
try {
K1(str);
if (TextUtils.isEmpty(str2)) {
com.gaoding.analytics.android.sdk.x.a(j0, "pushId is empty");
return;
}
String k1 = k1();
if (TextUtils.isEmpty(k1)) {
k1 = C();
}
String str3 = k1 + str2;
AbsShadowGDKVStorage j2 = com.gaoding.analytics.android.sdk.g1.e.j();
if (Objects.equals(j2.getString("distinctId_" + str, ""), str3)) {
return;
}
Q(str, str2);
j2.putString("distinctId_" + str, str3);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void W0(JSONObject jSONObject) {
z0 z0Var = this.X;
if (z0Var == null) {
return;
}
z0Var.b(new p(jSONObject));
}
public String W1() {
return this.f3623f;
}
@Override
@SuppressLint({"SetJavaScriptEnabled", "addJavascriptInterface"})
public void X(WebView webView, JSONObject jSONObject, boolean z2, boolean z3) {
if (Build.VERSION.SDK_INT < 17 && !z2) {
com.gaoding.analytics.android.sdk.x.a(j0, "For applications targeted to API level JELLY_BEAN or below, this feature NOT SUPPORTED");
} else if (webView != null) {
webView.getSettings().setJavaScriptEnabled(true);
webView.addJavascriptInterface(new com.gaoding.analytics.android.sdk.e(this.H, jSONObject, z3), "SensorsData_APP_JS_Bridge");
}
}
@Override
@Deprecated
public String X0() {
String b2;
synchronized (this.J) {
b2 = this.J.b();
}
return b2;
}
public boolean X1() {
return this.E;
}
@Override
public String Y(boolean z2) {
try {
if (z2) {
return URLDecoder.decode(this.W, "UTF-8");
}
return this.W;
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
return null;
}
}
@Override
public void Y0(Dialog dialog, String str) {
if (dialog != null) {
try {
if (TextUtils.isEmpty(str) || dialog.getWindow() == null) {
return;
}
dialog.getWindow().getDecorView().setTag(R.id.gaoding_analytics_tag_view_id, str);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
}
boolean Y1() {
return this.f3626i.b();
}
@Override
public void Z(View view, String str) {
if (view == null || TextUtils.isEmpty(str)) {
return;
}
view.setTag(R.id.gaoding_analytics_tag_view_id, str);
}
@Override
public void Z0() {
this.z = true;
}
@Override
public void a(Activity activity) {
this.X.b(new y(activity));
}
@Override
public boolean a0(Class<?> cls) {
if (cls == null) {
return false;
}
try {
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
return (this.U == null || this.U.size() <= 0) ? cls.getClass().getAnnotation(l0.class) == null : this.U.contains(Integer.valueOf(cls.hashCode())) || this.U.contains(Integer.valueOf(cls.getCanonicalName().hashCode()));
}
@Override
public void a1(String str) {
l(str, null, false);
}
@Override
public void b(Object obj) {
Class<?> cls;
Class<?> cls2;
if (obj == null) {
return;
}
Class<?> cls3 = null;
try {
cls = Class.forName("android.support.v4.app.Fragment");
} catch (Exception unused) {
cls = null;
}
try {
cls2 = Class.forName("android.app.Fragment");
} catch (Exception unused2) {
cls2 = null;
}
try {
cls3 = Class.forName("androidx.fragment.app.Fragment");
} catch (Exception unused3) {
}
if ((cls == null || !cls.isInstance(obj)) && ((cls2 == null || !cls2.isInstance(obj)) && (cls3 == null || !cls3.isInstance(obj)))) {
return;
}
this.X.b(new a(obj));
}
@Override
@SuppressLint({"SetJavaScriptEnabled", "addJavascriptInterface"})
public void b0(WebView webView, boolean z2, JSONObject jSONObject) {
X(webView, jSONObject, z2, false);
}
@Override
public void b1(boolean z2) {
try {
if (z2) {
if (this.b0 == null) {
this.b0 = new q0(this.H, 3);
}
this.b0.enable();
} else if (this.b0 != null) {
this.b0.disable();
this.b0 = null;
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
public boolean b2() {
return this.u;
}
@Override
public void c(Object obj, boolean z2) {
if (obj == null) {
return;
}
try {
Method method = obj.getClass().getMethod("addJavascriptInterface", Object.class, String.class);
if (method == null) {
return;
}
method.invoke(obj, new com.gaoding.analytics.android.sdk.e(this.H, null, z2), "SensorsData_APP_JS_Bridge");
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void c0() {
this.r = true;
}
@Override
public boolean c1() {
if (a2()) {
return false;
}
p0 p0Var = p0;
if (p0Var != null) {
if (p0Var.b() == 0) {
return false;
}
if (p0.b() > 0) {
return true;
}
}
return this.m;
}
public boolean c2(String str) {
return (w2(str) & this.V) != 0;
}
@Override
public void d(String str) {
try {
this.p = str;
if (!TextUtils.isEmpty(str) && this.f3626i != h0.DEBUG_OFF) {
Uri parse = Uri.parse(str);
String host = parse.getHost();
if (!TextUtils.isEmpty(host) && host.contains("_")) {
com.gaoding.analytics.android.sdk.x.c(j0, "Server url " + str + " contains '_' is not recommend,see details: https://en.wikipedia.org/wiki/Hostname");
}
this.f3624g = parse.toString();
return;
}
this.f3624g = str;
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void d0(String str) {
this.X.b(new b0(str));
}
@Override
public void d1(List<g0> list) {
Set<g0> set;
if (list == null || list.size() == 0 || (set = this.x) == null) {
return;
}
try {
set.removeAll(list);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
if (this.x.size() == 0) {
this.m = false;
}
}
public void d2(String str, JSONObject jSONObject) {
try {
z2(com.gaoding.analytics.android.sdk.m.TRACK, str, jSONObject, null);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void deleteAll() {
this.I.f();
}
@Override
@SuppressLint({"SetJavaScriptEnabled", "addJavascriptInterface"})
public void e(WebView webView, boolean z2, boolean z3) {
X(webView, null, z2, z3);
}
@Override
public void e0(String str) {
this.X.b(new w(str));
}
@Override
public void e1(Object obj) {
c(obj, false);
}
@Override
public void enableLog(boolean z2) {
m0 = Boolean.valueOf(z2);
}
@Override
public void f() {
try {
if (this.b0 != null) {
this.b0.enable();
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
@Deprecated
public void f0(String str, JSONObject jSONObject) {
this.X.b(new e0(str, jSONObject));
}
@Override
public void f1(String str, JSONObject jSONObject) {
N0(str, jSONObject, false);
}
public void f2() {
}
@Override
public void flush() {
this.I.n();
}
@Override
public void flushSync() {
this.I.y();
}
@Override
public void g(List<Class<?>> list) {
if (list == null || list.size() == 0) {
return;
}
if (this.U == null) {
this.U = new CopyOnWriteArraySet();
}
try {
for (Class<?> cls : list) {
this.U.add(Integer.valueOf(cls.hashCode()));
this.U.add(Integer.valueOf(cls.getCanonicalName().hashCode()));
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public boolean g0() {
return this.C;
}
@Override
public void g1() {
this.X.b(new c0());
}
public void g2() {
try {
try {
if (this.n != null) {
this.n.cancel();
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
} finally {
this.n = null;
}
}
@Override
public int getFlushBulkSize() {
return this.l;
}
@Override
public int getFlushInterval() {
return this.k;
}
@Override
public long getMaxCacheSize() {
return this.v;
}
@Override
public String getScreenOrientation() {
try {
if (this.b0 != null) {
return this.b0.a();
}
return null;
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
return null;
}
}
@Override
public boolean h(Class<?> cls) {
try {
if (this.T.size() == 0) {
return true;
}
return this.T.contains(Integer.valueOf(cls.hashCode()));
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
return false;
}
}
@Override
public void h0(List<g0> list) {
try {
this.m = true;
if (list == null) {
list = new ArrayList<>();
}
this.x.addAll(list);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void h1(JSONObject jSONObject) {
if (jSONObject == null) {
return;
}
try {
L1(jSONObject);
synchronized (this.L) {
JSONObject b2 = this.L.b();
com.gaoding.analytics.android.sdk.g1.e.C(jSONObject, b2);
this.L.a(b2);
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
@Deprecated
public void i(String str, TimeUnit timeUnit) {
this.X.b(new s(str, timeUnit));
}
@Override
public void i0(JSONObject jSONObject) {
this.X.b(new d(jSONObject));
}
@Override
public void i1(Map<String, ? extends Number> map) {
this.X.b(new h(map));
}
public void i2() {
this.Y = new a1();
this.Z = new y0();
r0 b2 = r0.b();
this.a0 = b2;
b2.a(this.Y);
this.a0.a(this.Z);
}
@Override
public boolean isDebugMode() {
return this.f3626i.a();
}
@Override
@Deprecated
public void j(List<g0> list) {
if (list == null) {
return;
}
for (g0 g0Var : list) {
if (g0Var != null && this.x.contains(g0Var)) {
this.x.remove(g0Var);
}
}
}
@Override
public void j0(View view) {
if (view != null) {
view.setTag(R.id.gaoding_analytics_tag_view_ignored, "1");
}
}
@Override
public void j1(String str, Number number) {
this.X.b(new i(str, number));
}
public void j2(String str) {
this.f3622e = str;
}
@Override
@Deprecated
public void k() {
ArrayList arrayList = new ArrayList();
arrayList.add(g0.APP_START);
arrayList.add(g0.APP_END);
arrayList.add(g0.APP_VIEW_SCREEN);
h0(arrayList);
}
@Override
public void k0(g0 g0Var) {
Set<g0> set;
if (g0Var == null || (set = this.x) == null) {
return;
}
try {
if (set.contains(g0Var)) {
this.x.remove(g0Var);
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
if (this.x.size() == 0) {
this.m = false;
}
}
@Override
public String k1() {
String b2;
synchronized (this.K) {
b2 = this.K.b();
}
return b2;
}
public void k2(h0 h0Var) {
this.f3626i = h0Var;
if (h0Var == h0.DEBUG_OFF) {
enableLog(false);
this.f3623f = this.j;
this.f3624g = this.p;
return;
}
enableLog(true);
setServerUrl(this.j);
d(this.p);
}
@Override
public void l(String str, JSONObject jSONObject, boolean z2) {
if (jSONObject == null) {
jSONObject = new JSONObject();
}
this.X.b(new b(z2, jSONObject, str));
}
@Override
public void l0(String str) {
D0(str, TimeUnit.SECONDS);
}
@Override
public JSONObject l1() {
return this.A;
}
public void l2(String str) {
this.c = str;
}
@Override
public void logout() {
this.X.b(new v());
}
@Override
public boolean m() {
return this.z;
}
@Override
public void m0(int i2) {
if (com.gaoding.analytics.android.sdk.data.a.v() == null) {
com.gaoding.analytics.android.sdk.x.c(j0, "The static method sharedInstance(context, serverURL, debugMode) should be called before calling sharedInstance()");
} else if (i2 >= 5000 && i2 <= 300000) {
com.gaoding.analytics.android.sdk.data.a.v().l(i2);
} else {
com.gaoding.analytics.android.sdk.x.c(j0, "SessionIntervalTime:" + i2 + " is invalid, session interval time is between 10s and 300s.");
}
}
@Override
public void m1(List<Class<?>> list) {
if (list == null || list.size() == 0) {
return;
}
if (this.S == null) {
this.S = new ArrayList();
}
for (Class<?> cls : list) {
if (cls != null) {
int hashCode = cls.hashCode();
if (!this.S.contains(Integer.valueOf(hashCode))) {
this.S.add(Integer.valueOf(hashCode));
}
}
}
}
public void m2(String str) {
this.b = str;
}
@Override
@Deprecated
public String n() {
return this.a;
}
@Override
public void n0(View view, boolean z2) {
if (view != null) {
view.setTag(R.id.gaoding_analytics_tag_view_ignored, z2 ? "1" : "0");
}
}
@Override
public JSONObject n1() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("project", U1());
if (!TextUtils.isEmpty(V1())) {
jSONObject.put("gdp_realtime_code", this.f3621d);
}
jSONObject.put("sdk_version", "1.0.4");
jSONObject.put("channel_code", this.f3622e);
jSONObject.put(FileDownloadModel.q, "/wind");
jSONObject.put("runtime", this.o.get("runtime"));
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
return jSONObject;
}
public void n2(String str) {
this.f3621d = str;
}
@Override
public void o(boolean z2) {
this.t = z2;
}
@Override
public void o0() {
this.C = true;
}
public boolean o1(String str) {
try {
if (TextUtils.isEmpty(str)) {
return false;
}
String optString = new JSONObject(str).optString("server_url");
if (TextUtils.isEmpty(optString) || !new x0(optString).a(new x0(this.f3623f))) {
return false;
}
p(str);
return true;
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
return false;
}
@Override
public void p(String str) {
try {
if (TextUtils.isEmpty(str)) {
return;
}
JSONObject jSONObject = new JSONObject(str);
String string = jSONObject.getString("type");
com.gaoding.analytics.android.sdk.m valueOf = com.gaoding.analytics.android.sdk.m.valueOf(string.toUpperCase());
if (valueOf == com.gaoding.analytics.android.sdk.m.TRACK_SIGNUP) {
jSONObject.put("original_id", C());
} else if (!TextUtils.isEmpty(k1())) {
jSONObject.put("distinct_id", k1());
} else {
jSONObject.put("distinct_id", C());
}
jSONObject.put(CrashHianalyticsData.TIME, System.currentTimeMillis());
try {
jSONObject.put("_track_id", new SecureRandom().nextInt());
} catch (Exception unused) {
}
JSONObject optJSONObject = jSONObject.optJSONObject("properties");
if (optJSONObject == null) {
optJSONObject = new JSONObject();
}
JSONObject optJSONObject2 = jSONObject.optJSONObject("lib");
if (optJSONObject2 != null) {
if (this.o.containsKey("$app_version")) {
optJSONObject2.put("$app_version", this.o.get("$app_version"));
}
JSONObject b2 = this.L.b();
if (b2 != null && b2.has("$app_version")) {
optJSONObject2.put("$app_version", b2.get("$app_version"));
}
}
if (valueOf.c()) {
if (this.o != null) {
for (Map.Entry<String, Object> entry : this.o.entrySet()) {
String key = entry.getKey();
if (!TextUtils.isEmpty(key) && !"$lib".equals(key) && !"$lib_version".equals(key)) {
optJSONObject.put(entry.getKey(), entry.getValue());
}
}
}
String D = com.gaoding.analytics.android.sdk.g1.e.D(this.H);
optJSONObject.put("$wifi", D.equals("WIFI"));
optJSONObject.put("$network_type", D);
synchronized (this.L) {
com.gaoding.analytics.android.sdk.g1.e.B(this.L.b(), optJSONObject);
}
e2(optJSONObject);
if (valueOf.c()) {
optJSONObject.put("$is_first_day", Z1());
}
}
if (jSONObject.has("_nocache")) {
jSONObject.remove("_nocache");
}
if (jSONObject.has("server_url")) {
jSONObject.remove("server_url");
}
if (optJSONObject.has("$project")) {
jSONObject.put("project", optJSONObject.optString("$project"));
optJSONObject.remove("$project");
}
if (optJSONObject.has("$token")) {
jSONObject.put("token", optJSONObject.optString("$token"));
optJSONObject.remove("$token");
}
if (valueOf == com.gaoding.analytics.android.sdk.m.TRACK_SIGNUP) {
String string2 = jSONObject.getString("distinct_id");
synchronized (this.K) {
if (!string2.equals(this.K.b())) {
this.K.a(string2);
if (!string2.equals(C())) {
this.I.k(string, jSONObject);
}
}
}
} else {
this.I.k(string, jSONObject);
}
com.gaoding.analytics.android.sdk.x.c(j0, "track event:\n" + com.gaoding.analytics.android.sdk.g1.c.b(jSONObject.toString()));
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public boolean p0() {
return this.t;
}
@Override
public boolean q(Class<?> cls) {
if (cls == null) {
return false;
}
List<Integer> list = this.S;
return ((list == null || !list.contains(Integer.valueOf(cls.hashCode()))) && cls.getAnnotation(m0.class) == null && cls.getAnnotation(l0.class) == null) ? false : true;
}
@Override
public void q0(String str, Object obj) {
this.X.b(new g(str, obj));
}
@Override
@Deprecated
public void r(g0 g0Var) {
if (g0Var != null && this.x.contains(g0Var)) {
this.x.remove(g0Var);
}
}
@Override
public String r0() {
return this.q;
}
@Override
public void resetAnonymousId() {
synchronized (this.J) {
if (com.gaoding.analytics.android.sdk.g1.e.A(i0)) {
this.J.a(i0);
} else {
this.J.a(UUID.randomUUID().toString());
}
}
}
@Override
public void s(String str, boolean z2) {
try {
if (TextUtils.isEmpty(str)) {
return;
}
JSONObject jSONObject = new JSONObject(str);
if (z2) {
String optString = jSONObject.optString("server_url");
if (TextUtils.isEmpty(optString) || !new x0(optString).a(new x0(this.f3623f))) {
return;
}
}
p(str);
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void s0(double d2, double d3) {
try {
if (q0 == null) {
q0 = new com.gaoding.analytics.android.sdk.i0();
}
q0.c((long) (d2 * Math.pow(10.0d, 6.0d)));
q0.d((long) (d3 * Math.pow(10.0d, 6.0d)));
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void setFlushBulkSize(int i2) {
this.l = Math.max(50, i2);
}
@Override
public void setFlushInterval(int i2) {
this.k = Math.max(5000, i2);
}
@Override
public void setFlushNetworkPolicy(int i2) {
this.V = i2;
}
@Override
public void setMaxCacheSize(long j2) {
if (j2 > 0) {
this.v = Math.max(16777216L, j2);
}
}
@Override
public void setServerUrl(String str) {
try {
this.j = str;
if (!TextUtils.isEmpty(str) && this.f3626i != h0.DEBUG_OFF) {
Uri parse = Uri.parse(str);
String host = parse.getHost();
if (!TextUtils.isEmpty(host) && host.contains("_")) {
com.gaoding.analytics.android.sdk.x.c(j0, "Server url " + str + " contains '_' is not recommend,see details: https://en.wikipedia.org/wiki/Hostname");
}
this.f3623f = parse.toString();
return;
}
this.f3623f = str;
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void t(String str, JSONObject jSONObject) {
this.X.b(new u(str, jSONObject));
}
@Override
public boolean t0() {
return this.B;
}
@Override
public void track(String str) {
this.X.b(new RunnableC0152a0(str));
}
@Override
@Deprecated
public void u(String str) {
this.X.b(new f0(str));
}
@Override
@SuppressLint({"SetJavaScriptEnabled", "addJavascriptInterface"})
public void u0(WebView webView, boolean z2) {
b0(webView, z2, null);
}
@Override
public String v() {
return this.f3625h;
}
@Override
public void v0(String str, boolean z2) {
try {
if (z2) {
this.W = URLEncoder.encode(str, "UTF-8");
} else {
this.W = str;
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
public void v2() {
this.X.b(new r());
}
@Override
public void w() {
try {
if (this.b0 != null) {
this.b0.disable();
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void w0(List<Class<?>> list) {
if (list == null || list.size() == 0) {
return;
}
if (this.S == null) {
this.S = new ArrayList();
}
try {
for (Class<?> cls : list) {
if (cls != null) {
int hashCode = cls.hashCode();
if (this.S.contains(Integer.valueOf(hashCode))) {
this.S.remove(Integer.valueOf(hashCode));
}
}
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void x(String str) {
try {
synchronized (this.L) {
JSONObject b2 = this.L.b();
b2.remove(str);
this.L.a(b2);
}
} catch (Exception e2) {
com.gaoding.analytics.android.sdk.x.h(e2);
}
}
@Override
public void x0(JSONObject jSONObject) {
this.X.b(new f(jSONObject));
}
public void x2(final String str, String str2, final JSONObject jSONObject) {
try {
jSONObject.put(com.gaoding.analytics.android.sdk.c.B, str2);
} catch (JSONException e2) {
e2.printStackTrace();
}
z0 z0Var = this.X;
if (z0Var != null) {
z0Var.b(new Runnable() {
@Override
public final void run() {
a0.this.d2(str, jSONObject);
}
});
}
}
@Override
public void y(boolean z2) {
this.E = z2;
}
@Override
public boolean y0(g0 g0Var) {
p0 p0Var = p0;
if (p0Var == null || p0Var.b() == -1) {
return (g0Var == null || this.x.contains(g0Var)) ? false : true;
} else if (p0.b() == 0) {
return true;
} else {
return p0.i(g0Var);
}
}
@Override
public Set<Integer> z() {
return this.U;
}
@Override
public void z0(String str, JSONObject jSONObject) {
this.X.b(new x(str, jSONObject));
}
public a0() {
this.f3625h = "";
this.f3626i = h0.DEBUG_OFF;
this.t = true;
this.u = true;
this.v = 33554432L;
this.y = new ArrayList();
this.D = false;
this.E = true;
this.F = false;
this.G = false;
this.V = 14;
this.c0 = new ArrayList();
this.H = null;
this.I = null;
this.J = null;
this.K = null;
this.L = null;
this.M = null;
this.N = null;
this.w = null;
this.O = null;
this.P = null;
this.Q = null;
this.o = null;
this.R = null;
this.a = null;
}
}