package p138.p176.p291.p320;

import android.os.Bundle;
import android.util.Log;
import com.google.firebase.iid.FirebaseInstanceId;
import java.io.IOException;
import p138.p176.p177.p242.p246.p251.C4303;
import p138.p176.p177.p242.p270.AbstractC5062;
import p138.p176.p177.p242.p270.C5063;
import p138.p176.p177.p242.p270.InterfaceC5056;
import p138.p176.p177.p242.p270.InterfaceC5061;

/* JADX INFO: renamed from: ދ.ހ.ށ.ވ.ࢨ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class C5954 {

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

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

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final String f16772;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final String f16773;

    public C5954(FirebaseInstanceId firebaseInstanceId, String str, String str2, String str3) {
        this.f16770 = firebaseInstanceId;
        this.f16771 = str;
        this.f16772 = str2;
        this.f16773 = str3;
    }

    /* JADX WARN: Type inference incomplete: some casts might be missing */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final AbstractC5062 m9291() {
        final FirebaseInstanceId firebaseInstanceId = this.f16770;
        final String str = this.f16771;
        final String str2 = this.f16772;
        final String str3 = this.f16773;
        final C5958 c5958 = firebaseInstanceId.f2145;
        if (c5958 == null) {
            throw null;
        }
        final Bundle bundle = new Bundle();
        final C5063 c5063 = new C5063();
        c5958.f16786.execute(new Runnable(c5958, str, str2, str3, bundle, c5063) { // from class: ދ.ހ.ށ.ވ.ࢫ

            /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
            public final C5958 f16777;

            /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
            public final String f16778;

            /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
            public final String f16779;

            /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
            public final String f16780;

            /* JADX INFO: renamed from: އ, reason: contains not printable characters */
            public final Bundle f16781;

            /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
            public final C5063 f16782;

            {
                this.f16777 = c5958;
                this.f16778 = str;
                this.f16779 = str2;
                this.f16780 = str3;
                this.f16781 = bundle;
                this.f16782 = c5063;
            }

            /* JADX WARN: Type inference incomplete: some casts might be missing */
            @Override // java.lang.Runnable
            public final void run() {
                C5958 c59582 = this.f16777;
                String str4 = this.f16778;
                String str5 = this.f16779;
                String str6 = this.f16780;
                Bundle bundle2 = this.f16781;
                C5063 c50632 = this.f16782;
                if (c59582 == null) {
                    throw null;
                }
                try {
                    c59582.m9292(str4, str5, str6, bundle2);
                    c50632.f15214.m8562((TResult) c59582.f16785.m9260(bundle2));
                } catch (IOException e) {
                    c50632.f15214.m8561((Exception) e);
                }
            }
        });
        return c5063.f15214.mo8545(c5958.f16786, (InterfaceC5056<TResult, TContinuationResult>) new InterfaceC5056(c5958) { // from class: ދ.ހ.ށ.ވ.ೱ
            @Override // p138.p176.p177.p242.p270.InterfaceC5056
            /* JADX INFO: renamed from: ֏ */
            public final Object mo8537(AbstractC5062 abstractC5062) throws IOException {
                Bundle bundle2 = (Bundle) abstractC5062.mo8544(IOException.class);
                if (bundle2 == null) {
                    throw new IOException("SERVICE_NOT_AVAILABLE");
                }
                String string = bundle2.getString("registration_id");
                if (string != null) {
                    return string;
                }
                String string2 = bundle2.getString("unregistered");
                if (string2 != null) {
                    return string2;
                }
                String string3 = bundle2.getString("error");
                if ("RST".equals(string3)) {
                    throw new IOException("INSTANCE_ID_RESET");
                }
                if (string3 != null) {
                    throw new IOException(string3);
                }
                String strValueOf = String.valueOf(bundle2);
                StringBuilder sb = new StringBuilder(strValueOf.length() + 21);
                sb.append("Unexpected response: ");
                sb.append(strValueOf);
                Log.w("FirebaseInstanceId", sb.toString(), new Throwable());
                throw new IOException("SERVICE_NOT_AVAILABLE");
            }
        }).mo8550(firebaseInstanceId.f2142, new InterfaceC5061(firebaseInstanceId, str2, str3, str) { // from class: ދ.ހ.ށ.ވ.ࢧ

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

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

            /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
            public final String f16768;

            /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
            public final String f16769;

            {
                this.f16766 = firebaseInstanceId;
                this.f16767 = str2;
                this.f16768 = str3;
                this.f16769 = str;
            }

            @Override // p138.p176.p177.p242.p270.InterfaceC5061
            /* JADX INFO: renamed from: ֏ */
            public final AbstractC5062 mo8542(Object obj) {
                FirebaseInstanceId firebaseInstanceId2 = this.f16766;
                String str4 = this.f16767;
                String str5 = this.f16768;
                String str6 = this.f16769;
                String str7 = (String) obj;
                FirebaseInstanceId.f2140.m9276(firebaseInstanceId2.m1434(), str4, str5, str7, firebaseInstanceId2.f2144.m9252());
                return C4303.m7054(new C5908(str6, str7));
            }
        });
    }
}
