135 lines
3.9 KiB
Java
135 lines
3.9 KiB
Java
package com.facebook.internal;
|
|
|
|
import android.net.Uri;
|
|
import com.unity3d.ads.metadata.MediationMetaData;
|
|
import java.util.EnumSet;
|
|
import java.util.Map;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class FetchedAppSettings {
|
|
private boolean a;
|
|
private boolean b;
|
|
private int c;
|
|
private EnumSet<SmartLoginOption> d;
|
|
private Map<String, Map<String, DialogFeatureConfig>> e;
|
|
private boolean f;
|
|
private FacebookRequestErrorClassification g;
|
|
|
|
public FetchedAppSettings(boolean z, String str, boolean z2, boolean z3, int i, EnumSet<SmartLoginOption> enumSet, Map<String, Map<String, DialogFeatureConfig>> map, boolean z4, FacebookRequestErrorClassification facebookRequestErrorClassification, String str2, String str3) {
|
|
this.a = z;
|
|
this.b = z3;
|
|
this.e = map;
|
|
this.g = facebookRequestErrorClassification;
|
|
this.c = i;
|
|
this.f = z4;
|
|
this.d = enumSet;
|
|
}
|
|
|
|
public boolean a() {
|
|
return this.f;
|
|
}
|
|
|
|
public boolean b() {
|
|
return this.b;
|
|
}
|
|
|
|
public Map<String, Map<String, DialogFeatureConfig>> c() {
|
|
return this.e;
|
|
}
|
|
|
|
public FacebookRequestErrorClassification d() {
|
|
return this.g;
|
|
}
|
|
|
|
public int e() {
|
|
return this.c;
|
|
}
|
|
|
|
public EnumSet<SmartLoginOption> f() {
|
|
return this.d;
|
|
}
|
|
|
|
public boolean g() {
|
|
return this.a;
|
|
}
|
|
|
|
public static DialogFeatureConfig a(String str, String str2, String str3) {
|
|
FetchedAppSettings c;
|
|
Map<String, DialogFeatureConfig> map;
|
|
if (Utility.c(str2) || Utility.c(str3) || (c = FetchedAppSettingsManager.c(str)) == null || (map = c.c().get(str2)) == null) {
|
|
return null;
|
|
}
|
|
return map.get(str3);
|
|
}
|
|
|
|
public static class DialogFeatureConfig {
|
|
private String a;
|
|
private String b;
|
|
private int[] c;
|
|
|
|
private DialogFeatureConfig(String str, String str2, Uri uri, int[] iArr) {
|
|
this.a = str;
|
|
this.b = str2;
|
|
this.c = iArr;
|
|
}
|
|
|
|
public static DialogFeatureConfig a(JSONObject jSONObject) {
|
|
String optString = jSONObject.optString(MediationMetaData.KEY_NAME);
|
|
if (Utility.c(optString)) {
|
|
return null;
|
|
}
|
|
String[] split = optString.split("\\|");
|
|
if (split.length != 2) {
|
|
return null;
|
|
}
|
|
String str = split[0];
|
|
String str2 = split[1];
|
|
if (Utility.c(str) || Utility.c(str2)) {
|
|
return null;
|
|
}
|
|
String optString2 = jSONObject.optString("url");
|
|
return new DialogFeatureConfig(str, str2, Utility.c(optString2) ? null : Uri.parse(optString2), a(jSONObject.optJSONArray("versions")));
|
|
}
|
|
|
|
public String b() {
|
|
return this.b;
|
|
}
|
|
|
|
public int[] c() {
|
|
return this.c;
|
|
}
|
|
|
|
private static int[] a(JSONArray jSONArray) {
|
|
if (jSONArray == null) {
|
|
return null;
|
|
}
|
|
int length = jSONArray.length();
|
|
int[] iArr = new int[length];
|
|
for (int i = 0; i < length; i++) {
|
|
int i2 = -1;
|
|
int optInt = jSONArray.optInt(i, -1);
|
|
if (optInt == -1) {
|
|
String optString = jSONArray.optString(i);
|
|
if (!Utility.c(optString)) {
|
|
try {
|
|
i2 = Integer.parseInt(optString);
|
|
} catch (NumberFormatException e) {
|
|
Utility.a("FacebookSDK", (Exception) e);
|
|
}
|
|
iArr[i] = i2;
|
|
}
|
|
}
|
|
i2 = optInt;
|
|
iArr[i] = i2;
|
|
}
|
|
return iArr;
|
|
}
|
|
|
|
public String a() {
|
|
return this.a;
|
|
}
|
|
}
|
|
}
|