WeChat.apk(点击下载) / n.java


package po3;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import bw3.d40;
import ck.q;
import com.google.android.gms.common.Scopes;
import com.tencent.mm.plugin.websearch.p;
import com.tencent.mm.protocal.GeneralControlWrapper;
import com.tencent.mm.protocal.JsapiPermissionWrapper;
import com.tencent.mm.protocal.protobuf.TimeLineObject;
import com.tencent.mm.sdk.platformtools.Log;
import com.tencent.mm.sdk.platformtools.MMApplicationContext;
import com.tencent.mm.sdk.platformtools.Util;
import com.tencent.mm.storage.RegionCodeDecoder;
import com.tencent.thumbplayer.tplayer.plugins.report.TPReportKeys;
import d63.v;
import ek4.c;
import ek4.d0;
import ek4.y;
import gh.g;
import java.io.IOException;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.Map;
import jo3.a1;
import jo3.d;
import jo3.z0;
import kp3.h1;
import kp3.j;
import lh4.m;
import nf0.w0;
import np3.a;
import sv3.b;

public final class n extends a {

    /* renamed from: d  reason: collision with root package name */
    public static final n f284760d = new n();

    @Override // kp3.b1
    public boolean a(j jVar, h1 h1Var) {
        String str;
        int i15;
        boolean z15;
        String str2;
        String str3;
        String str4;
        String str5;
        boolean z16;
        int i16;
        m.g(jVar, "env");
        m.g(h1Var, "msg");
        Log.i("MicroMsg.WebSearch.StartSearchItemDetailPageJSApi", "handleMsg params:" + h1Var.f247819a);
        Map<String, ? extends Object> map = h1Var.f247819a;
        boolean d15 = p.d(map, "isTeachPage", false);
        boolean d16 = p.d(map, "isMoreButton", false);
        boolean z17 = p.e(map, "isFeedBack", 0) == 1;
        String f15 = p.f(map, "srcUserName");
        String f16 = p.f(map, "sessionId");
        String f17 = p.f(map, "navBarColor");
        int e15 = p.e(map, "subType", 0);
        p.f(map, "searchPlaceHolder");
        String f18 = p.f(map, "jumpUrl");
        String f19 = p.f(map, "searchClickId");
        int i17 = -1;
        if (!Util.isNullOrNil(f18)) {
            m.f(f18, "jumpUrlTmp");
            str = f19;
            if (d0.x(f18, "http://mp.weixin.qq.com/imgretrieval", false) || d0.x(f18, "https://mp.weixin.qq.com/imgretrieval", false)) {
                i17 = 3;
            }
        } else {
            str = f19;
        }
        if (!Util.isNullOrNil(f17)) {
            try {
                i15 = Color.parseColor(f17);
            } catch (IllegalArgumentException e16) {
                Log.e("MicroMsg.WebSearch.StartSearchItemDetailPageJSApi", "startSearchItemDetailPage: " + e16.getMessage());
                return true;
            }
        } else {
            i15 = 0;
        }
        String f25 = p.f(map, "statusBarStyle");
        if (z17) {
            String f26 = p.f(map, "jumpUrl");
            Bundle e17 = e(jVar.f247867a);
            Context context = jVar.f247867a;
            m.f(f26, "url");
            h(context, f26, e17, 0, "", "", 0, "", 0, 0, "", -1, "");
        } else {
            int e18 = p.e(map, "type", 0);
            int e19 = p.e(map, "opType", 0);
            if (e19 <= 0) {
                z15 = true;
                if (d16) {
                    String f27 = p.f(map, "query");
                    int e25 = p.e(map, TPReportKeys.PlayerStep.PLAYER_BUFFERING_SCENE, 0);
                    String f28 = p.f(map, "searchId");
                    Intent intent = new Intent();
                    intent.putExtra("hardcode_jspermission", JsapiPermissionWrapper.f173510h);
                    intent.putExtra("hardcode_general_ctrl", GeneralControlWrapper.f173507e);
                    intent.putExtra("neverGetA8Key", true);
                    intent.putExtra("key_load_js_without_delay", true);
                    intent.putExtra("ftsQuery", f27);
                    intent.putExtra("ftsType", e18);
                    intent.putExtra("sessionId", f16);
                    Map<String, String> c15 = z0.c(e25, false, e18, "");
                    try {
                        ((HashMap) c15).put("query", q.b(f27, "UTF-8"));
                    } catch (Exception unused) {
                        ((HashMap) c15).put("query", f27);
                    }
                    HashMap hashMap = (HashMap) c15;
                    hashMap.put("searchId", f28);
                    hashMap.put("sessionId", f16);
                    String f29 = z0.f(Util.safeParseInt((String) hashMap.get(TPReportKeys.PlayerStep.PLAYER_BUFFERING_SCENE)));
                    hashMap.put("subSessionId", f29);
                    intent.putExtra("subSessionId", f29);
                    intent.putExtra("rawUrl", z0.e(c15, 0));
                    intent.putExtra("key_session_id", f16);
                    intent.putExtra("searchId", f28);
                    if (e25 == 20 || e25 == 22 || e25 == 24 || e25 == 33) {
                        b.j(MMApplicationContext.getContext(), "webview", ".ui.tools.fts.MMFTSSOSMoreWebViewUI", intent, null);
                    } else {
                        b.y(MMApplicationContext.getContext(), intent, null);
                    }
                } else {
                    Log.i("MicroMsg.WebSearch.StartSearchItemDetailPageJSApi", "doStartSearchItemDetailPage: type=%d link=%s", Integer.valueOf(e18), ((HashMap) map).get("url"));
                    if (e18 != 1) {
                        if (e18 == 2 || e18 == 4) {
                            str2 = "searchClickId";
                            str3 = str;
                            str5 = "srcUserName";
                            str4 = f15;
                        } else {
                            if (e18 == 8) {
                                z16 = true;
                                String f35 = p.f(map, "objectXmlDesc");
                                String f36 = p.f(map, "userName");
                                boolean d17 = p.d(map, "fromMusicItem", false);
                                Context context2 = jVar.f247867a;
                                m.f(f35, "xml");
                                m.f(f36, "userName");
                                TimeLineObject fJ0 = ((v) yz3.j.c(v.class)).fJ0(f35);
                                Intent intent2 = new Intent();
                                intent2.putExtra("INTENT_TALKER", f36);
                                intent2.putExtra("INTENT_SNSID", new BigInteger(fJ0.Id).longValue());
                                intent2.putExtra("SNS_FROM_MUSIC_ITEM", d17);
                                try {
                                    intent2.putExtra("INTENT_SNS_TIMELINEOBJECT", fJ0.toByteArray());
                                } catch (IOException unused2) {
                                }
                                b.j(context2, "sns", ".ui.SnsCommentDetailUI", intent2, null);
                            } else if (e18 == 16) {
                                str3 = str;
                                str5 = "srcUserName";
                                str4 = f15;
                                str2 = "searchClickId";
                            } else if (e18 != 32) {
                                String f37 = p.f(map, "jumpUrl");
                                String f38 = p.f(map, "publishId");
                                int e26 = p.e(map, "payScene", 0);
                                int e27 = p.e(map, TPReportKeys.PlayerStep.PLAYER_BUFFERING_SCENE, 0);
                                Log.i("MicroMsg.WebSearch.StartSearchItemDetailPageJSApi", "jump url = %s, publishId = %s, payScene = %d", f37, f38, Integer.valueOf(e26));
                                String f39 = p.f(map, "cookie");
                                if (!Util.isNullOrNil(f37)) {
                                    Context context3 = jVar.f247867a;
                                    m.f(f37, "jumpUrl");
                                    Bundle e28 = e(jVar.f247867a);
                                    m.f(f25, "statusBarStyle");
                                    m.f(f38, "publishId");
                                    m.f(f15, "srcUserName");
                                    m.f(f39, "h5PayCookie");
                                    m.f(str, "searchClickId");
                                    z16 = true;
                                    h(context3, f37, e28, i15, f25, f38, e26, f15, e27, e15, f39, i17, str);
                                } else {
                                    z16 = true;
                                }
                            } else {
                                z16 = true;
                                String f45 = p.f(map, "userName");
                                String f46 = p.f(map, "nickName");
                                String f47 = p.f(map, "alias");
                                String f48 = p.f(map, "signature");
                                int e29 = p.e(map, "sex", 0);
                                String f49 = p.f(map, "country");
                                String f55 = p.f(map, "city");
                                String f56 = p.f(map, "province");
                                int e35 = p.e(map, "snsFlag", 0);
                                String f57 = p.f(map, "query");
                                if (!Util.isNullOrNil(f57)) {
                                    i16 = Character.isDigit(f57.charAt(0)) ? 15 : 3;
                                    if (i16 == 15) {
                                        if (!m.b("mobile", p.f(map, "matchType"))) {
                                            i16 = 1;
                                        }
                                    }
                                    f57 = null;
                                } else {
                                    f57 = null;
                                    i16 = 3;
                                }
                                Context context4 = jVar.f247867a;
                                Intent intent3 = new Intent();
                                intent3.putExtra("Contact_User", f45);
                                intent3.putExtra("Contact_Nick", f46);
                                intent3.putExtra("Contact_Alias", f47);
                                intent3.putExtra("Contact_Sex", e29);
                                intent3.putExtra("Contact_Scene", i16);
                                intent3.putExtra("Contact_KHideExpose", true);
                                intent3.putExtra("Contact_RegionCode", RegionCodeDecoder.q(f49, f56, f55));
                                intent3.putExtra("Contact_Signature", f48);
                                intent3.putExtra("Contact_KSnsIFlag", e35);
                                intent3.putExtra("Contact_full_Mobile_MD5", f57);
                                b.j(context4, Scopes.PROFILE, ".ui.ContactInfoUI", intent3, null);
                            }
                            return z16;
                        }
                        String f58 = p.f(map, "jumpUrl");
                        String f59 = p.f(map, "publishId");
                        int e36 = p.e(map, "payScene", 0);
                        int e37 = p.e(map, TPReportKeys.PlayerStep.PLAYER_BUFFERING_SCENE, 0);
                        Log.i("MicroMsg.WebSearch.StartSearchItemDetailPageJSApi", "jump url = %s, publishId = %s, payScene = %d", f58, f59, Integer.valueOf(e36));
                        String f65 = p.f(map, "cookie");
                        if (Util.isNullOrNil(f58)) {
                            return true;
                        }
                        Context context5 = jVar.f247867a;
                        m.f(f58, "jumpUrl");
                        Bundle e38 = e(jVar.f247867a);
                        m.f(f25, "statusBarStyle");
                        m.f(f59, "publishId");
                        m.f(str4, str5);
                        m.f(f65, "h5PayCookie");
                        m.f(str3, str2);
                        h(context5, f58, e38, i15, f25, f59, e36, str4, e37, e15, f65, i17, str3);
                        return true;
                    }
                    g(jVar.f247867a, f(map), false);
                    return true;
                }
            } else if (e19 == 2) {
                z15 = true;
                g(jVar.f247867a, f(map), d15);
            } else if (e19 == 3) {
                d f66 = f(map);
                if (!w0.F(f66.f242291a)) {
                    g(jVar.f247867a, f66, d15);
                } else {
                    Context context6 = jVar.f247867a;
                    if (MMApplicationContext.isMainProcess()) {
                        a1.a(f66.f242291a);
                    }
                    Intent intent4 = new Intent();
                    intent4.putExtra("Chat_User", f66.f242291a);
                    z15 = true;
                    intent4.putExtra("finish_direct", true);
                    intent4.putExtra("key_temp_session_show_type", 0);
                    intent4.putExtra("preChatTYPE", 9);
                    b.t(context6, ".ui.chatting.ChattingUI", intent4, null);
                }
            } else if (e19 == 4) {
                String f67 = p.f(map, "jumpUrl");
                Context context7 = jVar.f247867a;
                m.f(f67, "url");
                h(context7, f67, e(jVar.f247867a), 0, "", "", 0, "", 0, 0, "", -1, "");
            }
            return z15;
        }
        z15 = true;
        return z15;
    }

