package xyz.stream.api;

import com.google.android.gms.measurement.internal.u1;
import java.util.HashMap;
import java.util.Map;
import xyz.stream.api.entity.BaseEntity;

/* JADX INFO: loaded from: classes3.dex */
public final class m implements xyz.stream.utils.y {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ String f35905b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ Map f35906c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ e f35907d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ o f35908e;

    public /* synthetic */ m(o oVar, String str, HashMap map, e eVar, int i10) {
        this.f35904a = i10;
        this.f35908e = oVar;
        this.f35905b = str;
        this.f35906c = map;
        this.f35907d = eVar;
    }

    @Override // xyz.stream.utils.y
    public final void n(String str) {
        int i10 = this.f35904a;
        String str2 = this.f35905b;
        o oVar = this.f35908e;
        Map map = this.f35906c;
        e eVar = this.f35907d;
        switch (i10) {
            case 0:
                try {
                    BaseEntity baseEntity = (BaseEntity) xyz.stream.utils.m.f36162a.fromJson(str, BaseEntity.class);
                    if (baseEntity.getCode() != 200) {
                        o.b(oVar, str2, baseEntity.getCode(), baseEntity.getMsg(), xyz.stream.utils.m.a(map));
                    }
                    eVar.onSuccess(baseEntity);
                } catch (Exception e10) {
                    o.a(oVar, str2, eVar, e10, xyz.stream.utils.m.a(map));
                    return;
                }
                break;
            case 1:
                try {
                    BaseEntity baseEntity2 = (BaseEntity) xyz.stream.utils.m.f36162a.fromJson(str, BaseEntity.class);
                    if (baseEntity2.getCode() != 200 || baseEntity2.getData() == null) {
                        o.b(oVar, str2, baseEntity2.getCode(), baseEntity2.getMsg(), xyz.stream.utils.m.a(map));
                    } else {
                        eVar.onSuccess(baseEntity2);
                    }
                } catch (Exception e11) {
                    o.a(oVar, str2, eVar, e11, xyz.stream.utils.m.a(map));
                    return;
                }
                break;
            case 2:
                StringBuilder sbN = u1.n("Check update result: ", str, ", params: ");
                sbN.append(xyz.stream.utils.m.a(map));
                xyz.stream.utils.h.b(sbN.toString());
                try {
                    eVar.onSuccess((BaseEntity) xyz.stream.utils.m.f36162a.fromJson(str, BaseEntity.class));
                } catch (Exception e12) {
                    o.a(oVar, str2, null, e12, null);
                    return;
                }
                break;
            case 3:
                eVar.onSuccess(Boolean.TRUE);
                break;
            case 4:
                eVar.onSuccess(Boolean.TRUE);
                break;
            case 5:
                eVar.onSuccess(Boolean.TRUE);
                break;
            case 6:
                try {
                    BaseEntity baseEntity3 = (BaseEntity) xyz.stream.utils.m.f36162a.fromJson(str, BaseEntity.class);
                    if (baseEntity3.getCode() != 200 || baseEntity3.getData() == null) {
                        o.b(oVar, str2, baseEntity3.getCode(), baseEntity3.getMsg(), xyz.stream.utils.m.a(map));
                    } else {
                        eVar.onSuccess(baseEntity3);
                    }
                } catch (Exception e13) {
                    o.a(oVar, str2, eVar, e13, xyz.stream.utils.m.a(map));
                    return;
                }
                break;
            case 7:
                try {
                    BaseEntity baseEntity4 = (BaseEntity) xyz.stream.utils.m.f36162a.fromJson(str, BaseEntity.class);
                    if (baseEntity4.getCode() != 200 || baseEntity4.getData() == null) {
                        o.b(oVar, str2, baseEntity4.getCode(), baseEntity4.getMsg(), xyz.stream.utils.m.a(map));
                    } else {
                        eVar.onSuccess(baseEntity4);
                    }
                } catch (Exception e14) {
                    o.a(oVar, str2, eVar, e14, xyz.stream.utils.m.a(map));
                    return;
                }
                break;
            case 8:
                try {
                    BaseEntity baseEntity5 = (BaseEntity) xyz.stream.utils.m.f36162a.fromJson(str, BaseEntity.class);
                    if (baseEntity5.getCode() != 200 || baseEntity5.getData() == null) {
                        o.b(oVar, str2, baseEntity5.getCode(), baseEntity5.getMsg(), xyz.stream.utils.m.a(map));
                    } else {
                        eVar.onSuccess(baseEntity5);
                    }
                } catch (Exception e15) {
                    o.a(oVar, str2, eVar, e15, xyz.stream.utils.m.a(map));
                    return;
                }
                break;
            case 9:
                try {
                    eVar.onSuccess((BaseEntity) xyz.stream.utils.m.f36162a.fromJson(str, BaseEntity.class));
                } catch (Exception e16) {
                    o.a(oVar, str2, eVar, e16, xyz.stream.utils.m.a(map));
                    return;
                }
                break;
            default:
                try {
                    eVar.onSuccess((BaseEntity) xyz.stream.utils.m.f36162a.fromJson(str, BaseEntity.class));
                } catch (Exception e17) {
                    o.a(oVar, str2, eVar, e17, xyz.stream.utils.m.a(map));
                    return;
                }
                break;
        }
    }

    @Override // xyz.stream.utils.y
    public final void r(Exception exc) {
        int i10 = this.f35904a;
        e eVar = this.f35907d;
        String str = this.f35905b;
        o oVar = this.f35908e;
        Map map = this.f35906c;
        switch (i10) {
            case 0:
                o.a(oVar, str, eVar, exc, xyz.stream.utils.m.a(map));
                break;
            case 1:
                o.a(oVar, str, eVar, exc, xyz.stream.utils.m.a(map));
                break;
            case 2:
                o.a(oVar, str, null, exc, xyz.stream.utils.m.a(map));
                break;
            case 3:
                eVar.onSuccess(Boolean.FALSE);
                o.a(oVar, str, null, exc, xyz.stream.utils.m.a(map));
                break;
            case 4:
                eVar.onSuccess(Boolean.FALSE);
                o.a(oVar, str, null, exc, xyz.stream.utils.m.a(map));
                break;
            case 5:
                eVar.onSuccess(Boolean.FALSE);
                o.a(oVar, str, null, exc, xyz.stream.utils.m.a(map));
                break;
            case 6:
                o.a(oVar, str, eVar, exc, xyz.stream.utils.m.a(map));
                break;
            case 7:
                o.a(oVar, str, eVar, exc, xyz.stream.utils.m.a(map));
                break;
            case 8:
                o.a(oVar, str, eVar, exc, xyz.stream.utils.m.a(map));
                break;
            case 9:
                o.a(oVar, str, eVar, exc, xyz.stream.utils.m.a(map));
                break;
            default:
                o.a(oVar, str, eVar, exc, xyz.stream.utils.m.a(map));
                break;
        }
    }

    public /* synthetic */ m(o oVar, e eVar, String str, HashMap map, int i10) {
        this.f35904a = i10;
        this.f35908e = oVar;
        this.f35907d = eVar;
        this.f35905b = str;
        this.f35906c = map;
    }

    public m(o oVar, HashMap map, c cVar) {
        this.f35904a = 2;
        this.f35908e = oVar;
        this.f35906c = map;
        this.f35907d = cVar;
        this.f35905b = "app/latest";
    }
}
