package com.facebook.internal; import android.net.Uri; import java.util.EnumSet; import java.util.List; import java.util.Map; import kotlin.collections.CollectionsKt___CollectionsKt; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.jvm.internal.Intrinsics; import kotlin.text.StringsKt__StringsKt; import org.json.JSONArray; import org.json.JSONObject; /* loaded from: classes2.dex */ public final class FetchedAppSettings { public static final Companion Companion = new Companion(null); private final JSONArray MACARuleMatchingSetting; private final boolean automaticLoggingEnabled; private final JSONArray blocklistEvents; private final boolean codelessEventsEnabled; private final Map> dialogConfigurations; private final FacebookRequestErrorClassification errorClassification; private final JSONArray eventBindings; private final boolean iAPAutomaticLoggingEnabled; private final Map migratedAutoLogValues; private final boolean monitorViaDialogEnabled; private final String nuxContent; private final boolean nuxEnabled; private final JSONArray protectedModeStandardParamsSetting; private final String rawAamRules; private final JSONArray redactedEvents; private final String restrictiveDataSetting; private final String sdkUpdateMessage; private final JSONArray sensitiveParams; private final int sessionTimeoutInSeconds; private final String smartLoginBookmarkIconURL; private final String smartLoginMenuIconURL; private final EnumSet smartLoginOptions; private final String suggestedEventsSetting; private final boolean supportsImplicitLogging; private final boolean trackUninstallEnabled; public static final DialogFeatureConfig getDialogFeatureConfig(String str, String str2, String str3) { return Companion.getDialogFeatureConfig(str, str2, str3); } public final boolean getAutomaticLoggingEnabled() { return this.automaticLoggingEnabled; } public final JSONArray getBlocklistEvents() { return this.blocklistEvents; } public final boolean getCodelessEventsEnabled() { return this.codelessEventsEnabled; } public final Map> getDialogConfigurations() { return this.dialogConfigurations; } public final FacebookRequestErrorClassification getErrorClassification() { return this.errorClassification; } public final JSONArray getEventBindings() { return this.eventBindings; } public final boolean getIAPAutomaticLoggingEnabled() { return this.iAPAutomaticLoggingEnabled; } public final JSONArray getMACARuleMatchingSetting() { return this.MACARuleMatchingSetting; } public final Map getMigratedAutoLogValues() { return this.migratedAutoLogValues; } public final boolean getMonitorViaDialogEnabled() { return this.monitorViaDialogEnabled; } public final String getNuxContent() { return this.nuxContent; } public final boolean getNuxEnabled() { return this.nuxEnabled; } public final JSONArray getProtectedModeStandardParamsSetting() { return this.protectedModeStandardParamsSetting; } public final String getRawAamRules() { return this.rawAamRules; } public final JSONArray getRedactedEvents() { return this.redactedEvents; } public final String getRestrictiveDataSetting() { return this.restrictiveDataSetting; } public final String getSdkUpdateMessage() { return this.sdkUpdateMessage; } public final JSONArray getSensitiveParams() { return this.sensitiveParams; } public final int getSessionTimeoutInSeconds() { return this.sessionTimeoutInSeconds; } public final String getSmartLoginBookmarkIconURL() { return this.smartLoginBookmarkIconURL; } public final String getSmartLoginMenuIconURL() { return this.smartLoginMenuIconURL; } public final EnumSet getSmartLoginOptions() { return this.smartLoginOptions; } public final String getSuggestedEventsSetting() { return this.suggestedEventsSetting; } public final boolean getTrackUninstallEnabled() { return this.trackUninstallEnabled; } public final boolean supportsImplicitLogging() { return this.supportsImplicitLogging; } /* JADX WARN: Multi-variable type inference failed */ public FetchedAppSettings(boolean z, String nuxContent, boolean z2, int i, EnumSet smartLoginOptions, Map> dialogConfigurations, boolean z3, FacebookRequestErrorClassification errorClassification, String smartLoginBookmarkIconURL, String smartLoginMenuIconURL, boolean z4, boolean z5, JSONArray jSONArray, String sdkUpdateMessage, boolean z6, boolean z7, String str, String str2, String str3, JSONArray jSONArray2, JSONArray jSONArray3, Map map, JSONArray jSONArray4, JSONArray jSONArray5, JSONArray jSONArray6) { Intrinsics.checkNotNullParameter(nuxContent, "nuxContent"); Intrinsics.checkNotNullParameter(smartLoginOptions, "smartLoginOptions"); Intrinsics.checkNotNullParameter(dialogConfigurations, "dialogConfigurations"); Intrinsics.checkNotNullParameter(errorClassification, "errorClassification"); Intrinsics.checkNotNullParameter(smartLoginBookmarkIconURL, "smartLoginBookmarkIconURL"); Intrinsics.checkNotNullParameter(smartLoginMenuIconURL, "smartLoginMenuIconURL"); Intrinsics.checkNotNullParameter(sdkUpdateMessage, "sdkUpdateMessage"); this.supportsImplicitLogging = z; this.nuxContent = nuxContent; this.nuxEnabled = z2; this.sessionTimeoutInSeconds = i; this.smartLoginOptions = smartLoginOptions; this.dialogConfigurations = dialogConfigurations; this.automaticLoggingEnabled = z3; this.errorClassification = errorClassification; this.smartLoginBookmarkIconURL = smartLoginBookmarkIconURL; this.smartLoginMenuIconURL = smartLoginMenuIconURL; this.iAPAutomaticLoggingEnabled = z4; this.codelessEventsEnabled = z5; this.eventBindings = jSONArray; this.sdkUpdateMessage = sdkUpdateMessage; this.trackUninstallEnabled = z6; this.monitorViaDialogEnabled = z7; this.rawAamRules = str; this.suggestedEventsSetting = str2; this.restrictiveDataSetting = str3; this.protectedModeStandardParamsSetting = jSONArray2; this.MACARuleMatchingSetting = jSONArray3; this.migratedAutoLogValues = map; this.blocklistEvents = jSONArray4; this.redactedEvents = jSONArray5; this.sensitiveParams = jSONArray6; } public static final class DialogFeatureConfig { public static final Companion Companion = new Companion(null); private static final String DIALOG_CONFIG_DIALOG_NAME_FEATURE_NAME_SEPARATOR = "|"; private static final String DIALOG_CONFIG_NAME_KEY = "name"; private static final String DIALOG_CONFIG_URL_KEY = "url"; private static final String DIALOG_CONFIG_VERSIONS_KEY = "versions"; private final String dialogName; private final Uri fallbackUrl; private final String featureName; private final int[] versionSpec; public /* synthetic */ DialogFeatureConfig(String str, String str2, Uri uri, int[] iArr, DefaultConstructorMarker defaultConstructorMarker) { this(str, str2, uri, iArr); } public final String getDialogName() { return this.dialogName; } public final Uri getFallbackUrl() { return this.fallbackUrl; } public final String getFeatureName() { return this.featureName; } public final int[] getVersionSpec() { return this.versionSpec; } private DialogFeatureConfig(String str, String str2, Uri uri, int[] iArr) { this.dialogName = str; this.featureName = str2; this.fallbackUrl = uri; this.versionSpec = iArr; } public static final class Companion { public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) { this(); } private Companion() { } public final DialogFeatureConfig parseDialogConfig(JSONObject dialogConfigJSON) { List split$default; Intrinsics.checkNotNullParameter(dialogConfigJSON, "dialogConfigJSON"); String dialogNameWithFeature = dialogConfigJSON.optString("name"); if (Utility.isNullOrEmpty(dialogNameWithFeature)) { return null; } Intrinsics.checkNotNullExpressionValue(dialogNameWithFeature, "dialogNameWithFeature"); split$default = StringsKt__StringsKt.split$default((CharSequence) dialogNameWithFeature, new String[]{DialogFeatureConfig.DIALOG_CONFIG_DIALOG_NAME_FEATURE_NAME_SEPARATOR}, false, 0, 6, (Object) null); if (split$default.size() != 2) { return null; } String str = (String) CollectionsKt___CollectionsKt.first(split$default); String str2 = (String) CollectionsKt___CollectionsKt.last(split$default); if (Utility.isNullOrEmpty(str) || Utility.isNullOrEmpty(str2)) { return null; } String optString = dialogConfigJSON.optString("url"); return new DialogFeatureConfig(str, str2, Utility.isNullOrEmpty(optString) ? null : Uri.parse(optString), parseVersionSpec(dialogConfigJSON.optJSONArray(DialogFeatureConfig.DIALOG_CONFIG_VERSIONS_KEY)), null); } private final int[] parseVersionSpec(JSONArray jSONArray) { if (jSONArray == null) { return null; } int length = jSONArray.length(); int[] iArr = new int[length]; if (length <= 0) { return iArr; } int i = 0; while (true) { int i2 = i + 1; int i3 = -1; int optInt = jSONArray.optInt(i, -1); if (optInt == -1) { String versionString = jSONArray.optString(i); if (!Utility.isNullOrEmpty(versionString)) { try { Intrinsics.checkNotNullExpressionValue(versionString, "versionString"); i3 = Integer.parseInt(versionString); } catch (NumberFormatException e) { Utility.logd(Utility.LOG_TAG, e); } optInt = i3; } } iArr[i] = optInt; if (i2 >= length) { return iArr; } i = i2; } } } } public static final class Companion { public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) { this(); } private Companion() { } public final DialogFeatureConfig getDialogFeatureConfig(String applicationId, String actionName, String featureName) { Intrinsics.checkNotNullParameter(applicationId, "applicationId"); Intrinsics.checkNotNullParameter(actionName, "actionName"); Intrinsics.checkNotNullParameter(featureName, "featureName"); if (actionName.length() == 0 || featureName.length() == 0) { return null; } FetchedAppSettings appSettingsWithoutQuery = FetchedAppSettingsManager.getAppSettingsWithoutQuery(applicationId); Map map = appSettingsWithoutQuery == null ? null : appSettingsWithoutQuery.getDialogConfigurations().get(actionName); if (map != null) { return map.get(featureName); } return null; } } }