- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
677 lines
32 KiB
Java
677 lines
32 KiB
Java
package com.vungle.ads.internal;
|
|
|
|
import android.content.Context;
|
|
import android.net.Uri;
|
|
import androidx.annotation.VisibleForTesting;
|
|
import com.vungle.ads.AnalyticsClient;
|
|
import com.vungle.ads.ConfigurationError;
|
|
import com.vungle.ads.Metric;
|
|
import com.vungle.ads.NetworkUnreachable;
|
|
import com.vungle.ads.ServiceLocator;
|
|
import com.vungle.ads.SingleValueMetric;
|
|
import com.vungle.ads.TimeIntervalMetric;
|
|
import com.vungle.ads.internal.model.ConfigPayload;
|
|
import com.vungle.ads.internal.model.Cookie;
|
|
import com.vungle.ads.internal.model.Placement;
|
|
import com.vungle.ads.internal.network.Call;
|
|
import com.vungle.ads.internal.network.Callback;
|
|
import com.vungle.ads.internal.network.Response;
|
|
import com.vungle.ads.internal.network.VungleApiClient;
|
|
import com.vungle.ads.internal.omsdk.OMInjector;
|
|
import com.vungle.ads.internal.persistence.FilePreferences;
|
|
import com.vungle.ads.internal.privacy.PrivacyManager;
|
|
import com.vungle.ads.internal.protos.Sdk;
|
|
import com.vungle.ads.internal.util.Logger;
|
|
import java.net.UnknownHostException;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import kotlin.Lazy;
|
|
import kotlin.LazyKt__LazyJVMKt;
|
|
import kotlin.LazyThreadSafetyMode;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.jvm.internal.Reflection;
|
|
import kotlin.text.StringsKt__StringsJVMKt;
|
|
import kotlinx.serialization.DeserializationStrategy;
|
|
import kotlinx.serialization.SerializationStrategy;
|
|
import kotlinx.serialization.SerializersKt;
|
|
import kotlinx.serialization.StringFormat;
|
|
import kotlinx.serialization.json.Json;
|
|
import kotlinx.serialization.json.JsonBuilder;
|
|
import kotlinx.serialization.json.JsonKt;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public final class ConfigManager {
|
|
private static final int CONFIG_ALL_DATA = 2;
|
|
private static final int CONFIG_LAST_VALIDATED_TIMESTAMP_ONLY = 1;
|
|
public static final long CONFIG_LAST_VALIDATE_TS_DEFAULT = -1;
|
|
private static final int CONFIG_NOT_AVAILABLE = 0;
|
|
private static final int DEFAULT_SESSION_TIMEOUT_SECONDS = 900;
|
|
private static final int DEFAULT_SIGNALS_SESSION_TIMEOUT_SECONDS = 1800;
|
|
public static final String TAG = "ConfigManager";
|
|
private static String applicationId;
|
|
private static ConfigPayload config;
|
|
private static String configExt;
|
|
private static ConfigPayload.Endpoints endpoints;
|
|
private static List<Placement> placements;
|
|
public static final ConfigManager INSTANCE = new ConfigManager();
|
|
private static final Json json = JsonKt.Json$default((Json) null, new Function1() { // from class: com.vungle.ads.internal.ConfigManager$json$1
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
|
|
invoke((JsonBuilder) obj);
|
|
return Unit.INSTANCE;
|
|
}
|
|
|
|
public final void invoke(JsonBuilder Json) {
|
|
Intrinsics.checkNotNullParameter(Json, "$this$Json");
|
|
Json.setIgnoreUnknownKeys(true);
|
|
Json.setEncodeDefaults(true);
|
|
Json.setExplicitNulls(false);
|
|
}
|
|
}, 1, (Object) null);
|
|
|
|
@VisibleForTesting
|
|
public final void clearConfig$vungle_ads_release() {
|
|
endpoints = null;
|
|
placements = null;
|
|
config = null;
|
|
}
|
|
|
|
public final String getConfigExtension() {
|
|
String str = configExt;
|
|
return str == null ? "" : str;
|
|
}
|
|
|
|
public final List<Placement> placements() {
|
|
return placements;
|
|
}
|
|
|
|
public final void setAppId$vungle_ads_release(String applicationId2) {
|
|
Intrinsics.checkNotNullParameter(applicationId2, "applicationId");
|
|
applicationId = applicationId2;
|
|
}
|
|
|
|
private ConfigManager() {
|
|
}
|
|
|
|
/* renamed from: fetchConfigAsync$lambda-0, reason: not valid java name */
|
|
private static final VungleApiClient m3855fetchConfigAsync$lambda0(Lazy lazy) {
|
|
return (VungleApiClient) lazy.getValue();
|
|
}
|
|
|
|
public final void fetchConfigAsync$vungle_ads_release(final Context context, final Function1 onComplete) {
|
|
Lazy lazy;
|
|
Intrinsics.checkNotNullParameter(context, "context");
|
|
Intrinsics.checkNotNullParameter(onComplete, "onComplete");
|
|
ServiceLocator.Companion companion = ServiceLocator.Companion;
|
|
lazy = LazyKt__LazyJVMKt.lazy(LazyThreadSafetyMode.SYNCHRONIZED, new Function0() { // from class: com.vungle.ads.internal.ConfigManager$fetchConfigAsync$$inlined$inject$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(0);
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r0v2, types: [com.vungle.ads.internal.network.VungleApiClient, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function0
|
|
public final VungleApiClient invoke() {
|
|
return ServiceLocator.Companion.getInstance(context).getService(VungleApiClient.class);
|
|
}
|
|
});
|
|
try {
|
|
final TimeIntervalMetric timeIntervalMetric = new TimeIntervalMetric(Sdk.SDKMetric.SDKMetricType.INIT_REQUEST_TO_RESPONSE_DURATION_MS);
|
|
timeIntervalMetric.markStart();
|
|
Call<ConfigPayload> config2 = m3855fetchConfigAsync$lambda0(lazy).config();
|
|
if (config2 != null) {
|
|
config2.enqueue(new Callback<ConfigPayload>() { // from class: com.vungle.ads.internal.ConfigManager$fetchConfigAsync$1
|
|
@Override // com.vungle.ads.internal.network.Callback
|
|
public void onResponse(Call<ConfigPayload> call, Response<ConfigPayload> response) {
|
|
TimeIntervalMetric.this.markEnd();
|
|
AnalyticsClient.INSTANCE.logMetric$vungle_ads_release((Metric) TimeIntervalMetric.this, (r13 & 2) != 0 ? null : null, (r13 & 4) != 0 ? null : null, (r13 & 8) != 0 ? null : null, (r13 & 16) != 0 ? null : VungleApiClient.Companion.getBASE_URL$vungle_ads_release());
|
|
if (response == null || !response.isSuccessful() || response.body() == null) {
|
|
new ConfigurationError().logErrorNoReturnValue$vungle_ads_release();
|
|
return;
|
|
}
|
|
ConfigManager.INSTANCE.initWithConfig$vungle_ads_release(context, response.body(), false, new SingleValueMetric(Sdk.SDKMetric.SDKMetricType.CONFIG_LOADED_FROM_INIT));
|
|
onComplete.invoke(Boolean.TRUE);
|
|
}
|
|
|
|
@Override // com.vungle.ads.internal.network.Callback
|
|
public void onFailure(Call<ConfigPayload> call, Throwable th) {
|
|
TimeIntervalMetric.this.markEnd();
|
|
AnalyticsClient.INSTANCE.logMetric$vungle_ads_release((Metric) TimeIntervalMetric.this, (r13 & 2) != 0 ? null : null, (r13 & 4) != 0 ? null : null, (r13 & 8) != 0 ? null : null, (r13 & 16) != 0 ? null : VungleApiClient.Companion.getBASE_URL$vungle_ads_release());
|
|
new ConfigurationError().logErrorNoReturnValue$vungle_ads_release();
|
|
Logger.Companion companion2 = Logger.Companion;
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("Error while fetching config: ");
|
|
sb.append(th != null ? th.getMessage() : null);
|
|
companion2.e(ConfigManager.TAG, sb.toString());
|
|
onComplete.invoke(Boolean.FALSE);
|
|
}
|
|
});
|
|
}
|
|
} catch (Throwable th) {
|
|
if ((th instanceof UnknownHostException) || (th instanceof SecurityException)) {
|
|
new NetworkUnreachable().logErrorNoReturnValue$vungle_ads_release();
|
|
} else {
|
|
new ConfigurationError().logErrorNoReturnValue$vungle_ads_release();
|
|
}
|
|
onComplete.invoke(Boolean.FALSE);
|
|
}
|
|
}
|
|
|
|
/* renamed from: updateConfigExtension$lambda-1, reason: not valid java name */
|
|
private static final FilePreferences m3858updateConfigExtension$lambda1(Lazy lazy) {
|
|
return (FilePreferences) lazy.getValue();
|
|
}
|
|
|
|
@VisibleForTesting
|
|
public final void updateConfigExtension$vungle_ads_release(final Context context, String ext) {
|
|
Lazy lazy;
|
|
Intrinsics.checkNotNullParameter(context, "context");
|
|
Intrinsics.checkNotNullParameter(ext, "ext");
|
|
configExt = ext;
|
|
ServiceLocator.Companion companion = ServiceLocator.Companion;
|
|
lazy = LazyKt__LazyJVMKt.lazy(LazyThreadSafetyMode.SYNCHRONIZED, new Function0() { // from class: com.vungle.ads.internal.ConfigManager$updateConfigExtension$$inlined$inject$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(0);
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r0v2, types: [com.vungle.ads.internal.persistence.FilePreferences, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function0
|
|
public final FilePreferences invoke() {
|
|
return ServiceLocator.Companion.getInstance(context).getService(FilePreferences.class);
|
|
}
|
|
});
|
|
m3858updateConfigExtension$lambda1(lazy).put(Cookie.CONFIG_EXTENSION, ext).apply();
|
|
}
|
|
|
|
public static /* synthetic */ void initWithConfig$vungle_ads_release$default(ConfigManager configManager, Context context, ConfigPayload configPayload, boolean z, SingleValueMetric singleValueMetric, int i, Object obj) {
|
|
if ((i & 8) != 0) {
|
|
singleValueMetric = null;
|
|
}
|
|
configManager.initWithConfig$vungle_ads_release(context, configPayload, z, singleValueMetric);
|
|
}
|
|
|
|
/* renamed from: initWithConfig$lambda-2, reason: not valid java name */
|
|
private static final FilePreferences m3856initWithConfig$lambda2(Lazy lazy) {
|
|
return (FilePreferences) lazy.getValue();
|
|
}
|
|
|
|
public final synchronized void initWithConfig$vungle_ads_release(final Context context, ConfigPayload configPayload, boolean z, SingleValueMetric singleValueMetric) {
|
|
Lazy lazy;
|
|
Lazy lazy2;
|
|
try {
|
|
Intrinsics.checkNotNullParameter(context, "context");
|
|
try {
|
|
ServiceLocator.Companion companion = ServiceLocator.Companion;
|
|
LazyThreadSafetyMode lazyThreadSafetyMode = LazyThreadSafetyMode.SYNCHRONIZED;
|
|
lazy = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.vungle.ads.internal.ConfigManager$initWithConfig$$inlined$inject$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(0);
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r0v2, types: [com.vungle.ads.internal.persistence.FilePreferences, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function0
|
|
public final FilePreferences invoke() {
|
|
return ServiceLocator.Companion.getInstance(context).getService(FilePreferences.class);
|
|
}
|
|
});
|
|
int checkConfigPayload$vungle_ads_release = checkConfigPayload$vungle_ads_release(configPayload);
|
|
if (checkConfigPayload$vungle_ads_release == 0) {
|
|
Logger.Companion.e(TAG, "Config is not available.");
|
|
return;
|
|
}
|
|
if (checkConfigPayload$vungle_ads_release == 1) {
|
|
if (!z && configPayload != null) {
|
|
Long configLastValidatedTimestamp = configPayload.getConfigLastValidatedTimestamp();
|
|
long longValue = configLastValidatedTimestamp != null ? configLastValidatedTimestamp.longValue() : -1L;
|
|
ConfigPayload configPayload2 = config;
|
|
if (configPayload2 != null) {
|
|
configPayload2.setConfigLastValidatedTimestamp(Long.valueOf(longValue));
|
|
}
|
|
ConfigPayload configPayload3 = config;
|
|
if (configPayload3 != null) {
|
|
INSTANCE.updateCachedConfig(configPayload3, m3856initWithConfig$lambda2(lazy));
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
config = configPayload;
|
|
endpoints = configPayload != null ? configPayload.getEndpoints() : null;
|
|
placements = configPayload != null ? configPayload.getPlacements() : null;
|
|
AnalyticsClient analyticsClient = AnalyticsClient.INSTANCE;
|
|
analyticsClient.updateErrorLevelAndMetricEnabled$vungle_ads_release(getLogLevel(), getMetricsEnabled());
|
|
if (!z && configPayload != null) {
|
|
updateCachedConfig(configPayload, m3856initWithConfig$lambda2(lazy));
|
|
String configExtension = configPayload.getConfigExtension();
|
|
if (configExtension != null) {
|
|
INSTANCE.updateConfigExtension$vungle_ads_release(context, configExtension);
|
|
}
|
|
}
|
|
if (omEnabled()) {
|
|
lazy2 = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.vungle.ads.internal.ConfigManager$initWithConfig$$inlined$inject$2
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(0);
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r0v2, types: [com.vungle.ads.internal.omsdk.OMInjector, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function0
|
|
public final OMInjector invoke() {
|
|
return ServiceLocator.Companion.getInstance(context).getService(OMInjector.class);
|
|
}
|
|
});
|
|
m3857initWithConfig$lambda5(lazy2).init();
|
|
}
|
|
if (singleValueMetric != null) {
|
|
analyticsClient.logMetric$vungle_ads_release(singleValueMetric, (r13 & 2) != 0 ? null : null, (r13 & 4) != 0 ? null : null, (r13 & 8) != 0 ? null : null, (r13 & 16) != 0 ? null : null);
|
|
}
|
|
PrivacyManager.INSTANCE.updateDisableAdId(shouldDisableAdId());
|
|
} catch (Exception e) {
|
|
Logger.Companion.e(TAG, "Error while validating config: " + e.getMessage());
|
|
}
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
|
|
/* renamed from: initWithConfig$lambda-5, reason: not valid java name */
|
|
private static final OMInjector m3857initWithConfig$lambda5(Lazy lazy) {
|
|
return (OMInjector) lazy.getValue();
|
|
}
|
|
|
|
public final Placement getPlacement(String id) {
|
|
Intrinsics.checkNotNullParameter(id, "id");
|
|
List<Placement> list = placements;
|
|
Object obj = null;
|
|
if (list == null) {
|
|
return null;
|
|
}
|
|
Iterator<T> it = list.iterator();
|
|
while (true) {
|
|
if (!it.hasNext()) {
|
|
break;
|
|
}
|
|
Object next = it.next();
|
|
if (Intrinsics.areEqual(((Placement) next).getReferenceId(), id)) {
|
|
obj = next;
|
|
break;
|
|
}
|
|
}
|
|
return (Placement) obj;
|
|
}
|
|
|
|
public final String getAdsEndpoint() {
|
|
ConfigPayload.Endpoints endpoints2 = endpoints;
|
|
String str = null;
|
|
String adsEndpoint = endpoints2 != null ? endpoints2.getAdsEndpoint() : null;
|
|
if (adsEndpoint != null && adsEndpoint.length() != 0) {
|
|
str = adsEndpoint;
|
|
}
|
|
return str == null ? Constants.DEFAULT_ADS_ENDPOINT : str;
|
|
}
|
|
|
|
public final String getRiEndpoint() {
|
|
ConfigPayload.Endpoints endpoints2 = endpoints;
|
|
if (endpoints2 != null) {
|
|
return endpoints2.getRiEndpoint();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final String getMraidEndpoint() {
|
|
ConfigPayload.Endpoints endpoints2 = endpoints;
|
|
if (endpoints2 != null) {
|
|
return endpoints2.getMraidEndpoint();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final String getMraidJsVersion() {
|
|
String mraidEndpoint = getMraidEndpoint();
|
|
if (mraidEndpoint != null) {
|
|
String str = "mraid_" + Uri.parse(mraidEndpoint).getLastPathSegment();
|
|
if (str != null) {
|
|
return str;
|
|
}
|
|
}
|
|
return "mraid_1";
|
|
}
|
|
|
|
public final String getGDPRConsentMessage() {
|
|
ConfigPayload.UserPrivacy userPrivacy;
|
|
ConfigPayload.GDPRSettings gdpr;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (userPrivacy = configPayload.getUserPrivacy()) == null || (gdpr = userPrivacy.getGdpr()) == null) {
|
|
return null;
|
|
}
|
|
return gdpr.getConsentMessage();
|
|
}
|
|
|
|
public final String getGDPRConsentTitle() {
|
|
ConfigPayload.UserPrivacy userPrivacy;
|
|
ConfigPayload.GDPRSettings gdpr;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (userPrivacy = configPayload.getUserPrivacy()) == null || (gdpr = userPrivacy.getGdpr()) == null) {
|
|
return null;
|
|
}
|
|
return gdpr.getConsentTitle();
|
|
}
|
|
|
|
public final String getGDPRButtonAccept() {
|
|
ConfigPayload.UserPrivacy userPrivacy;
|
|
ConfigPayload.GDPRSettings gdpr;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (userPrivacy = configPayload.getUserPrivacy()) == null || (gdpr = userPrivacy.getGdpr()) == null) {
|
|
return null;
|
|
}
|
|
return gdpr.getButtonAccept();
|
|
}
|
|
|
|
public final String getGDPRButtonDeny() {
|
|
ConfigPayload.UserPrivacy userPrivacy;
|
|
ConfigPayload.GDPRSettings gdpr;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (userPrivacy = configPayload.getUserPrivacy()) == null || (gdpr = userPrivacy.getGdpr()) == null) {
|
|
return null;
|
|
}
|
|
return gdpr.getButtonDeny();
|
|
}
|
|
|
|
public final String getGDPRConsentMessageVersion() {
|
|
ConfigPayload.UserPrivacy userPrivacy;
|
|
ConfigPayload.GDPRSettings gdpr;
|
|
String consentMessageVersion;
|
|
ConfigPayload configPayload = config;
|
|
return (configPayload == null || (userPrivacy = configPayload.getUserPrivacy()) == null || (gdpr = userPrivacy.getGdpr()) == null || (consentMessageVersion = gdpr.getConsentMessageVersion()) == null) ? "" : consentMessageVersion;
|
|
}
|
|
|
|
public final boolean getGDPRIsCountryDataProtected() {
|
|
ConfigPayload.UserPrivacy userPrivacy;
|
|
ConfigPayload.GDPRSettings gdpr;
|
|
Boolean isCountryDataProtected;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (userPrivacy = configPayload.getUserPrivacy()) == null || (gdpr = userPrivacy.getGdpr()) == null || (isCountryDataProtected = gdpr.isCountryDataProtected()) == null) {
|
|
return false;
|
|
}
|
|
return isCountryDataProtected.booleanValue();
|
|
}
|
|
|
|
public final ConfigPayload.IABSettings.TcfStatus getTcfStatus() {
|
|
ConfigPayload.UserPrivacy userPrivacy;
|
|
ConfigPayload.IABSettings iab;
|
|
ConfigPayload.IABSettings.TcfStatus.Companion companion = ConfigPayload.IABSettings.TcfStatus.Companion;
|
|
ConfigPayload configPayload = config;
|
|
return companion.fromRawValue((configPayload == null || (userPrivacy = configPayload.getUserPrivacy()) == null || (iab = userPrivacy.getIab()) == null) ? null : iab.getTcfStatus());
|
|
}
|
|
|
|
public final boolean shouldDisableAdId() {
|
|
Boolean disableAdId;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (disableAdId = configPayload.getDisableAdId()) == null) {
|
|
return true;
|
|
}
|
|
return disableAdId.booleanValue();
|
|
}
|
|
|
|
public final boolean isReportIncentivizedEnabled() {
|
|
Boolean isReportIncentivizedEnabled;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (isReportIncentivizedEnabled = configPayload.isReportIncentivizedEnabled()) == null) {
|
|
return false;
|
|
}
|
|
return isReportIncentivizedEnabled.booleanValue();
|
|
}
|
|
|
|
public final long configLastValidatedTimestamp() {
|
|
Long configLastValidatedTimestamp;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (configLastValidatedTimestamp = configPayload.getConfigLastValidatedTimestamp()) == null) {
|
|
return -1L;
|
|
}
|
|
return configLastValidatedTimestamp.longValue();
|
|
}
|
|
|
|
public final boolean omEnabled() {
|
|
ConfigPayload.ViewAbilitySettings viewAbility;
|
|
Boolean om;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (viewAbility = configPayload.getViewAbility()) == null || (om = viewAbility.getOm()) == null) {
|
|
return false;
|
|
}
|
|
return om.booleanValue();
|
|
}
|
|
|
|
public final String getMetricsEndpoint() {
|
|
ConfigPayload.Endpoints endpoints2 = endpoints;
|
|
String str = null;
|
|
String metricsEndpoint = endpoints2 != null ? endpoints2.getMetricsEndpoint() : null;
|
|
if (metricsEndpoint != null && metricsEndpoint.length() != 0) {
|
|
str = metricsEndpoint;
|
|
}
|
|
return str == null ? Constants.DEFAULT_METRICS_ENDPOINT : str;
|
|
}
|
|
|
|
public final String getErrorLoggingEndpoint() {
|
|
ConfigPayload.Endpoints endpoints2 = endpoints;
|
|
String str = null;
|
|
String errorLogsEndpoint = endpoints2 != null ? endpoints2.getErrorLogsEndpoint() : null;
|
|
if (errorLogsEndpoint != null && errorLogsEndpoint.length() != 0) {
|
|
str = errorLogsEndpoint;
|
|
}
|
|
return str == null ? Constants.DEFAULT_ERROR_LOGS_ENDPOINT : str;
|
|
}
|
|
|
|
public final boolean getMetricsEnabled() {
|
|
ConfigPayload.LogMetricsSettings logMetricsSettings;
|
|
Boolean metricsEnabled;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (logMetricsSettings = configPayload.getLogMetricsSettings()) == null || (metricsEnabled = logMetricsSettings.getMetricsEnabled()) == null) {
|
|
return false;
|
|
}
|
|
return metricsEnabled.booleanValue();
|
|
}
|
|
|
|
public final int getLogLevel() {
|
|
ConfigPayload.LogMetricsSettings logMetricsSettings;
|
|
Integer errorLogLevel;
|
|
ConfigPayload configPayload = config;
|
|
return (configPayload == null || (logMetricsSettings = configPayload.getLogMetricsSettings()) == null || (errorLogLevel = logMetricsSettings.getErrorLogLevel()) == null) ? AnalyticsClient.LogLevel.ERROR_LOG_LEVEL_ERROR.getLevel() : errorLogLevel.intValue();
|
|
}
|
|
|
|
public final long getSessionTimeout() {
|
|
Integer sessionTimeout;
|
|
ConfigPayload configPayload = config;
|
|
return ((configPayload == null || (sessionTimeout = configPayload.getSessionTimeout()) == null) ? DEFAULT_SESSION_TIMEOUT_SECONDS : sessionTimeout.intValue()) * 1000;
|
|
}
|
|
|
|
public final long getSignalsSessionTimeout() {
|
|
Integer signalSessionTimeout;
|
|
ConfigPayload configPayload = config;
|
|
return ((configPayload == null || (signalSessionTimeout = configPayload.getSignalSessionTimeout()) == null) ? DEFAULT_SIGNALS_SESSION_TIMEOUT_SECONDS : signalSessionTimeout.intValue()) * 1000;
|
|
}
|
|
|
|
public final boolean rtaDebuggingEnabled() {
|
|
Boolean rtaDebugging;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (rtaDebugging = configPayload.getRtaDebugging()) == null) {
|
|
return false;
|
|
}
|
|
return rtaDebugging.booleanValue();
|
|
}
|
|
|
|
public final boolean isCacheableAssetsRequired() {
|
|
Boolean isCacheableAssetsRequired;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (isCacheableAssetsRequired = configPayload.isCacheableAssetsRequired()) == null) {
|
|
return false;
|
|
}
|
|
return isCacheableAssetsRequired.booleanValue();
|
|
}
|
|
|
|
public final boolean signalsDisabled() {
|
|
Boolean signalsDisabled;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (signalsDisabled = configPayload.getSignalsDisabled()) == null) {
|
|
return false;
|
|
}
|
|
return signalsDisabled.booleanValue();
|
|
}
|
|
|
|
public final boolean fpdEnabled() {
|
|
Boolean fpdEnabled;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (fpdEnabled = configPayload.getFpdEnabled()) == null) {
|
|
return true;
|
|
}
|
|
return fpdEnabled.booleanValue();
|
|
}
|
|
|
|
@VisibleForTesting
|
|
public final int checkConfigPayload$vungle_ads_release(ConfigPayload configPayload) {
|
|
if (configPayload == null || configPayload.getConfigLastValidatedTimestamp() == null) {
|
|
return 0;
|
|
}
|
|
Long configLastValidatedTimestamp = configPayload.getConfigLastValidatedTimestamp();
|
|
if (configLastValidatedTimestamp != null && configLastValidatedTimestamp.longValue() == -1) {
|
|
return 0;
|
|
}
|
|
return configPayload.getEndpoints() == null ? 1 : 2;
|
|
}
|
|
|
|
@VisibleForTesting
|
|
public final boolean validateConfig$vungle_ads_release(ConfigPayload configPayload) {
|
|
return ((configPayload != null ? configPayload.getEndpoints() : null) == null || !validateEndpoints$vungle_ads_release(configPayload.getEndpoints()) || configPayload.getPlacements() == null) ? false : true;
|
|
}
|
|
|
|
public static /* synthetic */ boolean validateEndpoints$vungle_ads_release$default(ConfigManager configManager, ConfigPayload.Endpoints endpoints2, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
endpoints2 = endpoints;
|
|
}
|
|
return configManager.validateEndpoints$vungle_ads_release(endpoints2);
|
|
}
|
|
|
|
@VisibleForTesting
|
|
public final boolean validateEndpoints$vungle_ads_release(ConfigPayload.Endpoints endpoints2) {
|
|
boolean z;
|
|
String adsEndpoint = endpoints2 != null ? endpoints2.getAdsEndpoint() : null;
|
|
boolean z2 = false;
|
|
if (adsEndpoint == null || adsEndpoint.length() == 0) {
|
|
AnalyticsClient.INSTANCE.logError$vungle_ads_release(122, "The ads endpoint was not provided in the config.", (r13 & 4) != 0 ? null : null, (r13 & 8) != 0 ? null : null, (r13 & 16) != 0 ? null : null);
|
|
z = false;
|
|
} else {
|
|
z = true;
|
|
}
|
|
String riEndpoint = endpoints2 != null ? endpoints2.getRiEndpoint() : null;
|
|
if (riEndpoint == null || riEndpoint.length() == 0) {
|
|
AnalyticsClient.INSTANCE.logError$vungle_ads_release(123, "The ri endpoint was not provided in the config.", (r13 & 4) != 0 ? null : null, (r13 & 8) != 0 ? null : null, (r13 & 16) != 0 ? null : null);
|
|
}
|
|
String mraidEndpoint = endpoints2 != null ? endpoints2.getMraidEndpoint() : null;
|
|
if (mraidEndpoint == null || mraidEndpoint.length() == 0) {
|
|
AnalyticsClient.INSTANCE.logError$vungle_ads_release(130, "The mraid endpoint was not provided in the config.", (r13 & 4) != 0 ? null : null, (r13 & 8) != 0 ? null : null, (r13 & 16) != 0 ? null : null);
|
|
} else {
|
|
z2 = z;
|
|
}
|
|
String metricsEndpoint = endpoints2 != null ? endpoints2.getMetricsEndpoint() : null;
|
|
if (metricsEndpoint == null || metricsEndpoint.length() == 0) {
|
|
AnalyticsClient.INSTANCE.logError$vungle_ads_release(125, "The metrics endpoint was not provided in the config.", (r13 & 4) != 0 ? null : null, (r13 & 8) != 0 ? null : null, (r13 & 16) != 0 ? null : null);
|
|
}
|
|
String errorLogsEndpoint = endpoints2 != null ? endpoints2.getErrorLogsEndpoint() : null;
|
|
if (errorLogsEndpoint == null || errorLogsEndpoint.length() == 0) {
|
|
Logger.Companion.e(TAG, "The error logging endpoint was not provided in the config.");
|
|
}
|
|
return z2;
|
|
}
|
|
|
|
public final boolean isCleverCacheEnabled() {
|
|
ConfigPayload.CleverCache cleverCache;
|
|
Boolean enabled;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (cleverCache = configPayload.getCleverCache()) == null || (enabled = cleverCache.getEnabled()) == null) {
|
|
return false;
|
|
}
|
|
return enabled.booleanValue();
|
|
}
|
|
|
|
public final long getCleverCacheDiskSize() {
|
|
ConfigPayload.CleverCache cleverCache;
|
|
Long diskSize;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (cleverCache = configPayload.getCleverCache()) == null || (diskSize = cleverCache.getDiskSize()) == null) {
|
|
return 1048576000L;
|
|
}
|
|
long j = 1024;
|
|
return diskSize.longValue() * j * j;
|
|
}
|
|
|
|
public final int getCleverCacheDiskPercentage() {
|
|
ConfigPayload.CleverCache cleverCache;
|
|
Integer diskPercentage;
|
|
ConfigPayload configPayload = config;
|
|
if (configPayload == null || (cleverCache = configPayload.getCleverCache()) == null || (diskPercentage = cleverCache.getDiskPercentage()) == null) {
|
|
return 3;
|
|
}
|
|
return diskPercentage.intValue();
|
|
}
|
|
|
|
public final ConfigPayload getCachedConfig(FilePreferences filePreferences, String appId) {
|
|
boolean equals;
|
|
Long refreshTime;
|
|
Intrinsics.checkNotNullParameter(filePreferences, "filePreferences");
|
|
Intrinsics.checkNotNullParameter(appId, "appId");
|
|
try {
|
|
String string = filePreferences.getString(Cookie.CONFIG_APP_ID);
|
|
if (string != null && string.length() != 0) {
|
|
equals = StringsKt__StringsJVMKt.equals(string, appId, true);
|
|
if (equals) {
|
|
String string2 = filePreferences.getString(Cookie.CONFIG_RESPONSE);
|
|
if (string2 == null) {
|
|
return null;
|
|
}
|
|
long j = filePreferences.getLong(Cookie.CONFIG_UPDATE_TIME, 0L);
|
|
StringFormat stringFormat = json;
|
|
DeserializationStrategy serializer = SerializersKt.serializer(stringFormat.getSerializersModule(), Reflection.typeOf(ConfigPayload.class));
|
|
Intrinsics.checkNotNull(serializer, "null cannot be cast to non-null type kotlinx.serialization.KSerializer<T of kotlinx.serialization.internal.Platform_commonKt.cast>");
|
|
ConfigPayload configPayload = (ConfigPayload) stringFormat.decodeFromString(serializer, string2);
|
|
ConfigPayload.ConfigSettings configSettings = configPayload.getConfigSettings();
|
|
if (((configSettings == null || (refreshTime = configSettings.getRefreshTime()) == null) ? -1L : refreshTime.longValue()) + j < System.currentTimeMillis()) {
|
|
Logger.Companion.w(TAG, "cache config expired. re-config");
|
|
return null;
|
|
}
|
|
Logger.Companion.w(TAG, "use cache config.");
|
|
return configPayload;
|
|
}
|
|
}
|
|
Logger.Companion.w(TAG, "app id mismatch, re-config");
|
|
return null;
|
|
} catch (Exception e) {
|
|
Logger.Companion.e(TAG, "Error while parsing cached config: " + e.getMessage());
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public final void updateCachedConfig(ConfigPayload config2, FilePreferences filePreferences) {
|
|
Intrinsics.checkNotNullParameter(config2, "config");
|
|
Intrinsics.checkNotNullParameter(filePreferences, "filePreferences");
|
|
try {
|
|
String str = applicationId;
|
|
if (str == null) {
|
|
Intrinsics.throwUninitializedPropertyAccessException("applicationId");
|
|
str = null;
|
|
}
|
|
filePreferences.put(Cookie.CONFIG_APP_ID, str);
|
|
filePreferences.put(Cookie.CONFIG_UPDATE_TIME, System.currentTimeMillis());
|
|
StringFormat stringFormat = json;
|
|
SerializationStrategy serializer = SerializersKt.serializer(stringFormat.getSerializersModule(), Reflection.typeOf(ConfigPayload.class));
|
|
Intrinsics.checkNotNull(serializer, "null cannot be cast to non-null type kotlinx.serialization.KSerializer<T of kotlinx.serialization.internal.Platform_commonKt.cast>");
|
|
filePreferences.put(Cookie.CONFIG_RESPONSE, stringFormat.encodeToString(serializer, config2));
|
|
filePreferences.apply();
|
|
} catch (Exception e) {
|
|
Logger.Companion.e(TAG, "Exception: " + e.getMessage() + " for updating cached config");
|
|
}
|
|
}
|
|
}
|