package com.tencent.mm.plugin.game.ui.chat_tab; import android.os.Build; import android.os.Parcel; import android.os.Parcelable; import com.tencent.mm.R; import com.tencent.mm.plugin.game.model.LocalHalfScreen; import com.tencent.mm.plugin.game.model.LocalJumpInfo; import com.tencent.mm.plugin.game.model.LocalTabCornerSetting; import com.tencent.mm.plugin.game.model.WeAppJumpInfo; import com.tencent.mm.plugin.game.ui.LiteAppGameTabUI; import com.tencent.mm.pluginsdk.model.q1; import com.tencent.mm.sdk.platformtools.Log; import com.tencent.mm.sdk.platformtools.Util; import com.tencent.mm.sdk.platformtools.WeChatHosts; import com.tencent.mm.storage.w1; import d60.z; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import l92.b3; import l92.d5; import l92.e5; import l92.f5; import l92.g5; import l92.h5; import l92.i5; import l92.j5; import l92.n3; import l92.w5; import lh4.m; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; public class GameTabData2 implements Parcelable { public static final Parcelable.Creator<GameTabData2> CREATOR = new a(); /* renamed from: h reason: collision with root package name */ public static final String f126900h = ("{\n \"TabList\": [\n {\n \"Key\": \"home\",\n \"Title\": \"首页\",\n \"IconUrl\": \"https://mmgame.qpic.cn/image/4f72b9a4850edcba7ff71688b17233b8224fcc357e2357c9c09f74efc5fbb32c\",\n \"SelectedIconUrl\": \"https://mmgame.qpic.cn/image/783ef37d09913c102b1647db4eefdce9823ed1351b850fcaf30650eec844cf82\",\n \"DarkModeIconUrl\": \"https://mmgame.qpic.cn/image/b18f15fb59987306a116b4c04929e10cfe08da24ba2d3467043ae3b0a68cc598\",\n \"DarkModeSelectedIconUrl\": \"https://mmgame.qpic.cn/image/783ef37d09913c102b1647db4eefdce9823ed1351b850fcaf30650eec844cf82\",\n \"Type\": 2,\n \"JumpUrl\": \"https://" + WeChatHosts.domainString(R.string.fxy) + "/cgi-bin/h5/static/contentcenter/feeds.html?wechat_pkgid=contentcenter_feeds&abt=59&ssid=901\"\n },\n {\n \"Key\": \"gameindex\",\n \"Title\": \"游戏\",\n \"IconUrl\": \"https://mmgame.qpic.cn/image/3379a7e14dacfc6c9eea1cc3bce1abc681634348b2d10cb741402f0a7afe1b99\",\n \"SelectedIconUrl\": \"https://mmgame.qpic.cn/image/d517ee0b80e2025c8e84c4247275ff9b52e8729c661b49556dc20cfbf717ef5a\",\n \"DarkModeIconUrl\": \"https://mmgame.qpic.cn/image/e257a6c0d7dd13a2ec717ec5d370871f8624fed7fcf8bd0c9d3a29dee6d01d97\",\n \"DarkModeSelectedIconUrl\": \"https://mmgame.qpic.cn/image/d517ee0b80e2025c8e84c4247275ff9b52e8729c661b49556dc20cfbf717ef5a\",\n \"Type\": 2,\n \"JumpUrl\": \"https://" + WeChatHosts.domainString(R.string.fxy) + "/cgi-bin/h5/static/contentcenter/game.html?wechat_pkgid=contentcenter_game&ssid=901\"\n },\n {\n \"Key\": \"community\",\n \"Title\": \"游戏圈\",\n \"IconUrl\": \"https://mmgame.qpic.cn/image/090cb63e719dd5dee494f493d4dc7c767293046c8c37c3d620f3c426a4292806\",\n \"SelectedIconUrl\": \"https://mmgame.qpic.cn/image/d78d45d5a0ff85d3fa7ef3012301b21e899408c71c9039ed0b7f32884033e329\",\n \"DarkModeIconUrl\": \"https://mmgame.qpic.cn/image/3eea6be7fecf862137602860126a710860466bcb39f19a51d89664147c71aa3d\",\n \"DarkModeSelectedIconUrl\": \"https://mmgame.qpic.cn/image/d78d45d5a0ff85d3fa7ef3012301b21e899408c71c9039ed0b7f32884033e329\",\n \"Type\": 2,\n \"JumpUrl\": \"https://" + WeChatHosts.domainString(R.string.fxy) + "/cgi-bin/h5/static/appcenter/community.html?wechat_pkgid=appcenter_community&ssid=901\"\n },\n {\n \"Key\": \"chat\",\n \"Title\": \"消息\",\n \"IconUrl\": \"https://mmgame.qpic.cn/image/70b7e084e27150c4e606618d72b3afd1c474039fead8dadabf5a3438159d3cd5\",\n \"SelectedIconUrl\": \"https://mmgame.qpic.cn/image/52ed44d8619a56364c712245b5426e4aed54091754fc174503f9114fb98d3256\",\n \"DarkModeIconUrl\": \"https://mmgame.qpic.cn/image/6c4e9abf2c66d9b10e7a8a446a7285c89d0e577a6183eb222708d0cb9fc33bf3\",\n \"DarkModeSelectedIconUrl\": \"https://mmgame.qpic.cn/image/52ed44d8619a56364c712245b5426e4aed54091754fc174503f9114fb98d3256\",\n \"Type\": 1\n }\n ],\n \"DefaultTab\": {\n \"Key\": \"home\"\n }\n }"); /* renamed from: d reason: collision with root package name */ public b f126901d; /* renamed from: e reason: collision with root package name */ public String f126902e; /* renamed from: f reason: collision with root package name */ public String f126903f; /* renamed from: g reason: collision with root package name */ public String f126904g; public class a implements Parcelable.Creator<GameTabData2> { /* Return type fixed from 'java.lang.Object' to match base method */ @Override // android.os.Parcelable.Creator public GameTabData2 createFromParcel(Parcel parcel) { return new GameTabData2(parcel, null); } /* Return type fixed from 'java.lang.Object[]' to match base method */ @Override // android.os.Parcelable.Creator public GameTabData2[] newArray(int i15) { return new GameTabData2[i15]; } } public class b extends LinkedHashMap<String, TabItem> { public b(GameTabData2 gameTabData2) { } /* renamed from: a */ public TabItem put(String str, TabItem tabItem) { tabItem.A = size() + 1; return (TabItem) super.put(str, tabItem); } } public GameTabData2() { this.f126901d = new b(this); } public static boolean c(GameTabData2 gameTabData2, d5 d5Var) { String str; if (d5Var == null || Util.isNullOrNil(d5Var.f251310d)) { return false; } gameTabData2.f126903f = d5Var.f251312f; gameTabData2.f126904g = d5Var.f251313g; Iterator<j5> it = d5Var.f251310d.iterator(); while (it.hasNext()) { TabItem tabItem = new TabItem(it.next()); if (!Util.isNullOrNil(tabItem.f126905d)) { gameTabData2.f126901d.put(tabItem.f126905d, tabItem); } } if (gameTabData2.f126901d.size() == 0) { return false; } f5 f5Var = d5Var.f251311e; String str2 = ""; if (f5Var != null) { str = Util.nullAsNil(f5Var.f251372d); } else { str = str2; } if (gameTabData2.f126901d.containsKey(str)) { gameTabData2.f126902e = str; return true; } try { str2 = (String) ((Map.Entry) gameTabData2.f126901d.entrySet().iterator().next()).getKey(); } catch (Exception unused) { } gameTabData2.f126902e = str2; return true; } public static boolean d(GameTabData2 gameTabData2, JSONObject jSONObject) { String str; try { JSONArray jSONArray = jSONObject.getJSONArray("TabList"); for (int i15 = 0; i15 < jSONArray.length(); i15++) { TabItem tabItem = new TabItem(jSONArray.optJSONObject(i15)); if (!Util.isNullOrNil(tabItem.f126905d)) { gameTabData2.f126901d.put(tabItem.f126905d, tabItem); } } if (gameTabData2.f126901d.size() != 0) { JSONObject optJSONObject = jSONObject.optJSONObject("DefaultTab"); String str2 = ""; if (optJSONObject != null) { str = optJSONObject.optString("Key"); } else { str = str2; } if (gameTabData2.f126901d.containsKey(str)) { gameTabData2.f126902e = str; return true; } try { str2 = (String) ((Map.Entry) gameTabData2.f126901d.entrySet().iterator().next()).getKey(); } catch (Exception unused) { } gameTabData2.f126902e = str2; return true; } } catch (JSONException unused2) { } return false; } public List<TabItem> a() { ArrayList arrayList = new ArrayList(); b bVar = this.f126901d; if (bVar != null) { arrayList.addAll(bVar.values()); } return arrayList; } public String b() { for (TabItem tabItem : this.f126901d.values()) { if (tabItem.f126915q == 1) { return tabItem.f126905d; } } return ""; } public int describeContents() { return 0; } public String e() { JSONArray jSONArray = new JSONArray(); for (TabItem tabItem : this.f126901d.values()) { JSONObject jSONObject = new JSONObject(); try { jSONObject.put("Key", tabItem.f126905d); jSONObject.put("Title", tabItem.f126906e); jSONObject.put("JumpUrl", tabItem.f126916r); if (Util.nullAsNil(this.f126902e).equalsIgnoreCase(tabItem.f126905d)) { jSONObject.put("isDefaultTab", 1); } else { jSONObject.put("isDefaultTab", 0); } } catch (JSONException unused) { } jSONArray.put(jSONObject); } return jSONArray.toString(); } public void writeToParcel(Parcel parcel, int i15) { parcel.writeInt(this.f126901d.size()); for (Map.Entry entry : this.f126901d.entrySet()) { parcel.writeParcelable((Parcelable) entry.getValue(), i15); } parcel.writeString(this.f126902e); parcel.writeString(this.f126903f); parcel.writeString(this.f126904g); } public static class TabItemWeapp implements Parcelable { public static final Parcelable.Creator<TabItemWeapp> CREATOR = new a(); /* renamed from: d reason: collision with root package name */ public String f126931d; /* renamed from: e reason: collision with root package name */ public String f126932e; public class a implements Parcelable.Creator<TabItemWeapp> { /* Return type fixed from 'java.lang.Object' to match base method */ @Override // android.os.Parcelable.Creator public TabItemWeapp createFromParcel(Parcel parcel) { return new TabItemWeapp(parcel, null); } /* Return type fixed from 'java.lang.Object[]' to match base method */ @Override // android.os.Parcelable.Creator public TabItemWeapp[] newArray(int i15) { return new TabItemWeapp[i15]; } } public TabItemWeapp(h5 h5Var) { if (h5Var != null) { this.f126931d = h5Var.f251437d; this.f126932e = h5Var.f251438e; } } public int describeContents() { return 0; } public void writeToParcel(Parcel parcel, int i15) { parcel.writeString(this.f126931d); parcel.writeString(this.f126932e); } public TabItemWeapp(JSONObject jSONObject) { if (jSONObject != null) { this.f126931d = jSONObject.optString("AppId"); this.f126932e = jSONObject.optString("Path"); } } public TabItemWeapp(Parcel parcel, a aVar) { this.f126931d = parcel.readString(); this.f126932e = parcel.readString(); } } public GameTabData2(Parcel parcel, a aVar) { int readInt = parcel.readInt(); if (this.f126901d == null) { this.f126901d = new b(this); } for (int i15 = 0; i15 < readInt; i15++) { TabItem tabItem = (TabItem) parcel.readParcelable(TabItem.class.getClassLoader()); if (tabItem != null) { this.f126901d.put(tabItem.f126905d, tabItem); } } this.f126902e = parcel.readString(); this.f126903f = parcel.readString(); this.f126904g = parcel.readString(); } public static class TabItemLiteApp implements Parcelable { public static final Parcelable.Creator<TabItemLiteApp> CREATOR = new a(); /* renamed from: d reason: collision with root package name */ public String f126925d; /* renamed from: e reason: collision with root package name */ public String f126926e; /* renamed from: f reason: collision with root package name */ public String f126927f; public class a implements Parcelable.Creator<TabItemLiteApp> { /* Return type fixed from 'java.lang.Object' to match base method */ @Override // android.os.Parcelable.Creator public TabItemLiteApp createFromParcel(Parcel parcel) { return new TabItemLiteApp(parcel, null); } /* Return type fixed from 'java.lang.Object[]' to match base method */ @Override // android.os.Parcelable.Creator public TabItemLiteApp[] newArray(int i15) { return new TabItemLiteApp[i15]; } } public TabItemLiteApp(g5 g5Var) { if (g5Var != null) { this.f126925d = g5Var.f251394d; this.f126926e = g5Var.f251395e; this.f126927f = g5Var.f251396f; } } public int describeContents() { return 0; } public void writeToParcel(Parcel parcel, int i15) { parcel.writeString(this.f126925d); parcel.writeString(this.f126926e); parcel.writeString(this.f126927f); } public TabItemLiteApp(JSONObject jSONObject) { if (jSONObject != null) { this.f126925d = jSONObject.optString("AppId"); this.f126926e = jSONObject.optString("Path"); this.f126927f = jSONObject.optString("Query"); } } public TabItemLiteApp(Parcel parcel, a aVar) { this.f126925d = parcel.readString(); this.f126926e = parcel.readString(); this.f126927f = parcel.readString(); } } public static class TabItemReport implements Parcelable { public static final Parcelable.Creator<TabItemReport> CREATOR = new a(); /* renamed from: d reason: collision with root package name */ public int f126928d; /* renamed from: e reason: collision with root package name */ public int f126929e; /* renamed from: f reason: collision with root package name */ public String f126930f; public class a implements Parcelable.Creator<TabItemReport> { /* Return type fixed from 'java.lang.Object' to match base method */ @Override // android.os.Parcelable.Creator public TabItemReport createFromParcel(Parcel parcel) { return new TabItemReport(parcel, null); } /* Return type fixed from 'java.lang.Object[]' to match base method */ @Override // android.os.Parcelable.Creator public TabItemReport[] newArray(int i15) { return new TabItemReport[i15]; } } public TabItemReport(i5 i5Var) { if (i5Var != null) { this.f126928d = i5Var.f251460d; this.f126929e = i5Var.f251461e; this.f126930f = i5Var.f251462f; } } public int describeContents() { return 0; } public void writeToParcel(Parcel parcel, int i15) { parcel.writeInt(this.f126928d); parcel.writeInt(this.f126929e); parcel.writeString(this.f126930f); } public TabItemReport(JSONObject jSONObject) { if (jSONObject != null) { this.f126928d = jSONObject.optInt("AreaId"); this.f126929e = jSONObject.optInt("PositionId"); this.f126930f = jSONObject.optString("ExternInfo"); } } public TabItemReport(Parcel parcel, a aVar) { this.f126928d = parcel.readInt(); this.f126929e = parcel.readInt(); this.f126930f = parcel.readString(); } } public static class TabItem implements Parcelable { public static final Parcelable.Creator<TabItem> CREATOR = new a(); public int A; public int B; public boolean C = false; public List<LocalTabCornerSetting> D; /* renamed from: d reason: collision with root package name */ public String f126905d; /* renamed from: e reason: collision with root package name */ public String f126906e; /* renamed from: f reason: collision with root package name */ public String f126907f; /* renamed from: g reason: collision with root package name */ public String f126908g; /* renamed from: h reason: collision with root package name */ public String f126909h; /* renamed from: i reason: collision with root package name */ public String f126910i; /* renamed from: j reason: collision with root package name */ public String f126911j; /* renamed from: n reason: collision with root package name */ public String f126912n; /* renamed from: o reason: collision with root package name */ public String f126913o; /* renamed from: p reason: collision with root package name */ public String f126914p; /* renamed from: q reason: collision with root package name */ public int f126915q; /* renamed from: r reason: collision with root package name */ public String f126916r; /* renamed from: s reason: collision with root package name */ public TabItemWeapp f126917s; /* renamed from: t reason: collision with root package name */ public TabItemReport f126918t; /* renamed from: u reason: collision with root package name */ public boolean f126919u; /* renamed from: v reason: collision with root package name */ public int f126920v; /* renamed from: w reason: collision with root package name */ public boolean f126921w; /* renamed from: x reason: collision with root package name */ public int f126922x; /* renamed from: y reason: collision with root package name */ public TabItemLiteApp f126923y; /* renamed from: z reason: collision with root package name */ public String f126924z; public class a implements Parcelable.Creator<TabItem> { /* Return type fixed from 'java.lang.Object' to match base method */ @Override // android.os.Parcelable.Creator public TabItem createFromParcel(Parcel parcel) { return new TabItem(parcel, null); } /* Return type fixed from 'java.lang.Object[]' to match base method */ @Override // android.os.Parcelable.Creator public TabItem[] newArray(int i15) { return new TabItem[i15]; } } public TabItem(j5 j5Var) { LocalJumpInfo localJumpInfo; if (j5Var != null) { this.f126905d = j5Var.f251474d; this.f126906e = j5Var.f251475e; this.f126907f = j5Var.f251476f; this.f126908g = j5Var.f251477g; this.f126909h = j5Var.f251478h; this.f126910i = j5Var.f251479i; this.f126911j = j5Var.f251480j; this.f126912n = j5Var.f251481n; this.f126913o = j5Var.f251482o; this.f126914p = j5Var.f251483p; this.f126915q = j5Var.f251484q; this.f126916r = j5Var.f251485r; this.f126917s = new TabItemWeapp(j5Var.f251486s); this.f126918t = new TabItemReport(j5Var.f251487t); this.f126919u = j5Var.f251488u; this.f126920v = j5Var.f251489v; this.f126921w = j5Var.f251492y; this.f126922x = j5Var.f251493z; this.f126923y = new TabItemLiteApp(j5Var.A); if (Util.isNullOrNil(j5Var.f251491x)) { this.D = null; } else { this.D = new ArrayList(); Iterator<e5> it = j5Var.f251491x.iterator(); while (it.hasNext()) { e5 next = it.next(); List<LocalTabCornerSetting> list = this.D; m.g(next, "<this>"); String str = next.f251336d; String str2 = next.f251342j; String str3 = next.f251338f; n3 n3Var = next.f251341i; if (n3Var != null) { int i15 = n3Var.f251582d; String str4 = n3Var.f251583e; w5 w5Var = n3Var.f251584f; WeAppJumpInfo weAppJumpInfo = w5Var != null ? new WeAppJumpInfo(w5Var.f251783d, w5Var.f251784e) : null; b3 b3Var = n3Var.f251585g; localJumpInfo = new LocalJumpInfo(i15, str4, weAppJumpInfo, b3Var != null ? new LocalHalfScreen(b3Var.f251251d, b3Var.f251252e, b3Var.f251253f) : null); } else { localJumpInfo = null; } list.add(new LocalTabCornerSetting(str, str2, str3, localJumpInfo)); } } a(); } } public final void a() { boolean z15; int i15 = this.f126915q; if (i15 == 1) { Long valueOf = Long.valueOf(Util.nullAsNil((Long) z.s().i().f(w1.a.f175174ba, 0L))); if (valueOf.longValue() == 0 || Math.abs(Util.secondsToNow(valueOf.longValue())) >= 172800) { z15 = false; } else { z15 = true; } Log.i("MicroMsg.GameTabData2", "forceChatRoomEnable:%b", Boolean.valueOf(z15)); this.f126924z = ChatRoomTabUI.class.getName(); this.C = true; } else if (i15 != 2) { if (i15 != 4) { this.f126924z = ""; } else { this.f126924z = LiteAppGameTabUI.class.getName(); } } else if (q1.a()) { this.f126924z = MMGameWebTabUI.class.getName(); } else { this.f126924z = GameWebTabUI.class.getName(); } } public int describeContents() { return 0; } public void writeToParcel(Parcel parcel, int i15) { LocalTabCornerSetting[] localTabCornerSettingArr; parcel.writeString(this.f126905d); parcel.writeString(this.f126906e); parcel.writeString(this.f126907f); parcel.writeString(this.f126908g); parcel.writeString(this.f126909h); parcel.writeString(this.f126910i); parcel.writeString(this.f126911j); parcel.writeString(this.f126912n); parcel.writeString(this.f126913o); parcel.writeString(this.f126914p); parcel.writeInt(this.f126915q); parcel.writeString(this.f126916r); parcel.writeParcelable(this.f126917s, i15); parcel.writeParcelable(this.f126918t, i15); parcel.writeByte(this.f126919u ? (byte) 1 : 0); parcel.writeInt(this.f126920v); parcel.writeByte(this.f126921w ? (byte) 1 : 0); parcel.writeInt(this.f126922x); parcel.writeParcelable(this.f126923y, i15); parcel.writeString(this.f126924z); parcel.writeInt(this.A); parcel.writeByte(this.C ? (byte) 1 : 0); if (Build.VERSION.SDK_INT >= 29) { parcel.writeParcelableList(this.D, i15); return; } if (Util.isNullOrNil(this.D)) { localTabCornerSettingArr = null; } else { localTabCornerSettingArr = new LocalTabCornerSetting[this.D.size()]; this.D.toArray(localTabCornerSettingArr); } parcel.writeParcelableArray(localTabCornerSettingArr, i15); } public TabItem(JSONObject jSONObject) { if (jSONObject != null) { this.f126905d = jSONObject.optString("Key"); this.f126906e = jSONObject.optString("Title"); this.f126911j = jSONObject.optString("IconUrl"); this.f126912n = jSONObject.optString("SelectedIconUrl"); this.f126913o = jSONObject.optString("DarkModeIconUrl"); this.f126914p = jSONObject.optString("DarkModeSelectedIconUrl"); this.f126915q = jSONObject.optInt("Type"); this.f126916r = jSONObject.optString("JumpUrl"); this.f126917s = new TabItemWeapp(jSONObject.optJSONObject("JumpWeapp")); this.f126918t = new TabItemReport(jSONObject.optJSONObject("Report")); this.f126919u = false; this.f126920v = 2; this.f126921w = false; this.f126922x = 2; this.f126923y = new TabItemLiteApp(jSONObject.optJSONObject("JumpLiteapp")); a(); } } public TabItem(Parcel parcel, a aVar) { this.f126905d = parcel.readString(); this.f126906e = parcel.readString(); this.f126907f = parcel.readString(); this.f126908g = parcel.readString(); this.f126909h = parcel.readString(); this.f126910i = parcel.readString(); this.f126911j = parcel.readString(); this.f126912n = parcel.readString(); this.f126913o = parcel.readString(); this.f126914p = parcel.readString(); this.f126915q = parcel.readInt(); this.f126916r = parcel.readString(); this.f126917s = (TabItemWeapp) parcel.readParcelable(TabItemWeapp.class.getClassLoader()); this.f126918t = (TabItemReport) parcel.readParcelable(TabItemReport.class.getClassLoader()); boolean z15 = true; this.f126919u = parcel.readByte() != 0; this.f126920v = parcel.readInt(); this.f126921w = parcel.readByte() != 0; this.f126922x = parcel.readInt(); this.f126923y = (TabItemLiteApp) parcel.readParcelable(TabItemLiteApp.class.getClassLoader()); this.f126924z = parcel.readString(); this.A = parcel.readInt(); this.C = parcel.readByte() == 0 ? false : z15; ArrayList arrayList = new ArrayList(); this.D = arrayList; if (Build.VERSION.SDK_INT >= 29) { parcel.readParcelableList(arrayList, LocalTabCornerSetting.class.getClassLoader()); return; } Parcelable[] readParcelableArray = parcel.readParcelableArray(LocalTabCornerSetting.class.getClassLoader()); if (readParcelableArray != null && readParcelableArray.length > 0) { for (LocalTabCornerSetting localTabCornerSetting : (LocalTabCornerSetting[]) Arrays.copyOf(readParcelableArray, readParcelableArray.length, LocalTabCornerSetting[].class)) { this.D.add(localTabCornerSetting); } } } } }