package o; import android.content.Context; import android.content.SharedPreferences; import android.provider.Settings; import com.scb.phone.domain.errors.RetrofitException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.UUID; import o.AbstractC1958aTW; import o.C0690Mh; import o.C2215aaR; import o.ZI; import o.wRi; /* renamed from: o.aaR, reason: case insensitive filesystem */ /* loaded from: classes3.dex */ public class C2215aaR extends ZI { public Sts a; public String b; public boolean c; public String d; public boolean e; public final InterfaceC13179fT g; public boolean h; public final XXh i; public final C17399wT k; public final Joj l; public boolean m; public final C17186uft n; /* renamed from: o, reason: collision with root package name */ public C0930Rt f8512o; private fSJ p; boolean q; public SharedPreferences r; private final C16672qHa s; public boolean t; private final BZL w; private final jXq x; /* renamed from: o.aaR$Sts */ /* loaded from: classes3.dex */ public interface Sts { boolean D_(); } @InterfaceC13391fZD public C2215aaR(C16903sI c16903sI, Joj joj, C17186uft c17186uft, SharedPreferences sharedPreferences, BZL bzl, C16672qHa c16672qHa, C17399wT c17399wT, jXq jxq, XXh xXh, InterfaceC13179fT interfaceC13179fT) { super(c16903sI); this.m = false; this.t = false; this.h = true; this.q = false; this.l = joj; this.n = c17186uft; this.r = sharedPreferences; this.w = bzl; this.s = c16672qHa; this.k = c17399wT; this.x = jxq; this.i = xXh; this.g = interfaceC13179fT; } public final void c() { final String str; C0930Rt c0930Rt; if (this.f8512o == null) { ZI.IeS ieS = new ZI.IeS() { // from class: o.abp @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).ab_(); } }; if (this.f != 0) { ieS.e(this.f); return; } return; } if ((!this.l.g()) && (c0930Rt = this.f8512o) != null && GkX.d(c0930Rt.k, AbstractC1958aTW.Sts.b, AbstractC1958aTW.ZqN.c, AbstractC1958aTW.CeN.b, AbstractC1958aTW.Heg.c, AbstractC1958aTW.mxa.b, AbstractC1958aTW.ZnX.d, AbstractC1958aTW.cSf.c, AbstractC1958aTW.vUG.c, AbstractC1958aTW.ojQ.d, AbstractC1958aTW.NHB.d, AbstractC1958aTW.huo.d, AbstractC1958aTW.HBt.b, AbstractC1958aTW.AcL.c, AbstractC1958aTW.tOB.b, AbstractC1958aTW.jbe.b, AbstractC1958aTW.jNh.d, AbstractC1958aTW.dAO.d, AbstractC1958aTW.Plv.b)) { this.l.m(); ZI.IeS ieS2 = new ZI.IeS(this) { // from class: o.aaP private C2215aaR d; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).m(this.d.f8512o); } { this.d = this; } }; if (this.f != 0) { ieS2.e(this.f); return; } return; } C0930Rt c0930Rt2 = this.f8512o; if (c0930Rt2 != null) { AbstractC1958aTW abstractC1958aTW = c0930Rt2.k; if (GkX.d(abstractC1958aTW, AbstractC1958aTW.Sts.b)) { final C0930Rt c0930Rt3 = this.f8512o; if (this.f != 0) { if (!c0930Rt3.l) { if (this.m) { if (this.t && this.h && this.f != 0) { this.f.ar_(); } ZI.IeS ieS3 = new ZI.IeS(c0930Rt3) { // from class: o.aaO private C0930Rt b; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).o(this.b); } { this.b = c0930Rt3; } }; if (this.f != 0) { ieS3.e(this.f); } } else if (c0930Rt3.d || c0930Rt3.a) { ZI.IeS ieS4 = new ZI.IeS(c0930Rt3) { // from class: o.aaN private C0930Rt b; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).l(this.b); } { this.b = c0930Rt3; } }; if (this.f != 0) { ieS4.e(this.f); } } else { ZI.IeS ieS5 = new ZI.IeS(c0930Rt3) { // from class: o.abe private C0930Rt e; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).j(this.e); } { this.e = c0930Rt3; } }; if (this.f != 0) { ieS5.e(this.f); } } } else if (a() == gHK.INDIVIDUAL) { ZI.IeS ieS6 = new ZI.IeS(c0930Rt3) { // from class: o.abg private C0930Rt c; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).l(this.c); } { this.c = c0930Rt3; } }; if (this.f != 0) { ieS6.e(this.f); } } else { ZI.IeS ieS7 = new ZI.IeS(c0930Rt3) { // from class: o.abf private C0930Rt e; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).a_(this.e); } { this.e = c0930Rt3; } }; if (this.f != 0) { ieS7.e(this.f); } } } Joj joj = this.l; if (((Boolean) Joj.a(new Object[]{joj}, 1090327982, -1090327976, System.identityHashCode(joj))).booleanValue()) { this.r.edit().putString("CHECK_GENERAL_CONSENT_DATE", new SimpleDateFormat("yyyy-MM-dd").format(new Date())).apply(); return; } return; } if (GkX.d(abstractC1958aTW, AbstractC1958aTW.cSf.c, AbstractC1958aTW.ZqN.c, AbstractC1958aTW.CeN.b, AbstractC1958aTW.mxa.b)) { ZI.IeS ieS8 = new ZI.IeS(this) { // from class: o.aaT private C2215aaR b; @Override // o.ZI.IeS public final void e(Object obj) { C0930Rt c0930Rt4 = this.b.f8512o; ((InterfaceC8962daj) obj).ak_(); } { this.b = this; } }; if (this.f != 0) { ieS8.e(this.f); return; } return; } if (GkX.d(abstractC1958aTW, AbstractC1958aTW.ZnX.d, AbstractC1958aTW.NHB.d)) { ZI.IeS ieS9 = new ZI.IeS(this) { // from class: o.aaV private C2215aaR e; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).f(this.e.f8512o); } { this.e = this; } }; if (this.f != 0) { ieS9.e(this.f); return; } return; } if (!GkX.d(abstractC1958aTW, AbstractC1958aTW.Heg.c)) { if (GkX.d(abstractC1958aTW, AbstractC1958aTW.zJl.c)) { ZI.IeS ieS10 = new ZI.IeS(this) { // from class: o.aaW private C2215aaR b; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).i(this.b.f8512o); } { this.b = this; } }; if (this.f != 0) { ieS10.e(this.f); return; } return; } if (GkX.d(abstractC1958aTW, AbstractC1958aTW.vUG.c)) { this.l.c(""); ZI.IeS ieS11 = new ZI.IeS(this) { // from class: o.aaU private C2215aaR b; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).g(this.b.f8512o); } { this.b = this; } }; if (this.f != 0) { ieS11.e(this.f); return; } return; } if (GkX.d(abstractC1958aTW, AbstractC1958aTW.ojQ.d)) { Sts sts = this.a; if (sts == null) { ZI.IeS ieS12 = new ZI.IeS() { // from class: o.abo @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).g_(""); } }; if (this.f != 0) { ieS12.e(this.f); return; } return; } if (sts.D_()) { ZI.IeS ieS13 = new ZI.IeS() { // from class: o.abn @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).g_(""); } }; if (this.f != 0) { ieS13.e(this.f); return; } return; } Joj joj2 = this.l; C15152gig c15152gig = ((C8064dAG) Joj.a(new Object[]{joj2}, 413669843, -413669838, System.identityHashCode(joj2))).e; if ("th".equals(this.l.i())) { str = c15152gig.b; } else { str = c15152gig.a; } ZI.IeS ieS14 = new ZI.IeS(this, str) { // from class: o.abc private C2215aaR c; private String e; @Override // o.ZI.IeS public final void e(Object obj) { InterfaceC8962daj interfaceC8962daj = (InterfaceC8962daj) obj; interfaceC8962daj.g(this.e, this.c.d); } { this.c = this; this.e = str; } }; if (this.f != 0) { ieS14.e(this.f); return; } return; } if (GkX.d(abstractC1958aTW, AbstractC1958aTW.huo.d, AbstractC1958aTW.HBt.b, AbstractC1958aTW.AcL.c, AbstractC1958aTW.tOB.b, AbstractC1958aTW.jbe.b)) { ZI.IeS ieS15 = new ZI.IeS(this) { // from class: o.aba private C2215aaR e; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).b_(this.e.f8512o); } { this.e = this; } }; if (this.f != 0) { ieS15.e(this.f); return; } return; } if (GkX.d(abstractC1958aTW, AbstractC1958aTW.jNh.d, AbstractC1958aTW.dAO.d)) { ZI.IeS ieS16 = new ZI.IeS(this) { // from class: o.aaY private C2215aaR a; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).h(this.a.f8512o); } { this.a = this; } }; if (this.f != 0) { ieS16.e(this.f); return; } return; } if (!GkX.d(abstractC1958aTW, AbstractC1958aTW.Plv.b)) { if (GkX.d(abstractC1958aTW, AbstractC1958aTW.LWm.b)) { ZI.IeS ieS17 = new ZI.IeS(this) { // from class: o.abq private C2215aaR d; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).h_(this.d.f8512o.m); } { this.d = this; } }; if (this.f != 0) { ieS17.e(this.f); return; } return; } d(this.f8512o.i, this.f8512o.c, C0690Mh.IeS.NAVIGATE_BACK); return; } d(this.j.d(this.f8512o.j, this.f8512o.c, new Runnable(this) { // from class: o.aaZ private C2215aaR a; @Override // java.lang.Runnable public final void run() { C2215aaR c2215aaR = this.a; ZI.IeS ieS18 = new ZI.IeS() { // from class: o.abk @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).ah_(); } }; if (c2215aaR.f != 0) { ieS18.e(c2215aaR.f); } } { this.a = this; } })); return; } this.l.o(); ZI.IeS ieS18 = new ZI.IeS(this) { // from class: o.aaX private C2215aaR c; @Override // o.ZI.IeS public final void e(Object obj) { C0930Rt c0930Rt4 = this.c.f8512o; ((InterfaceC8962daj) obj).aj_(); } { this.c = this; } }; if (this.f != 0) { ieS18.e(this.f); } } } public final gHK a() { return gHK.INDIVIDUAL.mode.equals(this.r.getString("USER_MODE", gHK.INDIVIDUAL.mode)) ? gHK.INDIVIDUAL : gHK.JURISTIC; } public final void b(gHK ghk) { if (a() == gHK.JURISTIC && ghk == gHK.INDIVIDUAL) { this.s.e.c(); } this.r.edit().putString("USER_MODE", ghk.mode).apply(); } public final String a(Context context) { String obj; String string; if (!this.r.contains("randomDeviceId")) { Context applicationContext = context.getApplicationContext(); SharedPreferences sharedPreferences = applicationContext.getSharedPreferences("loginpref", 0); if (sharedPreferences != null && (string = sharedPreferences.getString("termLogin", "")) != null && string.contains("true")) { obj = b(applicationContext); try { applicationContext.getSharedPreferences("loginpref", 0).edit().remove("loginpref").apply(); } catch (Exception e) { guQ.d(e, "Error deleting the loginpref shared preference", new Object[0]); } } else { obj = UUID.randomUUID().toString(); } this.r.edit().putString("randomDeviceId", obj).apply(); } this.l.e(); String string2 = this.r.getString("randomDeviceId", ""); guQ.c("generatedDeviceId: %s", string2); return string2; } private static String b(Context context) { try { String string = Settings.Secure.getString(context.getContentResolver(), "android_id"); guQ.c("old androidId retrived: %s", string); return string; } catch (Exception e) { guQ.d(e, "Failed retrive old androidId", new Object[0]); return UUID.randomUUID().toString(); } } public final boolean b() { this.l.d(true); if (this.f8512o.n == null) { return false; } Joj joj = this.l; boolean booleanValue = ((Boolean) Joj.a(new Object[]{joj, this.f8512o.n.a}, 1881291379, -1881291378, System.identityHashCode(joj))).booleanValue(); if (!booleanValue) { this.l.d(false); } return booleanValue; } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: o.aaR$HBt */ /* loaded from: classes3.dex */ public final class HBt extends wRi.LWm { private C2215aaR d; private HBt(C2215aaR c2215aaR) { this.d = c2215aaR; } @Override // o.wRi.LWm, o.InterfaceC13174fSv public final /* synthetic */ void onNext(Object obj) { PUI pui = (PUI) obj; C2215aaR c2215aaR = this.d; if (c2215aaR.f != 0) { c2215aaR.f.ar_(); } C2215aaR c2215aaR2 = this.d; c2215aaR2.f8512o = c2215aaR2.k.d(pui); this.d.c(); this.d.q = false; } public static /* synthetic */ void a(HBt hBt) { C2215aaR c2215aaR = hBt.d; c2215aaR.d(c2215aaR.d, hBt.d.b, hBt.d.e, hBt.d.c); } @Override // o.wRi.LWm, o.InterfaceC13174fSv public final void onError(Throwable th) { C2215aaR c2215aaR = this.d; if (c2215aaR.f != 0) { c2215aaR.f.ar_(); } if (C2215aaR.h(th)) { C2215aaR c2215aaR2 = this.d; C2285abi c2285abi = new C2285abi(); if (c2215aaR2.f != 0) { c2285abi.e(c2215aaR2.f); return; } return; } C0693Mj e = this.d.j.e(th); C2215aaR c2215aaR3 = this.d; C16903sI c16903sI = c2215aaR3.j; Joj joj = this.d.l; c2215aaR3.d(c16903sI.e((String) Joj.a(new Object[]{joj}, 1589387191, -1589387188, System.identityHashCode(joj)), e.d, e.c, new Runnable(this) { // from class: o.abu private C2215aaR.HBt a; @Override // java.lang.Runnable public final void run() { C2215aaR.HBt.a(this.a); } { this.a = this; } })); } /* synthetic */ HBt(C2215aaR c2215aaR, byte b) { this(c2215aaR); } } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: o.aaR$LWm */ /* loaded from: classes3.dex */ public final class LWm extends wRi.LWm { private C2215aaR d; private LWm(C2215aaR c2215aaR) { this.d = c2215aaR; } @Override // o.wRi.LWm, o.InterfaceC13174fSv public final /* synthetic */ void onNext(Object obj) { C2215aaR c2215aaR = this.d; c2215aaR.f8512o = c2215aaR.k.d((PUI) obj); this.d.c(); } @Override // o.wRi.LWm, o.InterfaceC13174fSv public final void onError(Throwable th) { if (C2215aaR.h(th)) { C2215aaR c2215aaR = this.d; C2285abi c2285abi = new C2285abi(); if (c2215aaR.f != 0) { c2285abi.e(c2215aaR.f); return; } return; } this.d.l.s(); C0693Mj e = this.d.j.e(th); C2215aaR c2215aaR2 = this.d; C16903sI c16903sI = c2215aaR2.j; Joj joj = this.d.l; c2215aaR2.d(c16903sI.e((String) Joj.a(new Object[]{joj}, 1589387191, -1589387188, System.identityHashCode(joj)), e.d, e.c, new Runnable(this) { // from class: o.abw private C2215aaR.LWm e; @Override // java.lang.Runnable public final void run() { C2215aaR.LWm.b(this.e); } { this.e = this; } })); } public static /* synthetic */ void b(LWm lWm) { C2215aaR c2215aaR = lWm.d; c2215aaR.e(c2215aaR.d, lWm.d.b, lWm.d.e, lWm.d.c); } /* synthetic */ LWm(C2215aaR c2215aaR, byte b) { this(c2215aaR); } } /* renamed from: o.aaR$IeS */ /* loaded from: classes3.dex */ public final class IeS extends wRi.LWm { private C2215aaR c; private IeS(C2215aaR c2215aaR) { this.c = c2215aaR; } @Override // o.wRi.LWm, o.InterfaceC13174fSv public final /* synthetic */ void onNext(Object obj) { final nvv nvvVar = (nvv) obj; if (gjJ.a(nvvVar.a)) { C2215aaR c2215aaR = this.c; ZI.IeS ieS = new ZI.IeS(nvvVar) { // from class: o.abt private nvv a; @Override // o.ZI.IeS public final void e(Object obj2) { ((InterfaceC8962daj) obj2).g_(this.a.a); } { this.a = nvvVar; } }; if (c2215aaR.f != 0) { ieS.e(c2215aaR.f); return; } return; } onError(null); } @Override // o.wRi.LWm, o.InterfaceC13174fSv public final void onError(Throwable th) { C2215aaR c2215aaR = this.c; ZI.IeS ieS = new ZI.IeS() { // from class: o.abx @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).g_(""); } }; if (c2215aaR.f != 0) { ieS.e(c2215aaR.f); } } public /* synthetic */ IeS(C2215aaR c2215aaR, byte b) { this(c2215aaR); } } /* renamed from: o.aaR$RVV */ /* loaded from: classes3.dex */ public class RVV extends wRi.LWm { private C2215aaR e; @Override // o.wRi.LWm, o.InterfaceC13174fSv public final void onComplete() { } private RVV(C2215aaR c2215aaR) { this.e = c2215aaR; } @Override // o.wRi.LWm, o.InterfaceC13174fSv public final /* synthetic */ void onNext(Object obj) { if (this.e.f != 0) { C2215aaR c2215aaR = this.e; if (c2215aaR.f != 0) { c2215aaR.f.ar_(); } C2215aaR c2215aaR2 = this.e; C2298abv c2298abv = new C2298abv(); if (c2215aaR2.f != 0) { c2298abv.e(c2215aaR2.f); } } } @Override // o.wRi.LWm, o.InterfaceC13174fSv public final void onError(Throwable th) { if (this.e.f != 0) { C2215aaR c2215aaR = this.e; if (c2215aaR.f != 0) { c2215aaR.f.ar_(); } C2215aaR c2215aaR2 = this.e; C2298abv c2298abv = new C2298abv(); if (c2215aaR2.f != 0) { c2298abv.e(c2215aaR2.f); } } } public /* synthetic */ RVV(C2215aaR c2215aaR, byte b) { this(c2215aaR); } } @Override // o.ZI public final void w_() { super.w_(); } static /* synthetic */ boolean h(Throwable th) { if (!(th instanceof RetrofitException)) { return false; } RetrofitException retrofitException = (RetrofitException) th; return (retrofitException.e == null || retrofitException.e.c == null || !AbstractC1958aTW.saX.b.a.equals(retrofitException.e.c.e)) ? false : true; } public final void d(String str, String str2, boolean z, boolean z2) { if (this.t && this.m && this.f != 0) { this.f.y(); } this.d = str; this.b = str2; this.e = z; this.c = z2; this.l.d(this.l.e(str, str2, z), new HBt(this, (byte) 0)); } public final void e(String str, String str2, boolean z, boolean z2) { this.q = true; this.l.l(); if (this.t && this.m && this.f != 0) { this.f.y(); } this.d = str; this.b = str2; this.e = z; this.c = z2; this.x.a.setUserId(str); this.l.e(z2); if (z) { C2285abi c2285abi = new C2285abi(); if (this.f != 0) { c2285abi.e(this.f); return; } return; } this.q = true; if (this.t && this.m && this.f != 0) { this.f.y(); } ZI.IeS ieS = new ZI.IeS() { // from class: o.abj @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).al_(); } }; if (this.f != 0) { ieS.e(this.f); } this.l.d(this.l.b(str, str2, z), new LWm(this, (byte) 0)); } public final void e(C1029Ub c1029Ub, boolean z, String str, boolean z2) { if (c1029Ub != null) { e(c1029Ub.c, c1029Ub.j, c1029Ub.h, c1029Ub.f); } else if (!z) { e(str, (String) null, z2, this.l.n()); } else { e(str, this.l.h(), z2, this.l.n()); } } public final void c(C0930Rt c0930Rt, String str) { String str2 = c0930Rt.h; if (str2 == null || str2.trim().length() <= 0) { return; } final String lowerCase = str2.toLowerCase(); if (!this.q) { if (str2.equalsIgnoreCase(str)) { return; } ZI.IeS ieS = new ZI.IeS(lowerCase) { // from class: o.aaS private String e; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).p_(this.e); } { this.e = lowerCase; } }; if (this.f != 0) { ieS.e(this.f); return; } return; } this.q = false; ZI.IeS ieS2 = new ZI.IeS(lowerCase) { // from class: o.abl private String e; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8962daj) obj).p_(this.e); } { this.e = lowerCase; } }; if (this.f != 0) { ieS2.e(this.f); } } }