package p138.p176.p291.p296.p297.p298;

import android.os.Bundle;
import org.json.JSONException;
import org.json.JSONObject;
import p138.p176.p291.p292.p293.InterfaceC5566;
import p138.p176.p291.p296.p297.C5608;
import p138.p176.p291.p296.p297.p298.InterfaceC5619;
import p138.p176.p291.p296.p297.p299.C5642;
import p138.p176.p291.p296.p297.p299.C5668;
import p138.p176.p291.p296.p297.p299.C5670;
import p138.p176.p291.p296.p297.p299.CallableC5635;

/* JADX INFO: renamed from: ދ.ހ.ށ.ބ.ށ.ކ.֏, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C5617 implements InterfaceC5566.InterfaceC5568, InterfaceC5619 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final InterfaceC5566 f16088;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final InterfaceC5618 f16089;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public InterfaceC5619.InterfaceC5620 f16090;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public InterfaceC5566.InterfaceC5567 f16091;

    /* JADX INFO: renamed from: ދ.ހ.ށ.ބ.ށ.ކ.֏$֏, reason: contains not printable characters */
    public interface InterfaceC5618 {
    }

    public C5617(InterfaceC5566 interfaceC5566, InterfaceC5618 interfaceC5618) {
        this.f16088 = interfaceC5566;
        this.f16089 = interfaceC5618;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static String m8981(String str, Bundle bundle) throws JSONException {
        JSONObject jSONObject = new JSONObject();
        JSONObject jSONObject2 = new JSONObject();
        for (String str2 : bundle.keySet()) {
            jSONObject2.put(str2, bundle.get(str2));
        }
        jSONObject.put("name", str);
        jSONObject.put("parameters", jSONObject2);
        return jSONObject.toString();
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m8982(int i, Bundle bundle) {
        C5608.f16066.m8972("AnalyticsConnectorReceiver received message: " + i + " " + bundle);
        if (bundle == null) {
            return;
        }
        Bundle bundle2 = bundle.getBundle("params");
        if (bundle2 == null) {
            bundle2 = new Bundle();
        }
        if ("clx".equals(bundle2.getString("_o"))) {
            InterfaceC5619.InterfaceC5620 interfaceC5620 = this.f16090;
            if (interfaceC5620 != null) {
                C5642.C5650 c5650 = (C5642.C5650) interfaceC5620;
                if ("_ae".equals(bundle.getString("name"))) {
                    c5650.f16189.countDown();
                    return;
                }
                return;
            }
            return;
        }
        String string = bundle.getString("name");
        if (string != null) {
            try {
                String str = "$A$:" + m8981(string, bundle2);
                C5670 c5670 = ((C5668) this.f16089).f16221;
                if (c5670 == null) {
                    throw null;
                }
                long jCurrentTimeMillis = System.currentTimeMillis() - c5670.f16227;
                C5642 c5642 = c5670.f16230;
                c5642.f16160.m9012(new CallableC5635(c5642, jCurrentTimeMillis, str));
            } catch (JSONException unused) {
                C5608.f16066.m8977("Unable to serialize Firebase Analytics event.");
            }
        }
    }
}
