- 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
382 lines
16 KiB
Java
382 lines
16 KiB
Java
package com.vungle.ads;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.content.Context;
|
|
import androidx.annotation.Keep;
|
|
import androidx.annotation.VisibleForTesting;
|
|
import com.google.android.gms.ads.RequestConfiguration;
|
|
import com.vungle.ads.internal.bidding.BidTokenEncoder;
|
|
import com.vungle.ads.internal.downloader.AssetDownloader;
|
|
import com.vungle.ads.internal.downloader.Downloader;
|
|
import com.vungle.ads.internal.executor.Executors;
|
|
import com.vungle.ads.internal.executor.SDKExecutors;
|
|
import com.vungle.ads.internal.executor.VungleThreadPoolExecutor;
|
|
import com.vungle.ads.internal.locale.LocaleInfo;
|
|
import com.vungle.ads.internal.locale.SystemLocaleInfo;
|
|
import com.vungle.ads.internal.network.VungleApiClient;
|
|
import com.vungle.ads.internal.omsdk.OMInjector;
|
|
import com.vungle.ads.internal.omsdk.OMTracker;
|
|
import com.vungle.ads.internal.persistence.FilePreferences;
|
|
import com.vungle.ads.internal.platform.AndroidPlatform;
|
|
import com.vungle.ads.internal.platform.Platform;
|
|
import com.vungle.ads.internal.signals.SignalManager;
|
|
import com.vungle.ads.internal.task.JobCreator;
|
|
import com.vungle.ads.internal.task.JobRunner;
|
|
import com.vungle.ads.internal.task.JobRunnerThreadPriorityHelper;
|
|
import com.vungle.ads.internal.task.VungleJobCreator;
|
|
import com.vungle.ads.internal.task.VungleJobRunner;
|
|
import com.vungle.ads.internal.util.ConcurrencyTimeoutProvider;
|
|
import com.vungle.ads.internal.util.PathProvider;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import kotlin.Lazy;
|
|
import kotlin.LazyKt__LazyJVMKt;
|
|
import kotlin.LazyThreadSafetyMode;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public final class ServiceLocator {
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
@SuppressLint({"StaticFieldLeak"})
|
|
private static volatile ServiceLocator INSTANCE;
|
|
private final Map<Class<?>, Object> cache;
|
|
private final Map<Class<?>, Creator<?>> creators;
|
|
private final Context ctx;
|
|
|
|
public /* synthetic */ ServiceLocator(Context context, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(context);
|
|
}
|
|
|
|
private ServiceLocator(Context context) {
|
|
Context applicationContext = context.getApplicationContext();
|
|
Intrinsics.checkNotNullExpressionValue(applicationContext, "context.applicationContext");
|
|
this.ctx = applicationContext;
|
|
this.creators = new HashMap();
|
|
this.cache = new HashMap();
|
|
buildCreators();
|
|
}
|
|
|
|
public final synchronized <T> T getService(Class<T> serviceClass) {
|
|
Intrinsics.checkNotNullParameter(serviceClass, "serviceClass");
|
|
return (T) getOrBuild(serviceClass);
|
|
}
|
|
|
|
public final synchronized <T> boolean isCreated(Class<T> serviceClass) {
|
|
Intrinsics.checkNotNullParameter(serviceClass, "serviceClass");
|
|
return this.cache.containsKey(getServiceClass(serviceClass));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public final <T> T getOrBuild(Class<T> cls) {
|
|
Class<?> serviceClass = getServiceClass(cls);
|
|
T t = (T) this.cache.get(serviceClass);
|
|
if (t != null) {
|
|
return t;
|
|
}
|
|
Creator<?> creator = this.creators.get(serviceClass);
|
|
if (creator == null) {
|
|
throw new IllegalArgumentException("Unknown class");
|
|
}
|
|
T t2 = (T) creator.create();
|
|
if (creator.isSingleton()) {
|
|
this.cache.put(serviceClass, t2);
|
|
}
|
|
return t2;
|
|
}
|
|
|
|
@VisibleForTesting
|
|
public final <T> void bindService$vungle_ads_release(Class<?> serviceClass, T t) {
|
|
Intrinsics.checkNotNullParameter(serviceClass, "serviceClass");
|
|
this.cache.put(serviceClass, t);
|
|
}
|
|
|
|
private final Class<?> getServiceClass(Class<?> cls) {
|
|
for (Class<?> cls2 : this.creators.keySet()) {
|
|
if (cls2.isAssignableFrom(cls)) {
|
|
return cls2;
|
|
}
|
|
}
|
|
throw new IllegalArgumentException("Unknown dependency for " + cls);
|
|
}
|
|
|
|
private final void buildCreators() {
|
|
this.creators.put(JobCreator.class, new Creator<JobCreator>() { // from class: com.vungle.ads.ServiceLocator$buildCreators$1
|
|
{
|
|
super(ServiceLocator.this, false, 1, null);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public JobCreator create() {
|
|
Context context;
|
|
Object orBuild;
|
|
context = ServiceLocator.this.ctx;
|
|
orBuild = ServiceLocator.this.getOrBuild(PathProvider.class);
|
|
return new VungleJobCreator(context, (PathProvider) orBuild);
|
|
}
|
|
});
|
|
this.creators.put(JobRunner.class, new Creator<JobRunner>() { // from class: com.vungle.ads.ServiceLocator$buildCreators$2
|
|
{
|
|
super(ServiceLocator.this, false, 1, null);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public JobRunner create() {
|
|
Object orBuild;
|
|
Object orBuild2;
|
|
orBuild = ServiceLocator.this.getOrBuild(JobCreator.class);
|
|
orBuild2 = ServiceLocator.this.getOrBuild(Executors.class);
|
|
return new VungleJobRunner((JobCreator) orBuild, ((Executors) orBuild2).getJobExecutor(), new JobRunnerThreadPriorityHelper());
|
|
}
|
|
});
|
|
this.creators.put(VungleApiClient.class, new Creator<VungleApiClient>() { // from class: com.vungle.ads.ServiceLocator$buildCreators$3
|
|
{
|
|
super(ServiceLocator.this, false, 1, null);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public VungleApiClient create() {
|
|
Context context;
|
|
Object orBuild;
|
|
Object orBuild2;
|
|
context = ServiceLocator.this.ctx;
|
|
orBuild = ServiceLocator.this.getOrBuild(Platform.class);
|
|
orBuild2 = ServiceLocator.this.getOrBuild(FilePreferences.class);
|
|
return new VungleApiClient(context, (Platform) orBuild, (FilePreferences) orBuild2);
|
|
}
|
|
});
|
|
this.creators.put(Platform.class, new Creator<Platform>() { // from class: com.vungle.ads.ServiceLocator$buildCreators$4
|
|
{
|
|
super(ServiceLocator.this, false, 1, null);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public Platform create() {
|
|
Object orBuild;
|
|
Context context;
|
|
orBuild = ServiceLocator.this.getOrBuild(Executors.class);
|
|
context = ServiceLocator.this.ctx;
|
|
return new AndroidPlatform(context, ((Executors) orBuild).getUaExecutor());
|
|
}
|
|
});
|
|
this.creators.put(Executors.class, new Creator<Executors>(this) { // from class: com.vungle.ads.ServiceLocator$buildCreators$5
|
|
{
|
|
super(this, false, 1, null);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public Executors create() {
|
|
return new SDKExecutors();
|
|
}
|
|
});
|
|
this.creators.put(OMInjector.class, new Creator<OMInjector>() { // from class: com.vungle.ads.ServiceLocator$buildCreators$6
|
|
{
|
|
super(ServiceLocator.this, false, 1, null);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public OMInjector create() {
|
|
Context context;
|
|
context = ServiceLocator.this.ctx;
|
|
return new OMInjector(context);
|
|
}
|
|
});
|
|
this.creators.put(OMTracker.Factory.class, new Creator<OMTracker.Factory>(this) { // from class: com.vungle.ads.ServiceLocator$buildCreators$7
|
|
{
|
|
super(this, false, 1, null);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public OMTracker.Factory create() {
|
|
return new OMTracker.Factory();
|
|
}
|
|
});
|
|
this.creators.put(FilePreferences.class, new Creator<FilePreferences>() { // from class: com.vungle.ads.ServiceLocator$buildCreators$8
|
|
{
|
|
super(ServiceLocator.this, false, 1, null);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public FilePreferences create() {
|
|
Object orBuild;
|
|
Object orBuild2;
|
|
FilePreferences.Companion companion = FilePreferences.Companion;
|
|
orBuild = ServiceLocator.this.getOrBuild(Executors.class);
|
|
VungleThreadPoolExecutor ioExecutor = ((Executors) orBuild).getIoExecutor();
|
|
orBuild2 = ServiceLocator.this.getOrBuild(PathProvider.class);
|
|
return FilePreferences.Companion.get$default(companion, ioExecutor, (PathProvider) orBuild2, null, 4, null);
|
|
}
|
|
});
|
|
this.creators.put(LocaleInfo.class, new Creator<LocaleInfo>(this) { // from class: com.vungle.ads.ServiceLocator$buildCreators$9
|
|
{
|
|
super(this, false, 1, null);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public LocaleInfo create() {
|
|
return new SystemLocaleInfo();
|
|
}
|
|
});
|
|
this.creators.put(BidTokenEncoder.class, new Creator<BidTokenEncoder>() { // from class: com.vungle.ads.ServiceLocator$buildCreators$10
|
|
{
|
|
super(ServiceLocator.this, false, 1, null);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public BidTokenEncoder create() {
|
|
Context context;
|
|
context = ServiceLocator.this.ctx;
|
|
return new BidTokenEncoder(context);
|
|
}
|
|
});
|
|
this.creators.put(PathProvider.class, new Creator<PathProvider>() { // from class: com.vungle.ads.ServiceLocator$buildCreators$11
|
|
{
|
|
super(ServiceLocator.this, false, 1, null);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public PathProvider create() {
|
|
Context context;
|
|
context = ServiceLocator.this.ctx;
|
|
return new PathProvider(context);
|
|
}
|
|
});
|
|
this.creators.put(Downloader.class, new Creator<Downloader>() { // from class: com.vungle.ads.ServiceLocator$buildCreators$12
|
|
{
|
|
super(false);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public Downloader create() {
|
|
Object orBuild;
|
|
Object orBuild2;
|
|
orBuild = ServiceLocator.this.getOrBuild(Executors.class);
|
|
VungleThreadPoolExecutor downloaderExecutor = ((Executors) orBuild).getDownloaderExecutor();
|
|
orBuild2 = ServiceLocator.this.getOrBuild(PathProvider.class);
|
|
return new AssetDownloader(downloaderExecutor, (PathProvider) orBuild2);
|
|
}
|
|
});
|
|
this.creators.put(ConcurrencyTimeoutProvider.class, new Creator<ConcurrencyTimeoutProvider>(this) { // from class: com.vungle.ads.ServiceLocator$buildCreators$13
|
|
{
|
|
super(this, false, 1, null);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public ConcurrencyTimeoutProvider create() {
|
|
return new ConcurrencyTimeoutProvider();
|
|
}
|
|
});
|
|
this.creators.put(SignalManager.class, new Creator<SignalManager>() { // from class: com.vungle.ads.ServiceLocator$buildCreators$14
|
|
{
|
|
super(ServiceLocator.this, false, 1, null);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.vungle.ads.ServiceLocator.Creator
|
|
public SignalManager create() {
|
|
Context context;
|
|
context = ServiceLocator.this.ctx;
|
|
return new SignalManager(context);
|
|
}
|
|
});
|
|
}
|
|
|
|
public abstract class Creator<T> {
|
|
private final boolean isSingleton;
|
|
|
|
public abstract T create();
|
|
|
|
public final boolean isSingleton() {
|
|
return this.isSingleton;
|
|
}
|
|
|
|
public Creator(boolean z) {
|
|
this.isSingleton = z;
|
|
}
|
|
|
|
public /* synthetic */ Creator(ServiceLocator serviceLocator, boolean z, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this((i & 1) != 0 ? true : z);
|
|
}
|
|
}
|
|
|
|
@Keep
|
|
public static final class Companion {
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
@VisibleForTesting
|
|
public static /* synthetic */ void getINSTANCE$vungle_ads_release$annotations() {
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
|
|
public final ServiceLocator getINSTANCE$vungle_ads_release() {
|
|
return ServiceLocator.INSTANCE;
|
|
}
|
|
|
|
public final void setINSTANCE$vungle_ads_release(ServiceLocator serviceLocator) {
|
|
ServiceLocator.INSTANCE = serviceLocator;
|
|
}
|
|
|
|
public final ServiceLocator getInstance(Context context) {
|
|
Intrinsics.checkNotNullParameter(context, "context");
|
|
ServiceLocator iNSTANCE$vungle_ads_release = getINSTANCE$vungle_ads_release();
|
|
if (iNSTANCE$vungle_ads_release == null) {
|
|
synchronized (this) {
|
|
Companion companion = ServiceLocator.Companion;
|
|
ServiceLocator iNSTANCE$vungle_ads_release2 = companion.getINSTANCE$vungle_ads_release();
|
|
if (iNSTANCE$vungle_ads_release2 == null) {
|
|
iNSTANCE$vungle_ads_release2 = new ServiceLocator(context, null);
|
|
companion.setINSTANCE$vungle_ads_release(iNSTANCE$vungle_ads_release2);
|
|
}
|
|
iNSTANCE$vungle_ads_release = iNSTANCE$vungle_ads_release2;
|
|
}
|
|
}
|
|
return iNSTANCE$vungle_ads_release;
|
|
}
|
|
|
|
public final /* synthetic */ <T> Lazy inject(final Context context) {
|
|
Lazy lazy;
|
|
Intrinsics.checkNotNullParameter(context, "context");
|
|
LazyThreadSafetyMode lazyThreadSafetyMode = LazyThreadSafetyMode.SYNCHRONIZED;
|
|
Intrinsics.needClassReification();
|
|
lazy = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.vungle.ads.ServiceLocator$Companion$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: [T, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function0
|
|
public final T invoke() {
|
|
ServiceLocator companion = ServiceLocator.Companion.getInstance(context);
|
|
Intrinsics.reifiedOperationMarker(4, RequestConfiguration.MAX_AD_CONTENT_RATING_T);
|
|
return companion.getService(Object.class);
|
|
}
|
|
});
|
|
return lazy;
|
|
}
|
|
|
|
public final synchronized void deInit() {
|
|
setINSTANCE$vungle_ads_release(null);
|
|
}
|
|
}
|
|
}
|