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.sB, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2411sB extends Sb0 implements SC {
    public final /* synthetic */ int p = 0;
    public String q;
    public int r;
    public final /* synthetic */ ForegroundService s;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C2411sB(ForegroundService foregroundService, String str, InterfaceC0220Im interfaceC0220Im) {
        super(2, interfaceC0220Im);
        this.q = str;
        this.s = foregroundService;
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    /* JADX WARN: Removed duplicated region for block: B:161:0x030f  */
    /* JADX WARN: Removed duplicated region for block: B:170:0x0333  */
    /* JADX WARN: Removed duplicated region for block: B:196:0x039b  */
    /* JADX WARN: Removed duplicated region for block: B:205:0x03bf  */
    /* JADX WARN: Removed duplicated region for block: B:232:0x0430  */
    /* JADX WARN: Removed duplicated region for block: B:247:0x046e  */
    /* JADX WARN: Removed duplicated region for block: B:268:0x04c9  */
    /* JADX WARN: Removed duplicated region for block: B:277:0x04ee  */
    /* JADX WARN: Removed duplicated region for block: B:286:0x0511  */
    /* JADX WARN: Removed duplicated region for block: B:289:0x051b A[Catch: Exception -> 0x011b, TryCatch #0 {Exception -> 0x011b, blocks: (B:385:0x06ee, B:380:0x06d5, B:370:0x068d, B:346:0x0617, B:325:0x05c3, B:307:0x056f, B:299:0x0547, B:168:0x0327, B:194:0x038f, B:275:0x04e2, B:90:0x01dd, B:203:0x03b3, B:245:0x0462, B:230:0x0424, B:266:0x04bd, B:81:0x01b7, B:72:0x0191, B:284:0x0505, B:51:0x0134, B:159:0x0304, B:37:0x0101, B:40:0x010b, B:45:0x011e, B:48:0x0128, B:54:0x0142, B:57:0x014c, B:60:0x015d, B:63:0x0167, B:66:0x017b, B:69:0x0185, B:75:0x019f, B:78:0x01a7, B:84:0x01c5, B:87:0x01cd, B:93:0x01eb, B:96:0x01f5, B:99:0x0207, B:102:0x0211, B:105:0x0221, B:108:0x022b, B:111:0x023c, B:114:0x0246, B:117:0x0255, B:120:0x025f, B:123:0x026f, B:126:0x0279, B:129:0x0289, B:132:0x0293, B:135:0x02a3, B:138:0x02ad, B:141:0x02bc, B:144:0x02c6, B:147:0x02d6, B:150:0x02e0, B:153:0x02f0, B:156:0x02fa, B:162:0x0311, B:165:0x031b, B:171:0x0335, B:174:0x033f, B:176:0x0343, B:179:0x034d, B:182:0x035d, B:185:0x0367, B:188:0x0377, B:191:0x037f, B:197:0x039d, B:200:0x03a7, B:206:0x03c1, B:209:0x03cb, B:212:0x03db, B:215:0x03e5, B:218:0x03f5, B:221:0x03ff, B:224:0x040e, B:227:0x0418, B:233:0x0432, B:236:0x043c, B:239:0x044c, B:242:0x0456, B:248:0x0470, B:251:0x047a, B:254:0x048b, B:257:0x0495, B:260:0x04a5, B:263:0x04ad, B:269:0x04cb, B:272:0x04d2, B:278:0x04f0, B:281:0x04f9, B:287:0x0513, B:395:0x0722, B:289:0x051b, B:291:0x0523, B:294:0x0533, B:296:0x053b, B:302:0x0555, B:304:0x055b, B:310:0x057f, B:312:0x0587, B:315:0x0597, B:317:0x059f, B:320:0x05af, B:322:0x05b7, B:328:0x05d1, B:330:0x05d9, B:332:0x05dd, B:334:0x05e5, B:336:0x05e9, B:338:0x05ef, B:341:0x0603, B:343:0x060b, B:349:0x0625, B:351:0x062d, B:354:0x063d, B:356:0x0645, B:359:0x0655, B:361:0x065b, B:365:0x0673, B:367:0x0679, B:364:0x0667, B:373:0x069d, B:375:0x06a5, B:377:0x06b8, B:382:0x06db, B:387:0x06f4, B:389:0x06fa, B:392:0x070d), top: B:402:0x0024 }] */
    /* JADX WARN: Removed duplicated region for block: B:291:0x0523 A[Catch: Exception -> 0x011b, TryCatch #0 {Exception -> 0x011b, blocks: (B:385:0x06ee, B:380:0x06d5, B:370:0x068d, B:346:0x0617, B:325:0x05c3, B:307:0x056f, B:299:0x0547, B:168:0x0327, B:194:0x038f, B:275:0x04e2, B:90:0x01dd, B:203:0x03b3, B:245:0x0462, B:230:0x0424, B:266:0x04bd, B:81:0x01b7, B:72:0x0191, B:284:0x0505, B:51:0x0134, B:159:0x0304, B:37:0x0101, B:40:0x010b, B:45:0x011e, B:48:0x0128, B:54:0x0142, B:57:0x014c, B:60:0x015d, B:63:0x0167, B:66:0x017b, B:69:0x0185, B:75:0x019f, B:78:0x01a7, B:84:0x01c5, B:87:0x01cd, B:93:0x01eb, B:96:0x01f5, B:99:0x0207, B:102:0x0211, B:105:0x0221, B:108:0x022b, B:111:0x023c, B:114:0x0246, B:117:0x0255, B:120:0x025f, B:123:0x026f, B:126:0x0279, B:129:0x0289, B:132:0x0293, B:135:0x02a3, B:138:0x02ad, B:141:0x02bc, B:144:0x02c6, B:147:0x02d6, B:150:0x02e0, B:153:0x02f0, B:156:0x02fa, B:162:0x0311, B:165:0x031b, B:171:0x0335, B:174:0x033f, B:176:0x0343, B:179:0x034d, B:182:0x035d, B:185:0x0367, B:188:0x0377, B:191:0x037f, B:197:0x039d, B:200:0x03a7, B:206:0x03c1, B:209:0x03cb, B:212:0x03db, B:215:0x03e5, B:218:0x03f5, B:221:0x03ff, B:224:0x040e, B:227:0x0418, B:233:0x0432, B:236:0x043c, B:239:0x044c, B:242:0x0456, B:248:0x0470, B:251:0x047a, B:254:0x048b, B:257:0x0495, B:260:0x04a5, B:263:0x04ad, B:269:0x04cb, B:272:0x04d2, B:278:0x04f0, B:281:0x04f9, B:287:0x0513, B:395:0x0722, B:289:0x051b, B:291:0x0523, B:294:0x0533, B:296:0x053b, B:302:0x0555, B:304:0x055b, B:310:0x057f, B:312:0x0587, B:315:0x0597, B:317:0x059f, B:320:0x05af, B:322:0x05b7, B:328:0x05d1, B:330:0x05d9, B:332:0x05dd, B:334:0x05e5, B:336:0x05e9, B:338:0x05ef, B:341:0x0603, B:343:0x060b, B:349:0x0625, B:351:0x062d, B:354:0x063d, B:356:0x0645, B:359:0x0655, B:361:0x065b, B:365:0x0673, B:367:0x0679, B:364:0x0667, B:373:0x069d, B:375:0x06a5, B:377:0x06b8, B:382:0x06db, B:387:0x06f4, B:389:0x06fa, B:392:0x070d), top: B:402:0x0024 }] */
    /* JADX WARN: Removed duplicated region for block: B:294:0x0533 A[Catch: Exception -> 0x011b, TryCatch #0 {Exception -> 0x011b, blocks: (B:385:0x06ee, B:380:0x06d5, B:370:0x068d, B:346:0x0617, B:325:0x05c3, B:307:0x056f, B:299:0x0547, B:168:0x0327, B:194:0x038f, B:275:0x04e2, B:90:0x01dd, B:203:0x03b3, B:245:0x0462, B:230:0x0424, B:266:0x04bd, B:81:0x01b7, B:72:0x0191, B:284:0x0505, B:51:0x0134, B:159:0x0304, B:37:0x0101, B:40:0x010b, B:45:0x011e, B:48:0x0128, B:54:0x0142, B:57:0x014c, B:60:0x015d, B:63:0x0167, B:66:0x017b, B:69:0x0185, B:75:0x019f, B:78:0x01a7, B:84:0x01c5, B:87:0x01cd, B:93:0x01eb, B:96:0x01f5, B:99:0x0207, B:102:0x0211, B:105:0x0221, B:108:0x022b, B:111:0x023c, B:114:0x0246, B:117:0x0255, B:120:0x025f, B:123:0x026f, B:126:0x0279, B:129:0x0289, B:132:0x0293, B:135:0x02a3, B:138:0x02ad, B:141:0x02bc, B:144:0x02c6, B:147:0x02d6, B:150:0x02e0, B:153:0x02f0, B:156:0x02fa, B:162:0x0311, B:165:0x031b, B:171:0x0335, B:174:0x033f, B:176:0x0343, B:179:0x034d, B:182:0x035d, B:185:0x0367, B:188:0x0377, B:191:0x037f, B:197:0x039d, B:200:0x03a7, B:206:0x03c1, B:209:0x03cb, B:212:0x03db, B:215:0x03e5, B:218:0x03f5, B:221:0x03ff, B:224:0x040e, B:227:0x0418, B:233:0x0432, B:236:0x043c, B:239:0x044c, B:242:0x0456, B:248:0x0470, B:251:0x047a, B:254:0x048b, B:257:0x0495, B:260:0x04a5, B:263:0x04ad, B:269:0x04cb, B:272:0x04d2, B:278:0x04f0, B:281:0x04f9, B:287:0x0513, B:395:0x0722, B:289:0x051b, B:291:0x0523, B:294:0x0533, B:296:0x053b, B:302:0x0555, B:304:0x055b, B:310:0x057f, B:312:0x0587, B:315:0x0597, B:317:0x059f, B:320:0x05af, B:322:0x05b7, B:328:0x05d1, B:330:0x05d9, B:332:0x05dd, B:334:0x05e5, B:336:0x05e9, B:338:0x05ef, B:341:0x0603, B:343:0x060b, B:349:0x0625, B:351:0x062d, B:354:0x063d, B:356:0x0645, B:359:0x0655, B:361:0x065b, B:365:0x0673, B:367:0x0679, B:364:0x0667, B:373:0x069d, B:375:0x06a5, B:377:0x06b8, B:382:0x06db, B:387:0x06f4, B:389:0x06fa, B:392:0x070d), top: B:402:0x0024 }] */
    /* JADX WARN: Removed duplicated region for block: B:301:0x0553  */
    /* JADX WARN: Removed duplicated region for block: B:309:0x057d  */
    /* JADX WARN: Removed duplicated region for block: B:327:0x05cf  */
    /* JADX WARN: Removed duplicated region for block: B:348:0x0623  */
    /* JADX WARN: Removed duplicated region for block: B:372:0x069b  */
    /* JADX WARN: Removed duplicated region for block: B:400:0x074f A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:404:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:407:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:408:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:409:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:420:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:421:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:424:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:425:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:429:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:431:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:434:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:435:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:436:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:438:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:439:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:442:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:444:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:448:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:452:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:53:0x0140  */
    /* JADX WARN: Removed duplicated region for block: B:74:0x019d  */
    /* JADX WARN: Removed duplicated region for block: B:83:0x01c3  */
    /* JADX WARN: Removed duplicated region for block: B:92:0x01e9  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    private final java.lang.Object p(java.lang.Object r20) throws org.json.JSONException {
        /*
            Method dump skipped, instructions count: 2164
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C2411sB.p(java.lang.Object):java.lang.Object");
    }

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

    @Override // o.AbstractC0728ad
    public final InterfaceC0220Im l(Object obj, InterfaceC0220Im interfaceC0220Im) {
        switch (this.p) {
            case 0:
                return new C2411sB(this.s, this.q, interfaceC0220Im);
            default:
                return new C2411sB(this.s, interfaceC0220Im);
        }
    }

    @Override // o.AbstractC0728ad
    public final Object n(Object obj) throws JSONException {
        String string;
        switch (this.p) {
            case 0:
                return p(obj);
            default:
                int i = this.r;
                ForegroundService foregroundService = this.s;
                Oh0 oh0 = Oh0.a;
                try {
                    if (i == 0) {
                        IJ.H(obj);
                        boolean z = ForegroundService.w;
                        JSONArray jSONArrayOptJSONArray = new JSONObject(foregroundService.l0(1)).optJSONArray("messages");
                        if (jSONArrayOptJSONArray != null && jSONArrayOptJSONArray.length() != 0) {
                            JSONObject jSONObject = jSONArrayOptJSONArray.getJSONObject(0);
                            String strOptString = jSONObject.optString("message");
                            if (Za0.Y(strOptString)) {
                                strOptString = jSONObject.optString("body");
                            }
                            string = Za0.o0(strOptString).toString();
                            String string2 = Za0.o0(jSONObject.optString("number")).toString();
                            if (!Za0.Y(string) && !Za0.Y(string2)) {
                                if (ForegroundService.x(foregroundService, string, string2)) {
                                    ForegroundService.N(foregroundService, string);
                                    return oh0;
                                }
                                if (ForegroundService.G(foregroundService, string)) {
                                    return oh0;
                                }
                                this.q = string;
                                this.r = 1;
                                C2468sq c2468sq = AbstractC1903ms.a;
                                Object objT = AbstractC1692kh0.T(ExecutorC1232fq.m, new C2484t(jSONObject, foregroundService, (InterfaceC0220Im) null, 11), this);
                                EnumC0091Dn enumC0091Dn = EnumC0091Dn.l;
                                if (objT != enumC0091Dn) {
                                    objT = oh0;
                                }
                                if (objT == enumC0091Dn) {
                                    return enumC0091Dn;
                                }
                            }
                            return oh0;
                        }
                        return oh0;
                    }
                    if (i != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    string = this.q;
                    IJ.H(obj);
                    ForegroundService.N(foregroundService, string);
                    return oh0;
                } catch (Exception unused) {
                    return oh0;
                }
        }
    }

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