    @Override // kp3.b1
    public String b() {
        return "startSearchItemDetailPageJsApi";
    }

    @Override // kp3.b1
    public int c() {
        return 10000;
    }

    public final Bundle e(Context context) {
        if (!(context instanceof AppCompatActivity)) {
            return null;
        }
        Bundle bundle = new Bundle();
        AppCompatActivity appCompatActivity = (AppCompatActivity) context;
        bundle.putString("publishIdPrefix", appCompatActivity.getIntent().getStringExtra("publishIdPrefix"));
        bundle.putString("reportSessionId", appCompatActivity.getIntent().getStringExtra("reportSessionId"));
        return bundle;
    }

    public final d f(Map<String, ? extends Object> map) {
        d dVar = new d();
        dVar.f242291a = p.f(map, "userName");
        dVar.f242292b = p.f(map, "nickName");
        dVar.f242293c = p.f(map, "headHDImgUrl");
        dVar.f242295e = p.e(map, "verifyFlag", 0);
        dVar.f242294d = p.f(map, "signature");
        dVar.f242296f = p.e(map, TPReportKeys.PlayerStep.PLAYER_BUFFERING_SCENE, 0);
        dVar.f242297g = p.e(map, "sceneActionType", 1);
        d40 d402 = new d40();
        dVar.f242298h = d402;
        d402.f18974d = p.e(map, "brandFlag", 0);
        dVar.f242298h.f18977g = p.f(map, "iconUrl");
        dVar.f242298h.f18976f = p.f(map, "brandInfo");
        dVar.f242298h.f18975e = p.f(map, "externalInfo");
        dVar.f242299i = p.f(map, "searchId");
        dVar.f242300j = p.f(map, "searchClickId");
        dVar.f242301k = p.f(map, "query");
        dVar.f242302l = p.e(map, "position", 0);
        dVar.f242303m = p.d(map, "isCurrentDetailPage", false);
        dVar.f242304n = p.f(map, "extraParams");
        dVar.f242305o = p.e(map, "friendScene", 0);
        if (p.e(map, "bizTabType", 0) == 2) {
            dVar.f242306p = 1;
        } else {
            dVar.f242306p = 0;
        }
        return dVar;
    }

