package X; import android.os.Looper; import android.text.TextUtils; import com.bytedance.android.monitor.HybridMonitor; import com.bytedance.covode.number.Covode; import java.util.Set; import org.json.JSONObject; public final class JZ6 implements JZF { public JZE LIZ; static { Covode.recordClassIndex(17712); } public static void LIZ(JZ9 jz9) { AnonymousClass2ZH.LIZIZ("DataMonitor", "monitorCustom: ".concat(String.valueOf(jz9))); if (jz9 != null) { JSONObject jSONObject = new JSONObject(); if (jz9.LIZLLL != null) { JZ7.LIZ(jSONObject, "client_category", jz9.LIZLLL); } if (jz9.LJ != null) { JZ7.LIZ(jSONObject, "client_metric", jz9.LJ); } if (jz9.LJFF != null) { JZ7.LIZ(jz9.LJFF, "event_name", jz9.LIZJ); JZ7.LIZ(jSONObject, "client_extra", jz9.LJFF); } if (jz9.LJI != null) { JZ7.LIZ(jSONObject, "client_timing", jz9.LJI); } String str = jz9.LJIIIZ ? "samplecustom" : "newcustom"; String str2 = jz9.LIZ; JZ7.LIZ(jSONObject, "url", str2); if (str2 != null) { JZ7.LIZ(jSONObject, "host", JZC.LIZIZ(str2)); JZ7.LIZ(jSONObject, "path", JZC.LIZ(str2)); } JZ7.LIZ(jSONObject, "ev_type", "custom"); JZ7.LIZ(jSONObject, jz9.LJII); if (!TextUtils.isEmpty(jz9.LJIIIIZZ)) { JZ7.LIZ(jSONObject, "virtual_aid", jz9.LJIIIIZZ); } LIZ(jz9.LJIIJ, jSONObject, str, jz9.LIZIZ); } } public static void LIZ(JZA jza, JZE jze) { if (jza == null) { throw new NullPointerException("data should not be null"); } else if (jze != null) { try { JSONObject jSONObject = new JSONObject(); JZ7.LIZ(jSONObject, "event_type", jza.LJII()); if (jza.LIZIZ() != null) { JZ7.LIZ(jSONObject, "nativeBase", jza.LIZIZ().LIZ()); } if (jza.LJ() != null) { JZ7.LIZ(jSONObject, "nativeInfo", jza.LJ().LIZ()); } if (jza.LIZJ() != null) { JZ7.LIZ(jSONObject, "jsInfo", jza.LIZJ()); } if (jza.LIZLLL() != null) { JZ7.LIZ(jSONObject, "jsBase", jza.LIZLLL()); } if (jza.LJI() != null) { JZ7.LIZ(jSONObject, "containerBase", jza.LJI().LIZ()); } if (jza.LJFF() != null) { JZ7.LIZ(jSONObject, "containerInfo", jza.LJFF().LIZ()); } LIZ(jze, jSONObject, jza.LJII(), jza.LJIIIIZZ(), jza.LJIIIZ(), !LIZ(jza.LJII())); } catch (Throwable unused) { HybridMonitor.getInstance().getExceptionHandler(); } } else { throw new NullPointerException("monitor should not be null"); } } public static void LIZ(JZE jze, JSONObject jSONObject, String str, String str2) { if (jze != null) { try { LIZ(jze, jSONObject, str, "", str2, false); } catch (Throwable th) { HybridMonitor.getInstance().getExceptionHandler(); AnonymousClass2ZH.LIZJ("DataMonitor", "monitorCustom error: " + th.getMessage()); } } else { throw new NullPointerException("monitor should not be null"); } } public static void LIZ(JZE jze, JSONObject jSONObject, String str, String str2, String str3, boolean z) { JSONObject jSONObject2 = new JSONObject(); JZ7.LIZ(jSONObject2, "extra", jSONObject); String LIZ2 = C63202eL.LIZ(str, str2, str3); HybridMonitor.getInstance().notifyReportInterceptor(LIZ2, str, str2, jSONObject2); if (jze != null && LIZ(jSONObject2, LIZ2)) { jze.LIZ(LIZ2, jSONObject2); AnonymousClass2ZH.LIZIZ("DataMonitor", jze + " do report: " + LIZ2); } if (z) { AnonymousClass2ZH.LIZIZ("BDHybridMonitor", AnonymousClass0EJ.LIZ("service:%s,data:%s", new Object[]{LIZ2, jSONObject2})); } } public static boolean LIZ(String str) { return "jsbPerf".equals(str); } public static boolean LIZ(JSONObject jSONObject, String str) { String str2 = null; if (str != null) { try { JSONObject LIZJ = JZ7.LIZJ(jSONObject, "extra"); str2 = JZ7.LIZIZ(LIZJ, "virtual_aid"); if (TextUtils.isEmpty(str2)) { str2 = JZ7.LIZIZ(JZ7.LIZJ(LIZJ, "nativeBase"), "virtual_aid"); } } catch (Throwable unused) { HybridMonitor.getInstance().getExceptionHandler(); return true; } } if (TextUtils.isEmpty(str2)) { str2 = JF4.LIZJ; } AnonymousClass2ZR LIZ2 = AnonymousClass2ZR.LIZ(); if (!TextUtils.isEmpty(str2)) { if (!TextUtils.isEmpty(str)) { Set<String> set = LIZ2.LIZ.get(str2); if (set != null) { if (!set.contains("all")) { if (!set.contains(str)) { } } return false; } } } return true; } @Override // X.JZF public final void LIZ(JZA jza) { if (Looper.getMainLooper() == Looper.myLooper()) { C63362eb.LIZ.LIZ().submit(new JZB(this, jza)); } else { LIZ(jza, this.LIZ); } } }