- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
278 lines
13 KiB
Java
278 lines
13 KiB
Java
package androidx.credentials;
|
|
|
|
import android.graphics.drawable.Icon;
|
|
import android.os.Bundle;
|
|
import android.text.TextUtils;
|
|
import androidx.annotation.RequiresApi;
|
|
import androidx.annotation.RestrictTo;
|
|
import androidx.credentials.internal.FrameworkClassParsingException;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
|
|
/* loaded from: classes.dex */
|
|
public abstract class CreateCredentialRequest {
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
public static final String BUNDLE_KEY_IS_AUTO_SELECT_ALLOWED = "androidx.credentials.BUNDLE_KEY_IS_AUTO_SELECT_ALLOWED";
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
public static final String BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS = "androidx.credentials.BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS";
|
|
public static final Companion Companion = new Companion(null);
|
|
private final Bundle candidateQueryData;
|
|
private final Bundle credentialData;
|
|
private final DisplayInfo displayInfo;
|
|
private final boolean isAutoSelectAllowed;
|
|
private final boolean isSystemProviderRequired;
|
|
private final String origin;
|
|
private final boolean preferImmediatelyAvailableCredentials;
|
|
private final String type;
|
|
|
|
@RequiresApi(34)
|
|
public static final CreateCredentialRequest createFrom(android.credentials.CreateCredentialRequest createCredentialRequest) {
|
|
return Companion.createFrom(createCredentialRequest);
|
|
}
|
|
|
|
@RequiresApi(23)
|
|
public static final CreateCredentialRequest createFrom(String str, Bundle bundle, Bundle bundle2, boolean z) {
|
|
return Companion.createFrom(str, bundle, bundle2, z);
|
|
}
|
|
|
|
@RequiresApi(23)
|
|
public static final CreateCredentialRequest createFrom(String str, Bundle bundle, Bundle bundle2, boolean z, String str2) {
|
|
return Companion.createFrom(str, bundle, bundle2, z, str2);
|
|
}
|
|
|
|
public final Bundle getCandidateQueryData() {
|
|
return this.candidateQueryData;
|
|
}
|
|
|
|
public final Bundle getCredentialData() {
|
|
return this.credentialData;
|
|
}
|
|
|
|
public final DisplayInfo getDisplayInfo() {
|
|
return this.displayInfo;
|
|
}
|
|
|
|
public final String getOrigin() {
|
|
return this.origin;
|
|
}
|
|
|
|
public final String getType() {
|
|
return this.type;
|
|
}
|
|
|
|
public final boolean isAutoSelectAllowed() {
|
|
return this.isAutoSelectAllowed;
|
|
}
|
|
|
|
public final boolean isSystemProviderRequired() {
|
|
return this.isSystemProviderRequired;
|
|
}
|
|
|
|
public final boolean preferImmediatelyAvailableCredentials() {
|
|
return this.preferImmediatelyAvailableCredentials;
|
|
}
|
|
|
|
public CreateCredentialRequest(String type, Bundle credentialData, Bundle candidateQueryData, boolean z, boolean z2, DisplayInfo displayInfo, String str, boolean z3) {
|
|
Intrinsics.checkNotNullParameter(type, "type");
|
|
Intrinsics.checkNotNullParameter(credentialData, "credentialData");
|
|
Intrinsics.checkNotNullParameter(candidateQueryData, "candidateQueryData");
|
|
Intrinsics.checkNotNullParameter(displayInfo, "displayInfo");
|
|
this.type = type;
|
|
this.credentialData = credentialData;
|
|
this.candidateQueryData = candidateQueryData;
|
|
this.isSystemProviderRequired = z;
|
|
this.isAutoSelectAllowed = z2;
|
|
this.displayInfo = displayInfo;
|
|
this.origin = str;
|
|
this.preferImmediatelyAvailableCredentials = z3;
|
|
credentialData.putBoolean("androidx.credentials.BUNDLE_KEY_IS_AUTO_SELECT_ALLOWED", z2);
|
|
credentialData.putBoolean("androidx.credentials.BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS", z3);
|
|
candidateQueryData.putBoolean("androidx.credentials.BUNDLE_KEY_IS_AUTO_SELECT_ALLOWED", z2);
|
|
}
|
|
|
|
@SourceDebugExtension({"SMAP\nCreateCredentialRequest.kt\nKotlin\n*S Kotlin\n*F\n+ 1 CreateCredentialRequest.kt\nandroidx/credentials/CreateCredentialRequest$DisplayInfo\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,308:1\n1#2:309\n*E\n"})
|
|
public static final class DisplayInfo {
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
public static final String BUNDLE_KEY_CREDENTIAL_TYPE_ICON = "androidx.credentials.BUNDLE_KEY_CREDENTIAL_TYPE_ICON";
|
|
public static final String BUNDLE_KEY_DEFAULT_PROVIDER = "androidx.credentials.BUNDLE_KEY_DEFAULT_PROVIDER";
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
public static final String BUNDLE_KEY_REQUEST_DISPLAY_INFO = "androidx.credentials.BUNDLE_KEY_REQUEST_DISPLAY_INFO";
|
|
public static final String BUNDLE_KEY_USER_DISPLAY_NAME = "androidx.credentials.BUNDLE_KEY_USER_DISPLAY_NAME";
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
public static final String BUNDLE_KEY_USER_ID = "androidx.credentials.BUNDLE_KEY_USER_ID";
|
|
public static final Companion Companion = new Companion(null);
|
|
private final Icon credentialTypeIcon;
|
|
private final String preferDefaultProvider;
|
|
private final CharSequence userDisplayName;
|
|
private final CharSequence userId;
|
|
|
|
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public DisplayInfo(CharSequence userId) {
|
|
this(userId, (CharSequence) null, 2, (DefaultConstructorMarker) (0 == true ? 1 : 0));
|
|
Intrinsics.checkNotNullParameter(userId, "userId");
|
|
}
|
|
|
|
@RequiresApi(23)
|
|
public static final DisplayInfo createFrom(Bundle bundle) {
|
|
return Companion.createFrom(bundle);
|
|
}
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
public final Icon getCredentialTypeIcon() {
|
|
return this.credentialTypeIcon;
|
|
}
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
public final String getPreferDefaultProvider() {
|
|
return this.preferDefaultProvider;
|
|
}
|
|
|
|
public final CharSequence getUserDisplayName() {
|
|
return this.userDisplayName;
|
|
}
|
|
|
|
public final CharSequence getUserId() {
|
|
return this.userId;
|
|
}
|
|
|
|
public DisplayInfo(CharSequence userId, CharSequence charSequence, Icon icon, String str) {
|
|
Intrinsics.checkNotNullParameter(userId, "userId");
|
|
this.userId = userId;
|
|
this.userDisplayName = charSequence;
|
|
this.credentialTypeIcon = icon;
|
|
this.preferDefaultProvider = str;
|
|
if (userId.length() <= 0) {
|
|
throw new IllegalArgumentException("userId should not be empty".toString());
|
|
}
|
|
}
|
|
|
|
public /* synthetic */ DisplayInfo(CharSequence charSequence, CharSequence charSequence2, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(charSequence, (i & 2) != 0 ? null : charSequence2);
|
|
}
|
|
|
|
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
|
public DisplayInfo(CharSequence userId, CharSequence charSequence) {
|
|
this(userId, charSequence, (Icon) null, (String) null);
|
|
Intrinsics.checkNotNullParameter(userId, "userId");
|
|
}
|
|
|
|
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
|
public DisplayInfo(CharSequence userId, CharSequence charSequence, String str) {
|
|
this(userId, charSequence, (Icon) null, str);
|
|
Intrinsics.checkNotNullParameter(userId, "userId");
|
|
}
|
|
|
|
@RequiresApi(23)
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
public final Bundle toBundle() {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putCharSequence(BUNDLE_KEY_USER_ID, this.userId);
|
|
if (!TextUtils.isEmpty(this.userDisplayName)) {
|
|
bundle.putCharSequence(BUNDLE_KEY_USER_DISPLAY_NAME, this.userDisplayName);
|
|
}
|
|
if (!TextUtils.isEmpty(this.preferDefaultProvider)) {
|
|
bundle.putString(BUNDLE_KEY_DEFAULT_PROVIDER, this.preferDefaultProvider);
|
|
}
|
|
return bundle;
|
|
}
|
|
|
|
public static final class Companion {
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
|
|
@RequiresApi(23)
|
|
public final DisplayInfo createFrom(Bundle from) {
|
|
Intrinsics.checkNotNullParameter(from, "from");
|
|
try {
|
|
Bundle bundle = from.getBundle(DisplayInfo.BUNDLE_KEY_REQUEST_DISPLAY_INFO);
|
|
Intrinsics.checkNotNull(bundle);
|
|
CharSequence charSequence = bundle.getCharSequence(DisplayInfo.BUNDLE_KEY_USER_ID);
|
|
CharSequence charSequence2 = bundle.getCharSequence(DisplayInfo.BUNDLE_KEY_USER_DISPLAY_NAME);
|
|
Icon icon = (Icon) bundle.getParcelable(DisplayInfo.BUNDLE_KEY_CREDENTIAL_TYPE_ICON);
|
|
String string = bundle.getString(DisplayInfo.BUNDLE_KEY_DEFAULT_PROVIDER);
|
|
Intrinsics.checkNotNull(charSequence);
|
|
return new DisplayInfo(charSequence, charSequence2, icon, string);
|
|
} catch (Exception e) {
|
|
throw new IllegalArgumentException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public static final class Companion {
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
@RequiresApi(23)
|
|
public final CreateCredentialRequest createFrom(String type, Bundle credentialData, Bundle candidateQueryData, boolean z) {
|
|
Intrinsics.checkNotNullParameter(type, "type");
|
|
Intrinsics.checkNotNullParameter(credentialData, "credentialData");
|
|
Intrinsics.checkNotNullParameter(candidateQueryData, "candidateQueryData");
|
|
return createFrom$default(this, type, credentialData, candidateQueryData, z, null, 16, null);
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
|
|
@RequiresApi(34)
|
|
public final CreateCredentialRequest createFrom(android.credentials.CreateCredentialRequest request) {
|
|
String type;
|
|
Bundle credentialData;
|
|
Bundle candidateQueryData;
|
|
boolean isSystemProviderRequired;
|
|
String origin;
|
|
Intrinsics.checkNotNullParameter(request, "request");
|
|
type = request.getType();
|
|
Intrinsics.checkNotNullExpressionValue(type, "request.type");
|
|
credentialData = request.getCredentialData();
|
|
Intrinsics.checkNotNullExpressionValue(credentialData, "request.credentialData");
|
|
candidateQueryData = request.getCandidateQueryData();
|
|
Intrinsics.checkNotNullExpressionValue(candidateQueryData, "request.candidateQueryData");
|
|
isSystemProviderRequired = request.isSystemProviderRequired();
|
|
origin = request.getOrigin();
|
|
return createFrom(type, credentialData, candidateQueryData, isSystemProviderRequired, origin);
|
|
}
|
|
|
|
public static /* synthetic */ CreateCredentialRequest createFrom$default(Companion companion, String str, Bundle bundle, Bundle bundle2, boolean z, String str2, int i, Object obj) {
|
|
if ((i & 16) != 0) {
|
|
str2 = null;
|
|
}
|
|
return companion.createFrom(str, bundle, bundle2, z, str2);
|
|
}
|
|
|
|
@RequiresApi(23)
|
|
public final CreateCredentialRequest createFrom(String type, Bundle credentialData, Bundle candidateQueryData, boolean z, String str) {
|
|
Intrinsics.checkNotNullParameter(type, "type");
|
|
Intrinsics.checkNotNullParameter(credentialData, "credentialData");
|
|
Intrinsics.checkNotNullParameter(candidateQueryData, "candidateQueryData");
|
|
try {
|
|
if (Intrinsics.areEqual(type, PasswordCredential.TYPE_PASSWORD_CREDENTIAL)) {
|
|
return CreatePasswordRequest.Companion.createFrom$credentials_release(credentialData, str, candidateQueryData);
|
|
}
|
|
if (Intrinsics.areEqual(type, PublicKeyCredential.TYPE_PUBLIC_KEY_CREDENTIAL)) {
|
|
String string = credentialData.getString(PublicKeyCredential.BUNDLE_KEY_SUBTYPE);
|
|
if (string != null && string.hashCode() == 589054771 && string.equals(CreatePublicKeyCredentialRequest.BUNDLE_VALUE_SUBTYPE_CREATE_PUBLIC_KEY_CREDENTIAL_REQUEST)) {
|
|
return CreatePublicKeyCredentialRequest.Companion.createFrom$credentials_release(credentialData, str, candidateQueryData);
|
|
}
|
|
throw new FrameworkClassParsingException();
|
|
}
|
|
throw new FrameworkClassParsingException();
|
|
} catch (FrameworkClassParsingException unused) {
|
|
return new CreateCustomCredentialRequest(type, credentialData, candidateQueryData, z, DisplayInfo.Companion.createFrom(credentialData), credentialData.getBoolean("androidx.credentials.BUNDLE_KEY_IS_AUTO_SELECT_ALLOWED", false), str, credentialData.getBoolean("androidx.credentials.BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS", false));
|
|
}
|
|
}
|
|
}
|
|
}
|