    public final void g(Context context, d dVar, boolean z15) {
        int i15 = dVar.f242305o;
        if (i15 == 0) {
            if (dVar.f242297g == 2) {
                i15 = 89;
            } else if (z15) {
                i15 = 85;
            } else {
                int i16 = dVar.f242296f;
                if (i16 != 3 && i16 != 16) {
                    i15 = 39;
                } else if (dVar.f242303m) {
                    i15 = 88;
                } else {
                    i15 = 87;
                }
            }
        }
        if (MMApplicationContext.isMainProcess()) {
            a1.a(dVar.f242291a);
        }
        Intent intent = new Intent();
        intent.putExtra("Contact_User", dVar.f242291a);
        intent.putExtra("Contact_Nick", dVar.f242292b);
        intent.putExtra("Contact_BrandIconURL", dVar.f242293c);
        intent.putExtra("Contact_Signature", dVar.f242294d);
        intent.putExtra("Contact_VUser_Info_Flag", dVar.f242295e);
        intent.putExtra("Contact_Scene", i15);
        d40 d402 = dVar.f242298h;
        if (d402 != null) {
            try {
                intent.putExtra("Contact_customInfo", d402.toByteArray());
            } catch (IOException unused) {
            }
        }
        Bundle bundle = new Bundle();
        bundle.putString("Contact_Ext_Args_Search_Id", dVar.f242299i);
        bundle.putString("Contact_Ext_Args_Search_Click_Id", dVar.f242300j);
        bundle.putString("Contact_Ext_Args_Query_String", dVar.f242301k);
        bundle.putInt("Contact_Scene", i15);
        bundle.putInt("Contact_Ext_Args_Index", dVar.f242302l);
        bundle.putString("Contact_Ext_Extra_Params", dVar.f242304n);
        intent.putExtra("preChatTYPE", 10);
        intent.putExtra("Contact_Ext_Args", bundle);
        intent.putExtra("biz_profile_tab_type", dVar.f242306p);
        intent.putExtra("force_get_contact", true);
        b.j(context, Scopes.PROFILE, ".ui.ContactInfoUI", intent, null);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:9:0x005a, code lost:
        if (r8 != null) goto L_0x0060;
     */
    public final void h(Context context, String str, Bundle bundle, int i15, String str2, String str3, int i16, String str4, int i17, int i18, String str5, int i19, String str6) {
        String str7;
        Intent intent = new Intent();
        intent.putExtra("rawUrl", str);
        intent.putExtra("convertActivityFromTranslucent", false);
        intent.putExtra("customize_status_bar_color", i15);
        intent.putExtra("status_bar_style", str2);
        intent.putExtra("from_scence", i17);
        intent.putExtra("subtype", i18);
        intent.putExtra("key_h5pay_cookie", str5);
        try {
            intent.putExtra("KPageScene", 1);
            if (y.n(str6)) {
                try {
                    if (!y.n(str)) {
                        str7 = Uri.parse(str).getQueryParameter("search_click_id");
                    }
                } catch (Exception unused) {
                }
                str7 = "";
            } else {
                str7 = str6;
            }
            intent.putExtra("KPageInfo", "{ \"searchClickId\" : \"" + str7 + "\"}");
        } catch (Exception e15) {
            Log.printErrStackTrace("MicroMsg.WebSearch.StartSearchItemDetailPageJSApi", e15, "startSearchItemDetailPageUrl getSearchClickId exception", new Object[0]);
        }
        if (!Util.isNullOrNil(str3)) {
            intent.putExtra("prePublishId", str3);
            intent.putExtra("KPublisherId", str3);
        } else if (bundle != null && !Util.isNullOrNil(str)) {
            StringBuilder sb5 = new StringBuilder();
            sb5.append(bundle.getString("publishIdPrefix", "gs"));
            sb5.append('_');
            byte[] bytes = str.getBytes(c.f208058a);
            m.f(bytes, "this as java.lang.String).getBytes(charset)");
            sb5.append(g.f(bytes));
            String sb6 = sb5.toString();
            intent.putExtra("prePublishId", sb6);
            intent.putExtra("KPublisherId", sb6);
        }
        if (i16 > 0) {
            intent.putExtra("pay_channel", i16);
        }
        intent.putExtra("geta8key_scene", 65);
        intent.putExtra("preChatTYPE", 10);
        if (!Util.isNullOrNil(str4)) {
            intent.putExtra("srcUsername", str4);
        }
        if (i19 == 3) {
            intent.putExtra("show_native_web_view", true);
        }
        b.j(context, "webview", ".ui.tools.fts.MMSosWebViewUI", intent, null);
    }
}