what-the-bank/sources/o/ZI.java

207 lines
5.8 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package o;
import com.scb.phone.domain.errors.RetrofitException;
import o.C0690Mh;
import o.InterfaceC6638cYp;
/* loaded from: classes.dex */
public abstract class ZI<T extends InterfaceC6638cYp> {
public T f;
public C16903sI j;
/* loaded from: classes3.dex */
public interface IeS<V> {
void e(V v);
}
public ZI(C16903sI c16903sI) {
this.j = c16903sI;
}
public final void d(Throwable th, int i, Runnable runnable) {
if (b(th)) {
C16903sI c16903sI = this.j;
C0690Mh c0690Mh = new C0690Mh();
c0690Mh.b = c16903sI.e(i);
c0690Mh.e = C0690Mh.IeS.CUSTOM;
c0690Mh.d = runnable;
C0693Mj e = c16903sI.e(th);
e.b = c0690Mh;
d(e);
}
}
public final boolean c(Throwable th, boolean z) {
boolean z2 = (th instanceof RetrofitException) && ((RetrofitException) th).d == RetrofitException.RVV.SESSION_EXPIRED;
if (z2 && z && b(th)) {
d(this.j.e(th));
}
return z2;
}
public static boolean j(Throwable th) {
return (th instanceof RetrofitException) && ((RetrofitException) th).d == RetrofitException.RVV.REQUIRED_OTP;
}
public static boolean c(Throwable th) {
return (th instanceof RetrofitException) && ((RetrofitException) th).d == RetrofitException.RVV.OTP_FAILED;
}
public static boolean d(Throwable th) {
return (th instanceof RetrofitException) && ((RetrofitException) th).d == RetrofitException.RVV.OTP_REACH_MAX_LIMIT;
}
public static boolean a(Throwable th) {
return (th instanceof RetrofitException) && ((RetrofitException) th).d == RetrofitException.RVV.OTP_EXPIRED;
}
public static boolean e(Throwable th) {
return (th instanceof RetrofitException) && ((RetrofitException) th).d == RetrofitException.RVV.NON_FASTPAY;
}
public final void f(Throwable th) {
if (i(th)) {
return;
}
ZJ zj = new ZJ(this.j.e(th));
T t = this.f;
if (t != null) {
zj.e(t);
}
}
public final boolean b(Throwable th) {
if (!(th instanceof RetrofitException)) {
return true;
}
RetrofitException retrofitException = (RetrofitException) th;
if (retrofitException.d == null) {
return true;
}
int i = AnonymousClass4.c[retrofitException.d.ordinal()];
if (i != 1 && i != 2 && i != 3) {
return true;
}
T t = this.f;
if (t == null) {
return false;
}
if (t != null) {
t.aq_();
}
T t2 = this.f;
if (t2 != null) {
t2.ar_();
}
T t3 = this.f;
if (t3 == null) {
return false;
}
t3.u();
return false;
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: o.ZI$4, reason: invalid class name */
/* loaded from: classes.dex */
public static /* synthetic */ class AnonymousClass4 {
static final int[] c;
static {
int[] iArr = new int[RetrofitException.RVV.values().length];
c = iArr;
try {
iArr[RetrofitException.RVV.SESSION_EXPIRED.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
c[RetrofitException.RVV.APP_OUTDATED.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
c[RetrofitException.RVV.COMMON_ERROR.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
}
}
public final boolean b(Throwable th, String str) {
boolean z = th instanceof RetrofitException;
boolean z2 = z && ((RetrofitException) th).d == RetrofitException.RVV.SESSION_EXPIRED;
if (z2 && b(th)) {
d(this.j.e(th));
}
if (!z2 && z) {
RetrofitException retrofitException = (RetrofitException) th;
if (retrofitException.e != null && retrofitException.e.c != null && str.equalsIgnoreCase(retrofitException.e.c.e)) {
return true;
}
}
return false;
}
public final void b(boolean z, IeS<T> ieS) {
T t;
if (!z || (t = this.f) == null) {
return;
}
ieS.e(t);
}
public final boolean i(Throwable th) {
boolean z = (th instanceof RetrofitException) && ((RetrofitException) th).d == RetrofitException.RVV.SESSION_EXPIRED;
if (z && b(th)) {
d(this.j.e(th));
}
return z;
}
public void w_() {
T t = this.f;
if (t != null) {
t.aq_();
}
T t2 = this.f;
if (t2 != null) {
t2.ar_();
}
this.f = null;
}
public void c(int i) {
C16903sI c16903sI = this.j;
d(c16903sI.c((String) null, c16903sI.e(i), C0690Mh.IeS.JUST_DISMISS));
}
public final void c(int i, C0690Mh.IeS ieS) {
C16903sI c16903sI = this.j;
d(c16903sI.c((String) null, c16903sI.e(i), ieS));
}
public final void d(C0693Mj c0693Mj) {
T t;
if ((c0693Mj == null || c0693Mj.d == null || !c0693Mj.d.contains("SKIP_BASE_ERROR_DIALOG")) && (t = this.f) != null) {
if (t != null) {
t.aq_();
}
T t2 = this.f;
if (t2 != null) {
t2.ar_();
}
T t3 = this.f;
if (t3 != null) {
t3.u();
}
this.f.e(c0693Mj);
}
}
public void d(String str, String str2, C0690Mh.IeS ieS) {
d(this.j.c(str, str2, ieS));
}
public void e(T t) {
this.f = t;
}
}