package com.google.android.gms.auth.api.signin;

import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import com.google.android.gms.common.api.Scope;
import com.google.android.gms.common.internal.ReflectedParcelable;
import defpackage.AbstractC0106;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes3.dex */
@Deprecated
public class GoogleSignInAccount extends AbstractC0106 implements ReflectedParcelable {
    public static final Parcelable.Creator<GoogleSignInAccount> CREATOR = new ᵩᵭᵾʟ(3);

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public final String f1003;

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public String f1004;

    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public final HashSet f1005 = new HashSet();

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final int f1006;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public final long f1007;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public final List f1008;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final String f1009;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final String f1010;

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public final String f1011;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final String f1012;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public final String f1013;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public final Uri f1014;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public final String f1015;

    public GoogleSignInAccount(int i, String str, String str2, String str3, String str4, Uri uri, String str5, long j, String str6, ArrayList arrayList, String str7, String str8) {
        this.f1006 = i;
        this.f1010 = str;
        this.f1009 = str2;
        this.f1012 = str3;
        this.f1013 = str4;
        this.f1014 = uri;
        this.f1004 = str5;
        this.f1007 = j;
        this.f1015 = str6;
        this.f1008 = arrayList;
        this.f1003 = str7;
        this.f1011 = str8;
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public static GoogleSignInAccount m806(String str) throws JSONException {
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        JSONObject jSONObject = new JSONObject(str);
        String strOptString = jSONObject.optString("photoUrl");
        Uri uri = !TextUtils.isEmpty(strOptString) ? Uri.parse(strOptString) : null;
        long j = Long.parseLong(jSONObject.getString("expirationTime"));
        HashSet hashSet = new HashSet();
        JSONArray jSONArray = jSONObject.getJSONArray("grantedScopes");
        int length = jSONArray.length();
        for (int i = 0; i < length; i++) {
            hashSet.add(new Scope(1, jSONArray.getString(i)));
        }
        String strOptString2 = jSONObject.optString("id");
        String strOptString3 = jSONObject.has("tokenId") ? jSONObject.optString("tokenId") : null;
        String strOptString4 = jSONObject.has("email") ? jSONObject.optString("email") : null;
        String strOptString5 = jSONObject.has("displayName") ? jSONObject.optString("displayName") : null;
        String strOptString6 = jSONObject.has("givenName") ? jSONObject.optString("givenName") : null;
        String strOptString7 = jSONObject.has("familyName") ? jSONObject.optString("familyName") : null;
        String string = jSONObject.getString("obfuscatedIdentifier");
        ᵘᵞʿⁱ.ˊᵫᵗ(string);
        GoogleSignInAccount googleSignInAccount = new GoogleSignInAccount(3, strOptString2, strOptString3, strOptString4, strOptString5, uri, null, j, string, new ArrayList(hashSet), strOptString6, strOptString7);
        googleSignInAccount.f1004 = jSONObject.has("serverAuthCode") ? jSONObject.optString("serverAuthCode") : null;
        return googleSignInAccount;
    }

    public final boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof GoogleSignInAccount)) {
            return false;
        }
        GoogleSignInAccount googleSignInAccount = (GoogleSignInAccount) obj;
        if (!googleSignInAccount.f1015.equals(this.f1015)) {
            return false;
        }
        HashSet hashSet = new HashSet(googleSignInAccount.f1008);
        hashSet.addAll(googleSignInAccount.f1005);
        HashSet hashSet2 = new HashSet(this.f1008);
        hashSet2.addAll(this.f1005);
        return hashSet.equals(hashSet2);
    }

    public final int hashCode() {
        int iHashCode = this.f1015.hashCode() + 527;
        HashSet hashSet = new HashSet(this.f1008);
        hashSet.addAll(this.f1005);
        return (iHashCode * 31) + hashSet.hashCode();
    }

    @Override // android.os.Parcelable
    public final void writeToParcel(Parcel parcel, int i) {
        int i2 = ᵱˉˈ.ˏᵩʨ(parcel, 20293);
        ᵱˉˈ.ˀᵗ(parcel, 1, 4);
        parcel.writeInt(this.f1006);
        ᵱˉˈ.ᵨˈʼﹶ(parcel, 2, this.f1010);
        ᵱˉˈ.ᵨˈʼﹶ(parcel, 3, this.f1009);
        ᵱˉˈ.ᵨˈʼﹶ(parcel, 4, this.f1012);
        ᵱˉˈ.ᵨˈʼﹶ(parcel, 5, this.f1013);
        ᵱˉˈ.ˈⁱᵡ(parcel, 6, this.f1014, i);
        ᵱˉˈ.ᵨˈʼﹶ(parcel, 7, this.f1004);
        ᵱˉˈ.ˀᵗ(parcel, 8, 8);
        parcel.writeLong(this.f1007);
        ᵱˉˈ.ᵨˈʼﹶ(parcel, 9, this.f1015);
        ᵱˉˈ.ˊˌˊ(parcel, 10, this.f1008);
        ᵱˉˈ.ᵨˈʼﹶ(parcel, 11, this.f1003);
        ᵱˉˈ.ᵨˈʼﹶ(parcel, 12, this.f1011);
        ᵱˉˈ.ᵛˀˊ(parcel, i2);
    }
}
