package b02; import bh4.d; import bw3.aq1; import bw3.bq1; import bw3.cq1; import bw3.kq1; import bw3.l24; import bw3.lq1; import bw3.m24; import com.tencent.mm.sdk.platformtools.LocaleUtil; import com.tencent.mm.sdk.platformtools.Log; import com.tencent.mm.sdk.platformtools.Util; import com.tencent.mm.storage.w1; import com.tencent.mm.ui.x4; import d60.z; import dh4.f; import gk4.d1; import gk4.n0; import gk4.s1; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import kh4.p; import kotlin.ResultKt; import lh4.m; import lh4.o; import m60.i; import t32.e2; import tl1.c; import tt1.h0; import tt1.j0; import tt1.q0; import tt1.v0; import vp.h; import wg4.b0; import wg4.n; import y24.r; import zz1.e; import zz1.j3; public final class j { /* renamed from: a reason: collision with root package name */ public static final j f9757a = new j(); /* renamed from: b reason: collision with root package name */ public static final HashMap<Integer, kq1> f9758b = new HashMap<>(); /* renamed from: c reason: collision with root package name */ public static LinkedList<aq1> f9759c = new LinkedList<>(); /* renamed from: d reason: collision with root package name */ public static LinkedList<cq1> f9760d = new LinkedList<>(); /* renamed from: e reason: collision with root package name */ public static LinkedList<bq1> f9761e = new LinkedList<>(); /* renamed from: f reason: collision with root package name */ public static final HashMap<String, l24> f9762f = new HashMap<>(); /* renamed from: g reason: collision with root package name */ public static lq1 f9763g = new lq1(); @f(c = "com.tencent.mm.plugin.finder.storage.logic.FinderObjectWordingConfig$resetConfig$5", f = "FinderObjectWordingConfig.kt", l = {133}, m = "invokeSuspend") public static final class a extends dh4.j implements p<n0, d<? super b0>, Object> { /* renamed from: d reason: collision with root package name */ public Object f9764d; /* renamed from: e reason: collision with root package name */ public int f9765e; public a(d<? super a> dVar) { super(2, dVar); } @Override // dh4.a public final d<b0> create(Object obj, d<?> dVar) { return new a(dVar); } /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */ @Override // kh4.p public Object invoke(n0 n0Var, d<? super b0> dVar) { return new a(dVar).invokeSuspend(b0.f332794a); } @Override // dh4.a public final Object invokeSuspend(Object obj) { Iterator<T> it; ch4.a aVar = ch4.a.COROUTINE_SUSPENDED; int i15 = this.f9765e; if (i15 == 0) { ResultKt.throwOnFailure(obj); j jVar = j.f9757a; it = j.f9760d.iterator(); } else if (i15 == 1) { it = (Iterator) this.f9764d; ResultKt.throwOnFailure(obj); } else { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } while (it.hasNext()) { cq1 cq12 = (cq1) it.next(); String str = cq12.f18584e; String str2 = cq12.f18585f; this.f9764d = it; this.f9765e = 1; if (((h) yz3.j.c(h.class)).Sw0(str, true, str2, this) == aVar) { return aVar; } } return b0.f332794a; } } public static final class b extends o implements kh4.a<b0> { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ lq1 f9766d; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public b(lq1 lq12) { super(0); this.f9766d = lq12; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // kh4.a public b0 invoke() { z.s().i().L(w1.a.f175779yk, Util.encodeHexString(this.f9766d.toByteArray())); return b0.f332794a; } } static { Object f15 = z.s().i().f(w1.a.f175779yk, ""); m.e(f15, "null cannot be cast to non-null type kotlin.String"); byte[] decodeHexString = Util.decodeHexString((String) f15); lq1 lq12 = f9763g; if (decodeHexString != null) { try { lq12.parseFrom(decodeHexString); } catch (Exception e15) { Log.printDebugStack("safeParser", "", e15); } } f9757a.g("ConfigStorage", f9763g, false, Boolean.FALSE); } public final aq1 a(String str) { T t15; m.g(str, "key"); Iterator<T> it = f9759c.iterator(); while (true) { if (!it.hasNext()) { t15 = null; break; } t15 = it.next(); if (m.b(t15.f16508g, str)) { break; } } return t15; } public final aq1 b(int i15) { T t15; boolean z15; Iterator<T> it = f9759c.iterator(); while (true) { if (!it.hasNext()) { t15 = null; break; } t15 = it.next(); if (t15.f16505d == i15) { z15 = true; continue; } else { z15 = false; continue; } if (z15) { break; } } return t15; } public final String c(String str) { T t15; String str2; m.g(str, "key"); Iterator<T> it = f9761e.iterator(); while (true) { if (!it.hasNext()) { t15 = null; break; } t15 = it.next(); if (m.b(t15.f17518h, str)) { break; } } T t16 = t15; if (t16 == null) { return null; } int i15 = t16.f17515e; if (i15 == 1) { str2 = t16.f17516f; } else if (i15 != 2) { str2 = null; } else { str2 = t16.f17517g; } if (Util.isNullOrNil(str2)) { return null; } return str2; } public final kq1 d(int i15) { e.f356376d.getClass(); if (((Number) ((c) ((n) e.f356482l4).getValue()).t()).intValue() == 1) { i15 = 1; } return f9758b.get(Integer.valueOf(i15)); } public final l24 e(String str) { m.g(str, "appid"); return f9762f.get(str); } public final void f(String str) { boolean z15; if (str == null || str.length() == 0) { z15 = true; } else { z15 = false; } if (!z15) { ((v0) r.f342954a.e(e2.class).c(v0.class)).C3().b(new q0(str, j3.f357048e), ((v0) r.f342954a.e(e2.class).c(v0.class)).W(h0.a.f315068d)); } } public final void g(String str, lq1 lq12, boolean z15, Boolean bool) { LinkedList<l24> linkedList; m.g(str, "source"); m.g(lq12, "infoList"); Log.i("FinderObjectWordingConfig", "resetConfig: source=" + str + ", needUpdateMemory=" + z15 + ", needRefreshStorage=" + bool + ", objectExtInfoListSize=" + lq12.f28814d.size() + ", imagesSize=" + lq12.f28819i.size() + ", wordsSize=" + lq12.f28820j.size()); f9758b.clear(); LinkedList<kq1> linkedList2 = lq12.f28814d; if (linkedList2 != null) { for (T t15 : linkedList2) { StringBuilder sb5 = new StringBuilder(); sb5.append("resetConfig: source="); sb5.append(str); sb5.append(", objectExtInfo="); m.f(t15, LocaleUtil.ITALIAN); sb5.append(i.h(t15)); Log.i("FinderObjectWordingConfig", sb5.toString()); f9758b.put(Integer.valueOf(t15.f27617d), t15); h0 h0Var = h0.f315067a; j80.d<j0> b15 = h0Var.b(); String str2 = t15.f27624n; j3 j3Var = j3.f357048e; q0 q0Var = new q0(str2, j3Var); h0.a aVar = h0.a.f315087z; b15.b(q0Var, h0Var.c(aVar)); h0Var.b().b(new q0(t15.f27625o, j3Var), h0Var.c(aVar)); h0Var.b().b(new q0(t15.f27626p, j3Var), h0Var.c(aVar)); h0Var.b().b(new q0(t15.f27627q, j3Var), h0Var.c(aVar)); } } LinkedList<aq1> linkedList3 = lq12.f28819i; m.f(linkedList3, "infoList.images"); for (T t16 : linkedList3) { StringBuilder sb6 = new StringBuilder(); sb6.append("resetConfig: source="); sb6.append(str); sb6.append(", image="); m.f(t16, LocaleUtil.ITALIAN); sb6.append(i.h(t16)); Log.i("FinderObjectWordingConfig", sb6.toString()); } LinkedList<bq1> linkedList4 = lq12.f28820j; m.f(linkedList4, "infoList.words"); for (T t17 : linkedList4) { StringBuilder sb7 = new StringBuilder(); sb7.append("resetConfig: source="); sb7.append(str); sb7.append(", word="); m.f(t17, LocaleUtil.ITALIAN); sb7.append(i.h(t17)); Log.i("FinderObjectWordingConfig", sb7.toString()); } LinkedList<aq1> linkedList5 = lq12.f28819i; if (linkedList5 == null) { linkedList5 = new LinkedList<>(); } f9759c = linkedList5; for (T t18 : linkedList5) { if (x4.B()) { f9757a.f(t18.f16507f); } else { f9757a.f(t18.f16506e); } } LinkedList<bq1> linkedList6 = lq12.f28820j; if (linkedList6 == null) { linkedList6 = new LinkedList<>(); } f9761e = linkedList6; LinkedList<cq1> linkedList7 = lq12.f28821n; if (linkedList7 == null) { linkedList7 = new LinkedList<>(); } f9760d = linkedList7; gk4.h.d(s1.f221256d, d1.f221178c, null, new a(null), 2, null); HashMap<String, l24> hashMap = f9762f; hashMap.clear(); e.f356376d.getClass(); if (((Number) ((c) ((n) e.f356636x1).getValue()).t()).intValue() == 1) { l24 l242 = new l24(); l242.f28059o = "https://miaojian.weixin.qq.com/download/apps?channel=1104"; l242.f28060p = "com.tencent.phoenix"; l242.f28058n = "miaojian://createVideo?scene=channels&from=channels-samestyle&miaojianExtInfo="; l242.f28061q = "A24DC0755072F64C480DC06DCD3412BF"; l242.f28057j = "https://apps.apple.com/app/apple-store/id1530922601?pt=69276&ct=channels1&mt=8"; l242.f28053f = null; l242.f28052e = "http://dldir1.qq.com/weixin/checkresupdate/outlined_miaojian_658e3fe317814fc8a1c209e9a5937e01.png"; l242.f28051d = "秒剪做同款"; l242.f28054g = 0; l242.f28056i = "https://v.vuevideo.net/vfromwx/createvideo?scene=channels"; l242.f28055h = "wxa5e0de08d96cc09d"; l242.f28062r = "http://dldir1.qq.com/weixin/checkresupdate/outlined_miaojian_dark_6b87f03b481440249680c17b73dac97b.png"; b0 b0Var = b0.f332794a; hashMap.put("wxa5e0de08d96cc09d", l242); } m24 m242 = lq12.f28818h; if (!(m242 == null || (linkedList = m242.f29300d) == null)) { for (T t19 : linkedList) { StringBuilder sb8 = new StringBuilder(); sb8.append("resetConfig: source="); sb8.append(str); sb8.append(", sheet="); m.f(t19, "sheet"); sb8.append(i.h(t19)); Log.i("FinderObjectWordingConfig", sb8.toString()); String str3 = t19.f28055h; if (!(str3 == null || str3.length() == 0)) { f9762f.put(str3, t19); j jVar = f9757a; jVar.f(t19.f28052e); jVar.f(t19.f28062r); } } } if (z15) { f9763g = lq12; } if (m.b(bool, Boolean.TRUE)) { m60.d.G("FinderObjectWordingConfig", new b(lq12)); } } }