package V2;

import android.content.Context;
import m3.AbstractC2467b;
import s2.SharedPreferencesC2907b;
import w4.C3137A;

/* JADX INFO: renamed from: V2.e, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0652e extends C4.j implements J4.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ Context f7735a;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0652e(Context context, A4.d dVar) {
        super(2, dVar);
        this.f7735a = context;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        return new C0652e(this.f7735a, dVar);
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        C0652e c0652e = (C0652e) create((V4.C) obj, (A4.d) obj2);
        C3137A c3137a = C3137A.f25453a;
        c0652e.invokeSuspend(c3137a);
        return c3137a;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:6:0x002c  */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        Object objD;
        String str;
        B4.a aVar = B4.a.f492a;
        AbstractC2467b.l(obj);
        Context applicationContext = this.f7735a.getApplicationContext();
        kotlin.jvm.internal.o.g(applicationContext, "getApplicationContext(...)");
        Context applicationContext2 = applicationContext.getApplicationContext();
        kotlin.jvm.internal.o.g(applicationContext2, "getApplicationContext(...)");
        String string = ((SharedPreferencesC2907b) W.c.D(applicationContext2)).getString("continue_watching_payload", null);
        if (string != null) {
            boolean zQ0 = S4.p.Q0(string);
            str = string;
            if (zQ0) {
                Context context = AbstractC0696m3.f7937d0;
                if (context != null) {
                    try {
                        objD = context.getSharedPreferences("debridstream_app_progress_cache", 0).getString("trakt_continue_watching_json", null);
                    } catch (Throwable th) {
                        objD = AbstractC2467b.d(th);
                    }
                    obj = (String) (objD instanceof w4.m ? null : objD);
                }
                str = obj;
            }
        }
        Y4.c0 c0Var = C0706p0.f7996a;
        C0706p0.i(str);
        return C3137A.f25453a;
    }
}
