package com.unity3d.services.core.domain.task; import c9.p; import com.unity3d.services.core.domain.task.InitializeStateReset; import d9.j; import kotlin.coroutines.jvm.internal.f; import kotlin.coroutines.jvm.internal.l; import s8.v; import v8.d; @f(c = "com.unity3d.services.core.domain.task.InitializeStateReset$doWork$2", f = "InitializeStateReset.kt", l = {39}, m = "invokeSuspend") /* loaded from: classes2.dex */ final class InitializeStateReset$doWork$2 extends l implements p { final /* synthetic */ InitializeStateReset.Params $params; int label; final /* synthetic */ InitializeStateReset this$0; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ InitializeStateReset$doWork$2(InitializeStateReset initializeStateReset, InitializeStateReset.Params params, d dVar) { super(2, dVar); this.this$0 = initializeStateReset; this.$params = params; } @Override // kotlin.coroutines.jvm.internal.a public final d create(Object obj, d dVar) { j.e(dVar, "completion"); return new InitializeStateReset$doWork$2(this.this$0, this.$params, dVar); } @Override // c9.p public final Object invoke(Object obj, Object obj2) { return ((InitializeStateReset$doWork$2) create(obj, (d) obj2)).invokeSuspend(v.f14109a); } /* JADX WARN: Removed duplicated region for block: B:11:0x0073 A[Catch: all -> 0x00ba, CancellationException -> 0x00e3, TryCatch #2 {CancellationException -> 0x00e3, all -> 0x00ba, blocks: (B:5:0x000c, B:6:0x0058, B:9:0x0065, B:11:0x0073, B:14:0x0086, B:16:0x0089, B:18:0x0097, B:20:0x00a4, B:23:0x00a7, B:33:0x0084, B:34:0x00b2, B:35:0x00b9, B:36:0x005d, B:37:0x0064, B:41:0x001b, B:43:0x002f, B:44:0x0032, B:46:0x0038, B:48:0x0040), top: B:2:0x0008 }] */ /* JADX WARN: Removed duplicated region for block: B:34:0x00b2 A[Catch: all -> 0x00ba, CancellationException -> 0x00e3, TryCatch #2 {CancellationException -> 0x00e3, all -> 0x00ba, blocks: (B:5:0x000c, B:6:0x0058, B:9:0x0065, B:11:0x0073, B:14:0x0086, B:16:0x0089, B:18:0x0097, B:20:0x00a4, B:23:0x00a7, B:33:0x0084, B:34:0x00b2, B:35:0x00b9, B:36:0x005d, B:37:0x0064, B:41:0x001b, B:43:0x002f, B:44:0x0032, B:46:0x0038, B:48:0x0040), top: B:2:0x0008 }] */ @Override // kotlin.coroutines.jvm.internal.a /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public final java.lang.Object invokeSuspend(java.lang.Object r7) { /* r6 = this; java.lang.Object r0 = w8.b.c() int r1 = r6.label r2 = 0 r3 = 1 if (r1 == 0) goto L18 if (r1 != r3) goto L10 s8.o.b(r7) // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 goto L58 L10: java.lang.IllegalStateException r7 = new java.lang.IllegalStateException java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine" r7.(r0) throw r7 L18: s8.o.b(r7) s8.n$a r7 = s8.n.f14096b // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 java.lang.String r7 = "Unity Ads init: starting init" com.unity3d.services.core.log.DeviceLog.debug(r7) // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 d9.q r7 = new d9.q // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 r7.() // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 com.unity3d.services.core.webview.WebViewApp r1 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp() // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 r7.f9209a = r1 // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 if (r1 == 0) goto L32 r1.resetWebViewAppInitialization() // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 L32: java.lang.Object r1 = r7.f9209a // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 com.unity3d.services.core.webview.WebViewApp r1 = (com.unity3d.services.core.webview.WebViewApp) r1 // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 if (r1 == 0) goto L3d com.unity3d.services.core.webview.WebView r1 = r1.getWebView() // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 goto L3e L3d: r1 = r2 L3e: if (r1 == 0) goto L65 com.unity3d.services.core.domain.task.InitializeStateReset$Params r1 = r6.$params // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 com.unity3d.services.core.configuration.Configuration r1 = r1.getConfig() // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 long r4 = r1.getWebViewAppCreateTimeout() // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 com.unity3d.services.core.domain.task.InitializeStateReset$doWork$2$invokeSuspend$$inlined$runReturnSuspendCatching$lambda$1 r1 = new com.unity3d.services.core.domain.task.InitializeStateReset$doWork$2$invokeSuspend$$inlined$runReturnSuspendCatching$lambda$1 // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 r1.(r7, r2, r6) // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 r6.label = r3 // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 java.lang.Object r7 = k9.y2.d(r4, r1, r6) // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 if (r7 != r0) goto L58 return r0 L58: s8.v r7 = (s8.v) r7 // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 if (r7 == 0) goto L5d goto L65 L5d: java.lang.Exception r7 = new java.lang.Exception // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 java.lang.String r0 = "Reset failed on opening ConditionVariable" r7.(r0) // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 throw r7 // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 L65: com.unity3d.services.core.domain.task.InitializeStateReset r7 = r6.this$0 // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 com.unity3d.services.core.domain.task.InitializeStateReset.access$unregisterLifecycleCallbacks(r7) // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 com.unity3d.services.core.properties.SdkProperties.setCacheDirectory(r2) // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 java.io.File r7 = com.unity3d.services.core.properties.SdkProperties.getCacheDirectory() // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 if (r7 == 0) goto Lb2 r7 = 0 com.unity3d.services.core.properties.SdkProperties.setInitialized(r7) // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 com.unity3d.services.core.domain.task.InitializeStateReset$Params r0 = r6.$params // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 com.unity3d.services.core.configuration.Configuration r0 = r0.getConfig() // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 java.lang.String[] r0 = r0.getModuleConfigurationList() // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 if (r0 == 0) goto L84 goto L86 L84: java.lang.String[] r0 = new java.lang.String[r7] // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 L86: int r1 = r0.length // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 L87: if (r7 >= r1) goto La7 r2 = r0[r7] // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 com.unity3d.services.core.domain.task.InitializeStateReset$Params r3 = r6.$params // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 com.unity3d.services.core.configuration.Configuration r3 = r3.getConfig() // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 com.unity3d.services.core.configuration.IModuleConfiguration r2 = r3.getModuleConfiguration(r2) // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 if (r2 == 0) goto La4 com.unity3d.services.core.domain.task.InitializeStateReset$Params r3 = r6.$params // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 com.unity3d.services.core.configuration.Configuration r3 = r3.getConfig() // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 boolean r2 = r2.resetState(r3) // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 kotlin.coroutines.jvm.internal.b.a(r2) // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 La4: int r7 = r7 + 1 goto L87 La7: com.unity3d.services.core.domain.task.InitializeStateReset$Params r7 = r6.$params // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 com.unity3d.services.core.configuration.Configuration r7 = r7.getConfig() // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 java.lang.Object r7 = s8.n.b(r7) // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 goto Lc5 Lb2: java.lang.Exception r7 = new java.lang.Exception // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 java.lang.String r0 = "Cache directory is NULL" r7.(r0) // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 throw r7 // Catch: java.lang.Throwable -> Lba java.util.concurrent.CancellationException -> Le3 Lba: r7 = move-exception s8.n$a r0 = s8.n.f14096b java.lang.Object r7 = s8.o.a(r7) java.lang.Object r7 = s8.n.b(r7) Lc5: boolean r0 = s8.n.g(r7) if (r0 == 0) goto Ld0 java.lang.Object r7 = s8.n.b(r7) goto Lde Ld0: java.lang.Throwable r0 = s8.n.d(r7) if (r0 == 0) goto Lde java.lang.Object r7 = s8.o.a(r0) java.lang.Object r7 = s8.n.b(r7) Lde: s8.n r7 = s8.n.a(r7) return r7 Le3: r7 = move-exception throw r7 */ throw new UnsupportedOperationException("Method not decompiled: com.unity3d.services.core.domain.task.InitializeStateReset$doWork$2.invokeSuspend(java.lang.Object):java.lang.Object"); } }