package o;

import ir.devixor.app.service.ForegroundService;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.yB, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2981yB extends Sb0 implements SC {
    public final /* synthetic */ int p;
    public /* synthetic */ Object q;
    public final /* synthetic */ ForegroundService r;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ C2981yB(ForegroundService foregroundService, InterfaceC0220Im interfaceC0220Im, int i) {
        super(2, interfaceC0220Im);
        this.p = i;
        this.r = foregroundService;
    }

    @Override // o.SC
    public final Object f(Object obj, Object obj2) {
        InterfaceC0065Cn interfaceC0065Cn = (InterfaceC0065Cn) obj;
        InterfaceC0220Im interfaceC0220Im = (InterfaceC0220Im) obj2;
        switch (this.p) {
        }
        return ((C2981yB) l(interfaceC0065Cn, interfaceC0220Im)).n(Oh0.a);
    }

    @Override // o.AbstractC0728ad
    public final InterfaceC0220Im l(Object obj, InterfaceC0220Im interfaceC0220Im) {
        switch (this.p) {
            case 0:
                C2981yB c2981yB = new C2981yB(this.r, interfaceC0220Im, 0);
                c2981yB.q = obj;
                return c2981yB;
            case 1:
                C2981yB c2981yB2 = new C2981yB(this.r, interfaceC0220Im, 1);
                c2981yB2.q = obj;
                return c2981yB2;
            case 2:
                C2981yB c2981yB3 = new C2981yB(this.r, interfaceC0220Im, 2);
                c2981yB3.q = obj;
                return c2981yB3;
            case 3:
                C2981yB c2981yB4 = new C2981yB(this.r, interfaceC0220Im, 3);
                c2981yB4.q = obj;
                return c2981yB4;
            case 4:
                C2981yB c2981yB5 = new C2981yB(this.r, interfaceC0220Im, 4);
                c2981yB5.q = obj;
                return c2981yB5;
            default:
                C2981yB c2981yB6 = new C2981yB(this.r, interfaceC0220Im, 5);
                c2981yB6.q = obj;
                return c2981yB6;
        }
    }

    @Override // o.AbstractC0728ad
    public final Object n(Object obj) throws JSONException {
        Object h20;
        Object h202;
        Object h203;
        Object h204;
        Object h205;
        switch (this.p) {
            case 0:
                IJ.H(obj);
                InterfaceC0065Cn interfaceC0065Cn = (InterfaceC0065Cn) this.q;
                ForegroundService foregroundService = this.r;
                InterfaceC0220Im interfaceC0220Im = null;
                AbstractC1692kh0.C(interfaceC0065Cn, null, new YA(foregroundService, interfaceC0220Im, 23), 3);
                AbstractC1692kh0.C(interfaceC0065Cn, null, new YA(foregroundService, interfaceC0220Im, 24), 3);
                return AbstractC1692kh0.C(interfaceC0065Cn, null, new C0697aB(foregroundService, interfaceC0220Im, 3), 3);
            case 1:
                IJ.H(obj);
                try {
                    h20 = ForegroundService.h(this.r);
                } catch (Throwable th) {
                    h20 = new H20(th);
                }
                return h20 instanceof H20 ? "" : h20;
            case 2:
                IJ.H(obj);
                try {
                    h202 = new JSONObject(ForegroundService.o(this.r)).optJSONArray("ips");
                    if (h202 == null) {
                        h202 = new JSONArray();
                    }
                } catch (Throwable th2) {
                    h202 = new H20(th2);
                }
                return h202 instanceof H20 ? new JSONArray() : h202;
            case 3:
                IJ.H(obj);
                try {
                    h203 = ForegroundService.h(this.r);
                } catch (Throwable th3) {
                    h203 = new H20(th3);
                }
                return I20.a(h203) == null ? h203 : "";
            case 4:
                IJ.H(obj);
                try {
                    h204 = new JSONObject(ForegroundService.o(this.r)).optJSONArray("ips");
                    if (h204 == null) {
                        h204 = new JSONArray();
                    }
                } catch (Throwable th4) {
                    h204 = new H20(th4);
                }
                return I20.a(h204) == null ? h204 : new JSONArray();
            default:
                IJ.H(obj);
                ForegroundService foregroundService2 = this.r;
                try {
                    h205 = new JSONObject(foregroundService2.n0(foregroundService2.getApplicationContext()));
                } catch (Throwable th5) {
                    h205 = new H20(th5);
                }
                if (I20.a(h205) == null) {
                    return h205;
                }
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("sims", new JSONArray());
                jSONObject.put("count", 0);
                return jSONObject;
        }
    }
}
