package o;

import android.content.Context;
import android.os.Bundle;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Looper;
import android.os.Parcel;
import android.os.RemoteException;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.internal.BaseGmsClient;
import com.google.android.gms.common.internal.ClientSettings;
import com.google.android.gms.common.internal.GmsClient;
import com.google.android.gms.common.internal.IAccountAccessor;
import com.google.android.gms.common.internal.Preconditions;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class G80 extends GmsClient implements InterfaceC1989nn0 {
    public final boolean a;
    public final ClientSettings b;
    public final Bundle c;
    public final Integer d;

    public G80(Context context, Looper looper, ClientSettings clientSettings, Bundle bundle, GoogleApiClient.ConnectionCallbacks connectionCallbacks, GoogleApiClient.OnConnectionFailedListener onConnectionFailedListener) {
        super(context, looper, 44, clientSettings, connectionCallbacks, onConnectionFailedListener);
        this.a = true;
        this.b = clientSettings;
        this.c = bundle;
        this.d = clientSettings.zab();
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // o.InterfaceC1989nn0
    public final void a(IAccountAccessor iAccountAccessor, boolean z) {
        try {
            C2274qn0 c2274qn0 = (C2274qn0) getService();
            int iIntValue = ((Integer) Preconditions.checkNotNull(this.d)).intValue();
            Parcel parcelZaa = c2274qn0.zaa();
            AbstractC1609jn0.d(parcelZaa, iAccountAccessor);
            parcelZaa.writeInt(iIntValue);
            parcelZaa.writeInt(z ? 1 : 0);
            c2274qn0.zac(9, parcelZaa);
        } catch (RemoteException unused) {
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:14:0x003f  */
    @Override // o.InterfaceC1989nn0
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void b(o.AbstractBinderC1514in0 r7) throws java.lang.NumberFormatException {
        /*
            r6 = this;
            java.lang.String r0 = "Expecting a valid ISignInCallbacks"
            com.google.android.gms.common.internal.Preconditions.checkNotNull(r7, r0)
            r0 = 1
            r1 = 0
            com.google.android.gms.common.internal.ClientSettings r2 = r6.b     // Catch: android.os.RemoteException -> L3d
            android.accounts.Account r2 = r2.getAccountOrDefault()     // Catch: android.os.RemoteException -> L3d
            java.lang.String r3 = "<<default account>>"
            java.lang.String r4 = r2.name     // Catch: android.os.RemoteException -> L3d
            boolean r3 = r3.equals(r4)     // Catch: android.os.RemoteException -> L3d
            if (r3 == 0) goto L3f
            android.content.Context r3 = r6.getContext()     // Catch: android.os.RemoteException -> L3d
            o.Pa0 r3 = o.Pa0.a(r3)     // Catch: android.os.RemoteException -> L3d
            java.lang.String r4 = "defaultGoogleSignInAccount"
            java.lang.String r4 = r3.b(r4)     // Catch: android.os.RemoteException -> L3d
            boolean r5 = android.text.TextUtils.isEmpty(r4)     // Catch: android.os.RemoteException -> L3d
            if (r5 == 0) goto L2c
            goto L3f
        L2c:
            java.lang.String r5 = "googleSignInAccount"
            java.lang.String r4 = o.Pa0.d(r5, r4)     // Catch: android.os.RemoteException -> L3d
            java.lang.String r3 = r3.b(r4)     // Catch: android.os.RemoteException -> L3d
            if (r3 == 0) goto L3f
            com.google.android.gms.auth.api.signin.GoogleSignInAccount r3 = com.google.android.gms.auth.api.signin.GoogleSignInAccount.c(r3)     // Catch: android.os.RemoteException -> L3d org.json.JSONException -> L3f
            goto L40
        L3d:
            r2 = move-exception
            goto L6c
        L3f:
            r3 = r1
        L40:
            com.google.android.gms.common.internal.zat r4 = new com.google.android.gms.common.internal.zat     // Catch: android.os.RemoteException -> L3d
            java.lang.Integer r5 = r6.d     // Catch: android.os.RemoteException -> L3d
            java.lang.Object r5 = com.google.android.gms.common.internal.Preconditions.checkNotNull(r5)     // Catch: android.os.RemoteException -> L3d
            java.lang.Integer r5 = (java.lang.Integer) r5     // Catch: android.os.RemoteException -> L3d
            int r5 = r5.intValue()     // Catch: android.os.RemoteException -> L3d
            r4.<init>(r2, r5, r3)     // Catch: android.os.RemoteException -> L3d
            android.os.IInterface r2 = r6.getService()     // Catch: android.os.RemoteException -> L3d
            o.qn0 r2 = (o.C2274qn0) r2     // Catch: android.os.RemoteException -> L3d
            o.un0 r3 = new o.un0     // Catch: android.os.RemoteException -> L3d
            r3.<init>(r0, r4)     // Catch: android.os.RemoteException -> L3d
            android.os.Parcel r4 = r2.zaa()     // Catch: android.os.RemoteException -> L3d
            o.AbstractC1609jn0.c(r4, r3)     // Catch: android.os.RemoteException -> L3d
            o.AbstractC1609jn0.d(r4, r7)     // Catch: android.os.RemoteException -> L3d
            r3 = 12
            r2.zac(r3, r4)     // Catch: android.os.RemoteException -> L3d
            goto L7b
        L6c:
            o.xn0 r3 = new o.xn0     // Catch: android.os.RemoteException -> L7c
            com.google.android.gms.common.ConnectionResult r4 = new com.google.android.gms.common.ConnectionResult     // Catch: android.os.RemoteException -> L7c
            r5 = 8
            r4.<init>(r5, r1)     // Catch: android.os.RemoteException -> L7c
            r3.<init>(r0, r4, r1)     // Catch: android.os.RemoteException -> L7c
            r7.zab(r3)     // Catch: android.os.RemoteException -> L7c
        L7b:
            return
        L7c:
            java.lang.String r7 = "SignInClientImpl"
            java.lang.String r0 = "ISignInCallbacks#onSignInComplete should be executed from the same process, unexpected RemoteException."
            android.util.Log.wtf(r7, r0, r2)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: o.G80.b(o.in0):void");
    }

    @Override // com.google.android.gms.common.internal.BaseGmsClient
    public final IInterface createServiceInterface(IBinder iBinder) {
        if (iBinder == null) {
            return null;
        }
        IInterface iInterfaceQueryLocalInterface = iBinder.queryLocalInterface("com.google.android.gms.signin.internal.ISignInService");
        return iInterfaceQueryLocalInterface instanceof C2274qn0 ? (C2274qn0) iInterfaceQueryLocalInterface : new C2274qn0(iBinder, "com.google.android.gms.signin.internal.ISignInService");
    }

    @Override // com.google.android.gms.common.internal.BaseGmsClient
    public final Bundle getGetServiceRequestExtraArgs() {
        ClientSettings clientSettings = this.b;
        boolean zEquals = getContext().getPackageName().equals(clientSettings.getRealClientPackageName());
        Bundle bundle = this.c;
        if (!zEquals) {
            bundle.putString("com.google.android.gms.signin.internal.realClientPackageName", clientSettings.getRealClientPackageName());
        }
        return bundle;
    }

    @Override // com.google.android.gms.common.internal.BaseGmsClient, com.google.android.gms.common.api.Api.Client
    public final int getMinApkVersion() {
        return 12451000;
    }

    @Override // com.google.android.gms.common.internal.BaseGmsClient
    public final String getServiceDescriptor() {
        return "com.google.android.gms.signin.internal.ISignInService";
    }

    @Override // com.google.android.gms.common.internal.BaseGmsClient
    public final String getStartServiceAction() {
        return "com.google.android.gms.signin.service.START";
    }

    @Override // com.google.android.gms.common.internal.BaseGmsClient, com.google.android.gms.common.api.Api.Client
    public final boolean requiresSignIn() {
        return this.a;
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // o.InterfaceC1989nn0
    public final void zaa() {
        try {
            C2274qn0 c2274qn0 = (C2274qn0) getService();
            int iIntValue = ((Integer) Preconditions.checkNotNull(this.d)).intValue();
            Parcel parcelZaa = c2274qn0.zaa();
            parcelZaa.writeInt(iIntValue);
            c2274qn0.zac(7, parcelZaa);
        } catch (RemoteException unused) {
        }
    }

    @Override // o.InterfaceC1989nn0
    public final void zab() {
        connect(new BaseGmsClient.LegacyClientCallbackAdapter());
    }
}
