package defpackage;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.Set;

/* renamed from: ᵨᵳᵷᵭ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3762 extends AbstractC2162 implements InterfaceC0362 {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public final /* synthetic */ Object f14014;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public int f14015;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final /* synthetic */ int f14016;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ C3762(Object obj, InterfaceC4943 interfaceC4943, int i) {
        super(1, interfaceC4943);
        this.f14016 = i;
        this.f14014 = obj;
    }

    @Override // defpackage.InterfaceC0362
    /* renamed from: ᵴᵳ */
    public final Object mo1588(Object obj) {
        int i = this.f14016;
        C3637 c3637 = C3637.f13536;
        Object obj2 = this.f14014;
        InterfaceC4943 interfaceC4943 = (InterfaceC4943) obj;
        switch (i) {
            case 0:
                return new C3762((C1391) obj2, interfaceC4943, 0).mo1109(c3637);
            case 1:
                return new C3762((C0838) obj2, interfaceC4943, 1).mo1109(c3637);
            case 2:
                return new C3762((InterfaceC0362) obj2, interfaceC4943, 2).mo1109(c3637);
            default:
                return new C3762((C1548) obj2, interfaceC4943, 3).mo1109(c3637);
        }
    }

    @Override // defpackage.AbstractC1297
    /* renamed from: ᵸʓᵠ */
    public final Object mo1109(Object obj) throws IOException {
        Context context;
        int i = this.f14016;
        C3637 c3637 = C3637.f13536;
        EnumC3346 enumC3346 = EnumC3346.f12524;
        Object obj2 = this.f14014;
        switch (i) {
            case 0:
                int i2 = this.f14015;
                if (i2 == 0) {
                    ʼٴ.ᵺᵠ(obj);
                    C1391 c1391 = (C1391) obj2;
                    this.f14015 = 1;
                    SharedPreferences.Editor editorEdit = ((SharedPreferences) c1391.f5716.getValue()).edit();
                    Set set = c1391.f5717;
                    if (set == null) {
                        editorEdit.clear();
                    } else {
                        Iterator it = set.iterator();
                        while (it.hasNext()) {
                            editorEdit.remove((String) it.next());
                        }
                    }
                    if (editorEdit.commit()) {
                        if (((SharedPreferences) c1391.f5716.getValue()).getAll().isEmpty() && (context = c1391.f5718) != null) {
                            String str = c1391.f5721;
                            if (Build.VERSION.SDK_INT >= 24) {
                                AbstractC5079.m10545(context, str);
                            } else {
                                File file = new File(new File(context.getApplicationInfo().dataDir, "shared_prefs"), str.concat(".xml"));
                                File file2 = new File(file.getPath() + ".bak");
                                file.delete();
                                file2.delete();
                            }
                        }
                        if (set != null) {
                            set.clear();
                        }
                        return c3637 == enumC3346 ? enumC3346 : c3637;
                    }
                    C0910.m3045("Unable to delete migrated keys from SharedPreferences.");
                } else {
                    if (i2 == 1) {
                        ʼٴ.ᵺᵠ(obj);
                        return c3637;
                    }
                    ᵹˉᵞ.ᵳٴᵶ("call to 'resume' before 'invoke' with coroutine");
                }
                return null;
            case 1:
                int i3 = this.f14015;
                if (i3 == 0) {
                    ʼٴ.ᵺᵠ(obj);
                    this.f14015 = 1;
                    Object objMo1588 = ((C0838) obj2).mo1588(this);
                    return objMo1588 == enumC3346 ? enumC3346 : objMo1588;
                }
                if (i3 == 1) {
                    ʼٴ.ᵺᵠ(obj);
                    return obj;
                }
                ᵹˉᵞ.ᵳٴᵶ("call to 'resume' before 'invoke' with coroutine");
                return null;
            case 2:
                int i4 = this.f14015;
                if (i4 == 0) {
                    ʼٴ.ᵺᵠ(obj);
                    this.f14015 = 1;
                    return ((InterfaceC0362) obj2).mo1588(this) == enumC3346 ? enumC3346 : c3637;
                }
                if (i4 == 1) {
                    ʼٴ.ᵺᵠ(obj);
                    return c3637;
                }
                ᵹˉᵞ.ᵳٴᵶ("call to 'resume' before 'invoke' with coroutine");
                return null;
            default:
                C1548 c1548 = (C1548) obj2;
                int i5 = this.f14015;
                if (i5 == 0) {
                    ʼٴ.ᵺᵠ(obj);
                    InterfaceC0362 interfaceC0362 = c1548.f6181;
                    this.f14015 = 1;
                    obj = interfaceC0362.mo1588(this);
                    if (obj == enumC3346) {
                        return enumC3346;
                    }
                } else {
                    if (i5 != 1) {
                        ᵹˉᵞ.ᵳٴᵶ("call to 'resume' before 'invoke' with coroutine");
                        return null;
                    }
                    ʼٴ.ᵺᵠ(obj);
                }
                return new C4809((InterfaceC3042) obj);
        }
    }
}
