package o; import android.content.SharedPreferences; import android.content.res.Resources; import android.text.TextUtils; import com.scb.phone.domain.errors.RetrofitException; import o.C0690Mh; import o.C15715hv; /* renamed from: o.sI, reason: case insensitive filesystem */ /* loaded from: classes.dex */ public class C16903sI extends C16157lj { @InterfaceC13391fZD public C16903sI(Resources resources, SharedPreferences sharedPreferences) { super(resources, sharedPreferences); } public final C0693Mj d(Throwable th, C0690Mh.IeS ieS) { String str; String e = e(C15715hv.tOB.error_generic_resource); C5136bnO c5136bnO = null; r3 = null; r3 = null; r3 = null; r3 = null; r3 = null; r3 = null; r3 = null; r3 = null; String str2 = null; if (th instanceof RetrofitException) { RetrofitException retrofitException = (RetrofitException) th; switch (AnonymousClass5.c[retrofitException.d.ordinal()]) { case 1: e = e(C15715hv.tOB.error_generic_resource); break; case 2: try { str2 = retrofitException.e.c.d; } catch (Exception e2) { guQ.e(e2); } try { e = retrofitException.e.c.c; break; } catch (Exception e3) { guQ.e(e3); break; } case 3: e = e(C15715hv.tOB.error_connection); break; case 4: case 5: C5136bnO c5136bnO2 = retrofitException.a; if (c5136bnO2 != null && c5136bnO2.d != null && c5136bnO2.d.endsWith("login/preloadandresumecheck")) { e = e(C15715hv.tOB.error_connection); break; } else { str2 = e(C15715hv.tOB.error_generic_header); e = e(C15715hv.tOB.error_generic); break; } break; case 6: e = e(C15715hv.tOB.error_generic_resource); break; case 7: case 8: case 9: str2 = "SKIP_BASE_ERROR_DIALOG"; e = ""; break; case 10: ieS = C0690Mh.IeS.NAVIGATE_BACK; try { str2 = retrofitException.e.c.d; } catch (Exception e4) { guQ.e(e4); } try { e = retrofitException.e.c.c; break; } catch (Exception unused) { e = e(C15715hv.tOB.error_generic_resource); break; } case 11: case 12: case 13: try { e = retrofitException.e.c.c; break; } catch (Exception unused2) { break; } default: e = e(C15715hv.tOB.error_generic_resource); break; } String str3 = str2; c5136bnO = retrofitException.a; str = str3; } else { str = null; } C0693Mj c = c(str, TextUtils.isEmpty(e) ? "" : e, ieS); if (c5136bnO == null) { c5136bnO = new C5136bnO(); } c.a = c5136bnO; return c; } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: o.sI$5, reason: invalid class name */ /* loaded from: classes.dex */ public static /* synthetic */ class AnonymousClass5 { static final int[] c; static { int[] iArr = new int[RetrofitException.RVV.values().length]; c = iArr; try { iArr[RetrofitException.RVV.HTTP.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { c[RetrofitException.RVV.API_ERROR.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { c[RetrofitException.RVV.NETWORK.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } try { c[RetrofitException.RVV.SERVER_ERROR.ordinal()] = 4; } catch (NoSuchFieldError unused4) { } try { c[RetrofitException.RVV.TIME_OUT.ordinal()] = 5; } catch (NoSuchFieldError unused5) { } try { c[RetrofitException.RVV.UNEXPECTED.ordinal()] = 6; } catch (NoSuchFieldError unused6) { } try { c[RetrofitException.RVV.SESSION_EXPIRED.ordinal()] = 7; } catch (NoSuchFieldError unused7) { } try { c[RetrofitException.RVV.APP_OUTDATED.ordinal()] = 8; } catch (NoSuchFieldError unused8) { } try { c[RetrofitException.RVV.COMMON_ERROR.ordinal()] = 9; } catch (NoSuchFieldError unused9) { } try { c[RetrofitException.RVV.TRANSACTION_TOKEN_INVALID.ordinal()] = 10; } catch (NoSuchFieldError unused10) { } try { c[RetrofitException.RVV.OTP_FAILED.ordinal()] = 11; } catch (NoSuchFieldError unused11) { } try { c[RetrofitException.RVV.OTP_REACH_MAX_LIMIT.ordinal()] = 12; } catch (NoSuchFieldError unused12) { } try { c[RetrofitException.RVV.OTP_EXPIRED.ordinal()] = 13; } catch (NoSuchFieldError unused13) { } } } public final C0693Mj b(Throwable th, C0690Mh.IeS ieS) { String obj; String str; if (th instanceof RetrofitException) { RetrofitException retrofitException = (RetrofitException) th; int i = AnonymousClass5.c[retrofitException.d.ordinal()]; String str2 = ""; if (i == 1 || i == 3) { try { obj = retrofitException.e.c.e; } catch (NullPointerException unused) { StringBuilder sb = new StringBuilder(""); sb.append(retrofitException.a.a); obj = sb.toString(); } String e = e(C15715hv.tOB.error_connection); if (obj != null && obj.length() == 3 && obj.startsWith("5")) { str2 = e(C15715hv.tOB.error_generic_header); e = e(C15715hv.tOB.error_generic); } C0693Mj c = c(str2, e, ieS); c.a = retrofitException.a; return c; } if (i == 12) { try { str = retrofitException.e.c.d; } catch (NullPointerException e2) { guQ.e(e2); str = ""; } try { str2 = retrofitException.e.c.c; } catch (Exception e3) { guQ.e(e3); } C0693Mj c2 = c(str, str2, ieS); c2.a = retrofitException.a; return c2; } } return d(th, ieS); } public C0693Mj e(Throwable th) { return d(th, C0690Mh.IeS.JUST_DISMISS); } public final C0693Mj c(String str, String str2, C0690Mh.IeS ieS) { if (TextUtils.isEmpty(str)) { str = e(C15715hv.tOB.common_error); } String e = e(C15715hv.tOB.ok); C0690Mh c0690Mh = new C0690Mh(); c0690Mh.b = e; c0690Mh.e = ieS; c0690Mh.c = null; if (gjJ.b((CharSequence) str2)) { str2 = e(C15715hv.tOB.error_generic_resource); } C0693Mj c0693Mj = new C0693Mj(); c0693Mj.d = str; c0693Mj.c = str2; c0693Mj.e = c0690Mh; return c0693Mj; } public final C0693Mj d(String str, String str2, Runnable runnable) { if (TextUtils.isEmpty(str)) { str = e(C15715hv.tOB.common_error); } String e = e(C15715hv.tOB.ok); C0690Mh c0690Mh = new C0690Mh(); c0690Mh.b = e; c0690Mh.e = C0690Mh.IeS.CUSTOM; c0690Mh.e = C0690Mh.IeS.CUSTOM; c0690Mh.d = runnable; if (gjJ.b((CharSequence) str2)) { str2 = e(C15715hv.tOB.error_generic_resource); } C0693Mj c0693Mj = new C0693Mj(); c0693Mj.d = str; c0693Mj.c = str2; c0693Mj.e = c0690Mh; return c0693Mj; } public final C0693Mj e(String str, String str2, String str3, Runnable runnable) { if (TextUtils.isEmpty(str2)) { str2 = e(C15715hv.tOB.common_error); } if (str != null) { str2 = str2.concat(str); } String e = e(C15715hv.tOB.ok); C0690Mh c0690Mh = new C0690Mh(); c0690Mh.b = e; c0690Mh.e = C0690Mh.IeS.CUSTOM; c0690Mh.e = C0690Mh.IeS.CUSTOM; c0690Mh.d = runnable; if (gjJ.b((CharSequence) str3)) { str3 = e(C15715hv.tOB.error_generic_resource); } C0693Mj c0693Mj = new C0693Mj(); c0693Mj.d = str2; c0693Mj.c = str3; c0693Mj.e = c0690Mh; return c0693Mj; } public final C0693Mj c(int i, int i2, Runnable runnable) { C0690Mh c0690Mh = new C0690Mh(); c0690Mh.b = e(C15715hv.tOB.ok); c0690Mh.e = C0690Mh.IeS.CUSTOM; c0690Mh.d = runnable; C0693Mj c0693Mj = new C0693Mj(); c0693Mj.c = e(i2); c0693Mj.d = e(i); c0693Mj.b = c0690Mh; return c0693Mj; } public final C0693Mj c(Throwable th, Runnable runnable) { C0693Mj e = e(th); C0690Mh c0690Mh = e.e; c0690Mh.e = C0690Mh.IeS.CUSTOM; c0690Mh.e = C0690Mh.IeS.CUSTOM; c0690Mh.d = runnable; if (th instanceof RetrofitException) { e.a = ((RetrofitException) th).a; } return e; } public final C0693Mj a(String str, String str2, int i, Runnable runnable) { if (TextUtils.isEmpty(str)) { str = e(C15715hv.tOB.common_error); } C0690Mh c0690Mh = new C0690Mh(); c0690Mh.b = e(i); c0690Mh.e = C0690Mh.IeS.CUSTOM; c0690Mh.d = runnable; if (gjJ.b((CharSequence) str2)) { str2 = e(C15715hv.tOB.error_generic_resource); } C0693Mj c0693Mj = new C0693Mj(); c0693Mj.d = str; c0693Mj.c = str2; c0693Mj.e = c0690Mh; return c0693Mj; } public final C0693Mj b(String str, String str2, int i, int i2, Runnable runnable, Runnable runnable2) { if (TextUtils.isEmpty(str)) { str = e(C15715hv.tOB.common_error); } C0690Mh c0690Mh = new C0690Mh(); c0690Mh.b = e(i); c0690Mh.e = C0690Mh.IeS.CUSTOM; c0690Mh.d = runnable; C0690Mh c0690Mh2 = new C0690Mh(); c0690Mh2.b = e(i2); c0690Mh2.e = C0690Mh.IeS.CUSTOM; c0690Mh2.d = runnable2; if (gjJ.b((CharSequence) str2)) { str2 = e(C15715hv.tOB.error_generic_resource); } C0693Mj c0693Mj = new C0693Mj(); c0693Mj.d = str; c0693Mj.c = str2; c0693Mj.e = c0690Mh; c0693Mj.b = c0690Mh2; return c0693Mj; } }