what-the-bank/sources/com/google/firebase/auth/internal/zzbl.java

60 lines
2.2 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.google.firebase.auth.internal;
import android.content.Intent;
import android.text.TextUtils;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.common.internal.safeparcel.SafeParcelableSerializer;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class zzbl {
static final Map zza;
static {
HashMap hashMap = new HashMap();
zza = hashMap;
hashMap.put("auth/invalid-provider-id", "INVALID_PROVIDER_ID");
hashMap.put("auth/invalid-cert-hash", "INVALID_CERT_HASH");
hashMap.put("auth/network-request-failed", "WEB_NETWORK_REQUEST_FAILED");
hashMap.put("auth/web-storage-unsupported", "WEB_STORAGE_UNSUPPORTED");
hashMap.put("auth/operation-not-allowed", "OPERATION_NOT_ALLOWED");
}
public static Status zzb(String str) {
try {
JSONObject jSONObject = new JSONObject(str);
String string = jSONObject.getString("code");
String string2 = jSONObject.getString("message");
if (!TextUtils.isEmpty(string) && !TextUtils.isEmpty(string2)) {
Map map = zza;
if (map.containsKey(string)) {
String str2 = (String) map.get(string);
StringBuilder sb = new StringBuilder();
sb.append(str2);
sb.append(":");
sb.append(string2);
return zzai.zza(sb.toString());
}
}
StringBuilder sb2 = new StringBuilder("WEB_INTERNAL_ERROR:");
sb2.append(str);
return zzai.zza(sb2.toString());
} catch (JSONException e) {
String localizedMessage = e.getLocalizedMessage();
StringBuilder sb3 = new StringBuilder("WEB_INTERNAL_ERROR:");
sb3.append(str);
sb3.append("[ ");
sb3.append(localizedMessage);
sb3.append(" ]");
return zzai.zza(sb3.toString());
}
}
public static void zzc(Intent intent, Status status) {
SafeParcelableSerializer.serializeToIntentExtra(status, intent, "com.google.firebase.auth.internal.STATUS");
}
}