package com.unity3d.services; import android.content.Context; import com.unity3d.ads.IUnityAdsLoadListener; import com.unity3d.ads.IUnityAdsTokenListener; import com.unity3d.ads.UnityAdsLoadOptions; import com.unity3d.ads.UnityAdsShowOptions; import com.unity3d.ads.core.configuration.AlternativeFlowReader; import com.unity3d.ads.core.data.model.InitializationState; import com.unity3d.ads.core.data.model.Listeners; import com.unity3d.ads.core.domain.GetAdObject; import com.unity3d.ads.core.domain.GetAsyncHeaderBiddingToken; import com.unity3d.ads.core.domain.GetHeaderBiddingToken; import com.unity3d.ads.core.domain.GetInitializationState; import com.unity3d.ads.core.domain.InitializeBoldSDK; import com.unity3d.ads.core.domain.LegacyShowUseCase; import com.unity3d.ads.core.domain.SendDiagnosticEvent; import com.unity3d.ads.core.domain.SetInitializationState; import com.unity3d.ads.core.domain.om.OmFinishSession; import com.unity3d.services.banners.UnityBannerSize; import com.unity3d.services.core.di.IServiceComponent; import com.unity3d.services.core.di.IServiceProvider; import com.unity3d.services.core.di.ServiceProvider; import com.unity3d.services.core.domain.task.InitializeSDK; import kotlin.Lazy; import kotlin.LazyKt__LazyJVMKt; import kotlin.LazyThreadSafetyMode; import kotlin.jvm.functions.Function0; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.Reflection; import kotlin.jvm.internal.SourceDebugExtension; import kotlinx.coroutines.BuildersKt__BuildersKt; import kotlinx.coroutines.BuildersKt__Builders_commonKt; import kotlinx.coroutines.CoroutineScope; import kotlinx.coroutines.Job; @SourceDebugExtension({"SMAP\nUnityAdsSDK.kt\nKotlin\n*S Kotlin\n*F\n+ 1 UnityAdsSDK.kt\ncom/unity3d/services/UnityAdsSDK\n+ 2 IServiceComponent.kt\ncom/unity3d/services/core/di/IServiceComponentKt\n+ 3 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,177:1\n19#2:178\n19#2:179\n19#2:180\n16#2,4:181\n29#2,5:185\n19#2:190\n29#2,5:191\n19#2:197\n29#2,5:198\n29#2,5:203\n29#2,5:208\n29#2,5:213\n29#2,5:218\n29#2,5:223\n29#2,5:228\n29#2,5:233\n29#2,5:238\n1#3:196\n*S KotlinDebug\n*F\n+ 1 UnityAdsSDK.kt\ncom/unity3d/services/UnityAdsSDK\n*L\n70#1:178\n90#1:179\n100#1:180\n101#1:181,4\n119#1:185,5\n120#1:190\n128#1:191,5\n166#1:197\n49#1:198,5\n50#1:203,5\n51#1:208,5\n52#1:213,5\n53#1:218,5\n54#1:223,5\n55#1:228,5\n56#1:233,5\n57#1:238,5\n*E\n"}) /* loaded from: classes4.dex */ public final class UnityAdsSDK implements IServiceComponent { public static final UnityAdsSDK INSTANCE; private static final Lazy alternativeFlowReader$delegate; private static final Lazy context$delegate; private static final Lazy getAdObject$delegate; private static final Lazy getInitializationState$delegate; private static final Lazy initializeBoldSDK$delegate; private static final Lazy initializeSDK$delegate; private static final Lazy omFinishSession$delegate; private static final Lazy sendDiagnosticEvent$delegate; private static final Lazy setInitializationState$delegate; public final void finishOMIDSession(String opportunityId) { Intrinsics.checkNotNullParameter(opportunityId, "opportunityId"); CoroutineScope coroutineScope = (CoroutineScope) getServiceProvider().getRegistry().getService(ServiceProvider.NAMED_OMID_SCOPE, Reflection.getOrCreateKotlinClass(CoroutineScope.class)); BuildersKt__Builders_commonKt.launch$default(coroutineScope, null, null, new UnityAdsSDK$finishOMIDSession$1(opportunityId, coroutineScope, null), 3, null); } public final Job load(String str, UnityAdsLoadOptions loadOptions, IUnityAdsLoadListener iUnityAdsLoadListener, UnityBannerSize unityBannerSize) { Job launch$default; Intrinsics.checkNotNullParameter(loadOptions, "loadOptions"); CoroutineScope coroutineScope = (CoroutineScope) getServiceProvider().getRegistry().getService(ServiceProvider.NAMED_LOAD_SCOPE, Reflection.getOrCreateKotlinClass(CoroutineScope.class)); launch$default = BuildersKt__Builders_commonKt.launch$default(coroutineScope, null, null, new UnityAdsSDK$load$1(str, loadOptions, iUnityAdsLoadListener, unityBannerSize, coroutineScope, null), 3, null); return launch$default; } public final Job show(String str, UnityAdsShowOptions unityAdsShowOptions, Listeners listener) { Job launch$default; Intrinsics.checkNotNullParameter(listener, "listener"); CoroutineScope coroutineScope = (CoroutineScope) getServiceProvider().getRegistry().getService(ServiceProvider.NAMED_SHOW_SCOPE, Reflection.getOrCreateKotlinClass(CoroutineScope.class)); launch$default = BuildersKt__Builders_commonKt.launch$default(coroutineScope, null, null, new UnityAdsSDK$show$1((LegacyShowUseCase) getServiceProvider().getRegistry().getService("", Reflection.getOrCreateKotlinClass(LegacyShowUseCase.class)), str, unityAdsShowOptions, listener, coroutineScope, null), 3, null); return launch$default; } static { Lazy lazy; Lazy lazy2; Lazy lazy3; Lazy lazy4; Lazy lazy5; Lazy lazy6; Lazy lazy7; Lazy lazy8; Lazy lazy9; final UnityAdsSDK unityAdsSDK = new UnityAdsSDK(); INSTANCE = unityAdsSDK; LazyThreadSafetyMode lazyThreadSafetyMode = LazyThreadSafetyMode.NONE; final String str = ""; lazy = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.unity3d.services.UnityAdsSDK$special$$inlined$inject$default$1 /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(0); } /* JADX WARN: Type inference failed for: r0v3, types: [com.unity3d.services.core.domain.task.InitializeSDK, java.lang.Object] */ @Override // kotlin.jvm.functions.Function0 public final InitializeSDK invoke() { IServiceComponent iServiceComponent = IServiceComponent.this; return iServiceComponent.getServiceProvider().getRegistry().getService(str, Reflection.getOrCreateKotlinClass(InitializeSDK.class)); } }); initializeSDK$delegate = lazy; lazy2 = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.unity3d.services.UnityAdsSDK$special$$inlined$inject$default$2 /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(0); } /* JADX WARN: Type inference failed for: r0v3, types: [com.unity3d.ads.core.configuration.AlternativeFlowReader, java.lang.Object] */ @Override // kotlin.jvm.functions.Function0 public final AlternativeFlowReader invoke() { IServiceComponent iServiceComponent = IServiceComponent.this; return iServiceComponent.getServiceProvider().getRegistry().getService(str, Reflection.getOrCreateKotlinClass(AlternativeFlowReader.class)); } }); alternativeFlowReader$delegate = lazy2; lazy3 = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.unity3d.services.UnityAdsSDK$special$$inlined$inject$default$3 /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(0); } /* JADX WARN: Type inference failed for: r0v3, types: [com.unity3d.ads.core.domain.InitializeBoldSDK, java.lang.Object] */ @Override // kotlin.jvm.functions.Function0 public final InitializeBoldSDK invoke() { IServiceComponent iServiceComponent = IServiceComponent.this; return iServiceComponent.getServiceProvider().getRegistry().getService(str, Reflection.getOrCreateKotlinClass(InitializeBoldSDK.class)); } }); initializeBoldSDK$delegate = lazy3; lazy4 = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.unity3d.services.UnityAdsSDK$special$$inlined$inject$default$4 /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(0); } /* JADX WARN: Type inference failed for: r0v3, types: [com.unity3d.ads.core.domain.GetInitializationState, java.lang.Object] */ @Override // kotlin.jvm.functions.Function0 public final GetInitializationState invoke() { IServiceComponent iServiceComponent = IServiceComponent.this; return iServiceComponent.getServiceProvider().getRegistry().getService(str, Reflection.getOrCreateKotlinClass(GetInitializationState.class)); } }); getInitializationState$delegate = lazy4; lazy5 = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.unity3d.services.UnityAdsSDK$special$$inlined$inject$default$5 /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(0); } /* JADX WARN: Type inference failed for: r0v3, types: [com.unity3d.ads.core.domain.SendDiagnosticEvent, java.lang.Object] */ @Override // kotlin.jvm.functions.Function0 public final SendDiagnosticEvent invoke() { IServiceComponent iServiceComponent = IServiceComponent.this; return iServiceComponent.getServiceProvider().getRegistry().getService(str, Reflection.getOrCreateKotlinClass(SendDiagnosticEvent.class)); } }); sendDiagnosticEvent$delegate = lazy5; lazy6 = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.unity3d.services.UnityAdsSDK$special$$inlined$inject$default$6 /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(0); } /* JADX WARN: Type inference failed for: r0v3, types: [com.unity3d.ads.core.domain.om.OmFinishSession, java.lang.Object] */ @Override // kotlin.jvm.functions.Function0 public final OmFinishSession invoke() { IServiceComponent iServiceComponent = IServiceComponent.this; return iServiceComponent.getServiceProvider().getRegistry().getService(str, Reflection.getOrCreateKotlinClass(OmFinishSession.class)); } }); omFinishSession$delegate = lazy6; lazy7 = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.unity3d.services.UnityAdsSDK$special$$inlined$inject$default$7 /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(0); } /* JADX WARN: Type inference failed for: r0v3, types: [com.unity3d.ads.core.domain.GetAdObject, java.lang.Object] */ @Override // kotlin.jvm.functions.Function0 public final GetAdObject invoke() { IServiceComponent iServiceComponent = IServiceComponent.this; return iServiceComponent.getServiceProvider().getRegistry().getService(str, Reflection.getOrCreateKotlinClass(GetAdObject.class)); } }); getAdObject$delegate = lazy7; lazy8 = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.unity3d.services.UnityAdsSDK$special$$inlined$inject$default$8 /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(0); } /* JADX WARN: Type inference failed for: r0v3, types: [com.unity3d.ads.core.domain.SetInitializationState, java.lang.Object] */ @Override // kotlin.jvm.functions.Function0 public final SetInitializationState invoke() { IServiceComponent iServiceComponent = IServiceComponent.this; return iServiceComponent.getServiceProvider().getRegistry().getService(str, Reflection.getOrCreateKotlinClass(SetInitializationState.class)); } }); setInitializationState$delegate = lazy8; lazy9 = LazyKt__LazyJVMKt.lazy(lazyThreadSafetyMode, new Function0() { // from class: com.unity3d.services.UnityAdsSDK$special$$inlined$inject$default$9 /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(0); } /* JADX WARN: Type inference failed for: r0v3, types: [android.content.Context, java.lang.Object] */ @Override // kotlin.jvm.functions.Function0 public final Context invoke() { IServiceComponent iServiceComponent = IServiceComponent.this; return iServiceComponent.getServiceProvider().getRegistry().getService(str, Reflection.getOrCreateKotlinClass(Context.class)); } }); context$delegate = lazy9; } public final void getToken(IUnityAdsTokenListener iUnityAdsTokenListener) { Lazy lazy; final String str = ""; lazy = LazyKt__LazyJVMKt.lazy(LazyThreadSafetyMode.NONE, new Function0() { // from class: com.unity3d.services.UnityAdsSDK$getToken$$inlined$inject$default$1 /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(0); } /* JADX WARN: Type inference failed for: r0v3, types: [com.unity3d.ads.core.domain.GetAsyncHeaderBiddingToken, java.lang.Object] */ @Override // kotlin.jvm.functions.Function0 public final GetAsyncHeaderBiddingToken invoke() { IServiceComponent iServiceComponent = IServiceComponent.this; return iServiceComponent.getServiceProvider().getRegistry().getService(str, Reflection.getOrCreateKotlinClass(GetAsyncHeaderBiddingToken.class)); } }); CoroutineScope coroutineScope = (CoroutineScope) getServiceProvider().getRegistry().getService(ServiceProvider.NAMED_GET_TOKEN_SCOPE, Reflection.getOrCreateKotlinClass(CoroutineScope.class)); BuildersKt__Builders_commonKt.launch$default(coroutineScope, null, null, new UnityAdsSDK$getToken$2(iUnityAdsTokenListener, coroutineScope, lazy, null), 3, null); } private UnityAdsSDK() { } @Override // com.unity3d.services.core.di.IServiceComponent public IServiceProvider getServiceProvider() { return IServiceComponent.DefaultImpls.getServiceProvider(this); } /* JADX INFO: Access modifiers changed from: private */ public final InitializeSDK getInitializeSDK() { return (InitializeSDK) initializeSDK$delegate.getValue(); } /* JADX INFO: Access modifiers changed from: private */ public final AlternativeFlowReader getAlternativeFlowReader() { return (AlternativeFlowReader) alternativeFlowReader$delegate.getValue(); } /* JADX INFO: Access modifiers changed from: private */ public final InitializeBoldSDK getInitializeBoldSDK() { return (InitializeBoldSDK) initializeBoldSDK$delegate.getValue(); } private final GetInitializationState getGetInitializationState() { return (GetInitializationState) getInitializationState$delegate.getValue(); } private final SendDiagnosticEvent getSendDiagnosticEvent() { return (SendDiagnosticEvent) sendDiagnosticEvent$delegate.getValue(); } /* JADX INFO: Access modifiers changed from: private */ public final OmFinishSession getOmFinishSession() { return (OmFinishSession) omFinishSession$delegate.getValue(); } /* JADX INFO: Access modifiers changed from: private */ public final GetAdObject getGetAdObject() { return (GetAdObject) getAdObject$delegate.getValue(); } private final SetInitializationState getSetInitializationState() { return (SetInitializationState) setInitializationState$delegate.getValue(); } /* JADX INFO: Access modifiers changed from: private */ public final Context getContext() { return (Context) context$delegate.getValue(); } public final boolean isAlternativeFlowEnabled() { return getAlternativeFlowReader().invoke(); } public final void initialize() { getSetInitializationState().invoke(InitializationState.INITIALIZING); CoroutineScope coroutineScope = (CoroutineScope) getServiceProvider().getRegistry().getService(ServiceProvider.NAMED_INIT_SCOPE, Reflection.getOrCreateKotlinClass(CoroutineScope.class)); BuildersKt__Builders_commonKt.launch$default(coroutineScope, null, null, new UnityAdsSDK$initialize$1(coroutineScope, null), 3, null); } public static /* synthetic */ Job load$default(UnityAdsSDK unityAdsSDK, String str, UnityAdsLoadOptions unityAdsLoadOptions, IUnityAdsLoadListener iUnityAdsLoadListener, UnityBannerSize unityBannerSize, int i, Object obj) { if ((i & 8) != 0) { unityBannerSize = null; } return unityAdsSDK.load(str, unityAdsLoadOptions, iUnityAdsLoadListener, unityBannerSize); } public final String getToken() { Object runBlocking$default; runBlocking$default = BuildersKt__BuildersKt.runBlocking$default(null, new UnityAdsSDK$getToken$1(null), 1, null); return (String) runBlocking$default; } /* JADX INFO: Access modifiers changed from: private */ public static final GetAsyncHeaderBiddingToken getToken$lambda$0(Lazy lazy) { return (GetAsyncHeaderBiddingToken) lazy.getValue(); } /* JADX INFO: Access modifiers changed from: private */ /* JADX WARN: Can't wrap try/catch for region: R(20:0|1|(2:3|(16:5|6|(1:(4:9|10|11|12)(2:37|38))(2:39|(10:41|17|(1:19)(1:30)|20|21|(1:23)|24|(1:26)|27|28)(3:42|43|(1:45)(1:46)))|13|14|15|16|17|(0)(0)|20|21|(0)|24|(0)|27|28))|50|6|(0)(0)|13|14|15|16|17|(0)(0)|20|21|(0)|24|(0)|27|28|(1:(0))) */ /* JADX WARN: Code restructure failed: missing block: B:32:0x00d6, code lost: r0 = e; */ /* JADX WARN: Multi-variable type inference failed */ /* JADX WARN: Removed duplicated region for block: B:19:0x00ed */ /* JADX WARN: Removed duplicated region for block: B:23:0x011f */ /* JADX WARN: Removed duplicated region for block: B:26:0x012e */ /* JADX WARN: Removed duplicated region for block: B:30:0x00f1 */ /* JADX WARN: Removed duplicated region for block: B:39:0x0056 */ /* JADX WARN: Removed duplicated region for block: B:8:0x002e */ /* JADX WARN: Type inference failed for: r0v9, types: [T, java.lang.String] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final java.lang.Object fetchToken(java.lang.String r22, kotlin.coroutines.Continuation r23) { /* Method dump skipped, instructions count: 325 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.unity3d.services.UnityAdsSDK.fetchToken(java.lang.String, kotlin.coroutines.Continuation):java.lang.Object"); } private static final GetHeaderBiddingToken fetchToken$lambda$1(Lazy lazy) { return (GetHeaderBiddingToken) lazy.getValue(); } }