what-the-bank/sources/com/google/android/gms/auth/api/credentials/CredentialRequest.java

166 lines
5.7 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.android.gms.auth.api.credentials;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.auth.api.credentials.CredentialPickerConfig;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
/* loaded from: classes.dex */
public final class CredentialRequest extends AbstractSafeParcelable {
public static final Parcelable.Creator<CredentialRequest> CREATOR = new zzg();
private final boolean zzaa;
private final String[] zzab;
private final CredentialPickerConfig zzac;
private final CredentialPickerConfig zzad;
private final boolean zzae;
private final String zzaf;
private final String zzag;
private final boolean zzah;
private final int zzv;
/* JADX INFO: Access modifiers changed from: package-private */
public CredentialRequest(int i, boolean z, String[] strArr, CredentialPickerConfig credentialPickerConfig, CredentialPickerConfig credentialPickerConfig2, boolean z2, String str, String str2, boolean z3) {
this.zzv = i;
this.zzaa = z;
this.zzab = (String[]) Preconditions.checkNotNull(strArr);
this.zzac = credentialPickerConfig == null ? new CredentialPickerConfig.Builder().build() : credentialPickerConfig;
this.zzad = credentialPickerConfig2 == null ? new CredentialPickerConfig.Builder().build() : credentialPickerConfig2;
if (i < 3) {
this.zzae = true;
this.zzaf = null;
this.zzag = null;
} else {
this.zzae = z2;
this.zzaf = str;
this.zzag = str2;
}
this.zzah = z3;
}
/* loaded from: classes.dex */
public static final class Builder {
private boolean zzaa;
private String[] zzab;
private CredentialPickerConfig zzac;
private CredentialPickerConfig zzad;
private String zzag;
private boolean zzae = false;
private boolean zzah = false;
private String zzaf = null;
@Deprecated
public final Builder setSupportsPasswordLogin(boolean z) {
return setPasswordLoginSupported(z);
}
public final CredentialRequest build() {
if (this.zzab == null) {
this.zzab = new String[0];
}
if (!this.zzaa && this.zzab.length == 0) {
throw new IllegalStateException("At least one authentication method must be specified");
}
return new CredentialRequest(this);
}
public final Builder setServerClientId(String str) {
this.zzaf = str;
return this;
}
public final Builder setPasswordLoginSupported(boolean z) {
this.zzaa = z;
return this;
}
public final Builder setIdTokenRequested(boolean z) {
this.zzae = z;
return this;
}
public final Builder setIdTokenNonce(String str) {
this.zzag = str;
return this;
}
public final Builder setCredentialPickerConfig(CredentialPickerConfig credentialPickerConfig) {
this.zzac = credentialPickerConfig;
return this;
}
public final Builder setCredentialHintPickerConfig(CredentialPickerConfig credentialPickerConfig) {
this.zzad = credentialPickerConfig;
return this;
}
public final Builder setAccountTypes(String... strArr) {
if (strArr == null) {
strArr = new String[0];
}
this.zzab = strArr;
return this;
}
}
private CredentialRequest(Builder builder) {
this(4, builder.zzaa, builder.zzab, builder.zzac, builder.zzad, builder.zzae, builder.zzaf, builder.zzag, false);
}
@Deprecated
public final boolean getSupportsPasswordLogin() {
return isPasswordLoginSupported();
}
public final Set<String> getAccountTypesSet() {
return new HashSet(Arrays.asList(this.zzab));
}
@Override // android.os.Parcelable
public final void writeToParcel(Parcel parcel, int i) {
int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
SafeParcelWriter.writeBoolean(parcel, 1, isPasswordLoginSupported());
SafeParcelWriter.writeStringArray(parcel, 2, getAccountTypes(), false);
SafeParcelWriter.writeParcelable(parcel, 3, getCredentialPickerConfig(), i, false);
SafeParcelWriter.writeParcelable(parcel, 4, getCredentialHintPickerConfig(), i, false);
SafeParcelWriter.writeBoolean(parcel, 5, isIdTokenRequested());
SafeParcelWriter.writeString(parcel, 6, getServerClientId(), false);
SafeParcelWriter.writeString(parcel, 7, getIdTokenNonce(), false);
SafeParcelWriter.writeBoolean(parcel, 8, this.zzah);
SafeParcelWriter.writeInt(parcel, 1000, this.zzv);
SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader);
}
public final boolean isPasswordLoginSupported() {
return this.zzaa;
}
public final boolean isIdTokenRequested() {
return this.zzae;
}
public final String getServerClientId() {
return this.zzaf;
}
public final String getIdTokenNonce() {
return this.zzag;
}
public final CredentialPickerConfig getCredentialPickerConfig() {
return this.zzac;
}
public final CredentialPickerConfig getCredentialHintPickerConfig() {
return this.zzad;
}
public final String[] getAccountTypes() {
return this.zzab;
}
}