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


package rv3;

import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.ParcelFileDescriptor;
import android.view.View;
import bh0.d;
import bq0.n0;
import com.google.android.gms.common.Scopes;
import com.tencent.kinda.framework.widget.tools.ConstantsKinda;
import com.tencent.midas.comm.log.util.APLogFileUtil;
import com.tencent.mm.R;
import com.tencent.mm.autogen.mmdata.rpt.WxImeSendFailedReportStruct;
import com.tencent.mm.message.l;
import com.tencent.mm.message.q;
import com.tencent.mm.opensdk.constants.Build;
import com.tencent.mm.opensdk.constants.ConstantsAPI;
import com.tencent.mm.opensdk.modelmsg.WXEmojiObject;
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
import com.tencent.mm.opensdk.modelmsg.WXMiniProgramObject;
import com.tencent.mm.opensdk.modelmsg.WXMusicVideoObject;
import com.tencent.mm.plugin.appbrand.service.c1;
import com.tencent.mm.plugin.appbrand.service.d1;
import com.tencent.mm.plugin.handoff.model.HandOffURL;
import com.tencent.mm.plugin.mmsight.segment.FFmpegMetadataRetriever;
import com.tencent.mm.plugin.report.service.q;
import com.tencent.mm.pluginsdk.model.app.ReportUtil;
import com.tencent.mm.pluginsdk.ui.chat.u0;
import com.tencent.mm.sdk.platformtools.LocaleUtil;
import com.tencent.mm.sdk.platformtools.Log;
import com.tencent.mm.sdk.platformtools.MMApplicationContext;
import com.tencent.mm.sdk.platformtools.MultiProcessMMKV;
import com.tencent.mm.sdk.platformtools.Util;
import com.tencent.mm.sdk.platformtools.WeChatEnvironment;
import com.tencent.mm.storage.emotion.EmojiInfo;
import com.tencent.mm.storage.z1;
import com.tencent.mm.ui.transmit.SelectConversationUI;
import com.tencent.mm.ui.transmit.SendAppMessageWrapperUI;
import com.tencent.mm.ui.transmit.n;
import com.tencent.mm.vfs.VFSStrategy;
import com.tencent.mm.vfs.VFSStrategy$$b;
import com.tencent.mm.vfs.q1;
import com.tencent.mm.vfs.u1;
import com.tencent.mm.vfs.w1;
import com.tencent.thumbplayer.tmediacodec.util.MimeTypes;
import com.tencent.xweb.xwalk.plugin.XWalkReaderBasePlugin;
import dv3.s;
import ek4.d0;
import ek4.y;
import f14.i;
import gh.g;
import ie1.h;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import k30.a;
import lh4.m;
import nf0.b3;
import nf0.e6;
import nf0.p3;
import om0.o;
import org.json.JSONObject;
import t32.e2;
import t32.f;
import wg4.b0;
import wg4.l;
import xg4.c0;
import xg4.r0;
import yf0.c;
import yf0.l0;
import yz3.j;
import z80.b;

public final class h {

    /* renamed from: a  reason: collision with root package name */
    public static final h f298058a = new h();

    /* renamed from: b  reason: collision with root package name */
    public static String f298059b = "";

    /* renamed from: c  reason: collision with root package name */
    public static String f298060c;

    /* renamed from: d  reason: collision with root package name */
    public static String f298061d;

    /* renamed from: e  reason: collision with root package name */
    public static final HashSet<String> f298062e;

    static {
        HashSet<String> hashSet = new HashSet<>();
        hashSet.add("send_text");
        hashSet.add("send_message");
        hashSet.add("send_big_emoji");
        hashSet.add("send_appbrand");
        hashSet.add("send_message_finder_card");
        hashSet.add("send_message_biz_card");
        hashSet.add("send_message_emoji");
        hashSet.add("open_appbrand");
        hashSet.add("open_music_video");
        hashSet.add("open_finder_profile");
        hashSet.add("open_biz_profile");
        hashSet.add("send_img");
        hashSet.add("open_url_on_pc");
        hashSet.add("verify_identity");
        hashSet.add("verify_identity_token");
        hashSet.add("check_identity_token");
        hashSet.add("verify_file");
        f298062e = hashSet;
    }

    public final boolean a(c cVar) {
        if (cVar == null) {
            return false;
        }
        long j15 = MultiProcessMMKV.getMMKV("mmkv_wetype").getLong("mmkv_key_voice_to_text_after_config_insert_last_time", 0);
        long j16 = MultiProcessMMKV.getMMKV("mmkv_wetype").getLong("mmkv_key_voice_to_text_after_config_insert_time", 0);
        if (e6.a() - j15 <= ((long) cVar.f298044c) * 3600000 || j16 >= ((long) cVar.f298045d)) {
            return false;
        }
        return true;
    }

    public final boolean b(b bVar) {
        boolean z15;
        boolean z16;
        if (bVar == null) {
            Log.w("MicroMsg.WxImeHelper", "checkIfNeedShowFullTextGuide: textGuide == null ");
            return false;
        }
        boolean z17 = MultiProcessMMKV.getMMKV("mmkv_wetype").getBoolean("mmkv_key_full_text_config_has_click", false);
        StringBuilder sb5 = new StringBuilder();
        sb5.append("checkIfNeedShowFullTextGuide: hasClick(");
        sb5.append(z17);
        sb5.append(',');
        if ((bVar.f298041e & 1) == 1) {
            z15 = true;
        } else {
            z15 = false;
        }
        sb5.append(z15);
        sb5.append(')');
        Log.i("MicroMsg.WxImeHelper", sb5.toString());
        if (z17) {
            if ((bVar.f298041e & 1) == 1) {
                z16 = true;
            } else {
                z16 = false;
            }
            if (z16) {
                return false;
            }
        }
        long a15 = e6.a() - MultiProcessMMKV.getMMKV("mmkv_wetype").getLong("mmkv_key_full_text_config_insert_last_time", 0);
        Log.i("MicroMsg.WxImeHelper", "checkIfNeedShowFullTextGuide: interval(" + a15 + ',' + bVar.f298038b + ')');
        if (a15 < ((long) bVar.f298038b) * 3600000) {
            return false;
        }
        long j15 = MultiProcessMMKV.getMMKV("mmkv_wetype").getLong("mmkv_key_full_text_config_insert_count", 0);
        Log.i("MicroMsg.WxImeHelper", "checkIfNeedShowFullTextGuide: maxCount(" + j15 + ", " + bVar.f298039c + ')');
        if (j15 >= ((long) bVar.f298039c)) {
            return false;
        }
        long j16 = MultiProcessMMKV.getMMKV("mmkv_wetype").getLong("mmkv_key_scene_full_text_config_start_timestamp", 0);
        long a16 = e6.a() - j16;
        Log.i("MicroMsg.WxImeHelper", "checkIfNeedShowFullTextGuide: curAliveTime(" + j16 + ", " + a16 + ", " + bVar.f298040d + ')');
        if (a16 >= ((long) bVar.f298040d) * 3600000) {
            return false;
        }
        return true;
    }

    public final boolean c(Bundle bundle, String str, String str2) {
        if (bundle.getBoolean("f_t_f_pfd", false)) {
            ParcelFileDescriptor parcelFileDescriptor = (ParcelFileDescriptor) bundle.getParcelable(str);
            if (parcelFileDescriptor != null) {
                String e15 = f298058a.e();
                FileInputStream fileInputStream = new FileInputStream(parcelFileDescriptor.getFileDescriptor());
                w1 w1Var = new w1(new q1(e15));
                try {
                    byte[] bArr = new byte[1024];
                    while (true) {
                        int read = fileInputStream.read(bArr);
                        if (read <= 0) {
                            break;
                        }
                        w1Var.write(bArr, 0, read);
                    }
                    bundle.putString(str2, e15);
                } catch (Exception e16) {
                    Log.e("MicroMsg.WxImeHelper", "fileReplace exception:" + e16.getMessage());
                    return false;
                } finally {
                    fileInputStream.close();
                    w1Var.close();
                    parcelFileDescriptor.close();
                    bundle.remove(str);
                }
            } else {
                Log.w("MicroMsg.WxImeHelper", "fileReplacePfdToPath: pfd null");
                return false;
            }
        }
        return true;
    }

    public final String d() {
        ContentResolver contentResolver = MMApplicationContext.getContext().getContentResolver();
        a aVar = new a();
        aVar.c("default_input_method");
        aVar.c(contentResolver);
        String str = (String) j30.a.j(new Object(), aVar.b(), "com/tencent/mm/pluginsdk/wxime/WxImeHelper", "getCurIme", "()Ljava/lang/String;", "android/provider/Settings$Secure", "getString", "(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;");
        Log.i("MicroMsg.WxImeHelper", "getCurIme: " + str);
        if (str != null) {
            return (String) d0.X(str, new String[]{"/"}, false, 0, 6, null).get(0);
        }
        return "";
    }

    public final String e() {
        StringBuilder sb5 = new StringBuilder();
        VFSStrategy$$b vFSStrategy$$b = VFSStrategy.f188778a;
        sb5.append(b.j0("ime").t());
        sb5.append(File.separator);
        sb5.append(System.currentTimeMillis());
        String sb6 = sb5.toString();
        u1.e(sb6);
        return sb6;
    }

    public final String f(boolean z15) {
        String str = "";
        String string = MultiProcessMMKV.getMMKV("mmkv_wetype").getString("mmkv_key_verify_token_wx_id", str);
        if (string != null) {
            str = string;
        }
        if (z15 || Util.isNullOrNil(str)) {
            str = Util.getRandomString(16);
            MultiProcessMMKV.getMMKV("mmkv_wetype").putString("mmkv_key_verify_token_wx_id", str);
        }
        Log.i("MicroMsg.WxImeHelper", "getTempWxId result:" + str);
        m.f(str, "result");
        return str;
    }

    public final c g() {
        Context context = MMApplicationContext.getContext();
        m.f(context, "getContext()");
        PackageManager packageManager = context.getPackageManager();
        m.f(packageManager, "context.getPackageManager()");
        Intent intent = new Intent("android.intent.action.MAIN", (Uri) null);
        intent.addCategory("android.intent.category.LAUNCHER");
        intent.setPackage("com.tencent.wetype");
        boolean z15 = false;
        if (packageManager.resolveActivity(intent, 0) != null) {
            z15 = true;
        }
        if (z15) {
            return null;
        }
        String pi5 = ((ie1.h) j.c(ie1.h.class)).pi(h.c.GC, "{}");
        if (!Util.isNullOrNil(pi5) && !Util.isEqual("{}", pi5)) {
            try {
                JSONObject jSONObject = new JSONObject(pi5);
                JSONObject jSONObject2 = jSONObject.getJSONObject(MimeTypes.BASE_TYPE_TEXT);
                String str = "simplified_chinese";
                if (!LocaleUtil.isSimplifiedChineseAppLang()) {
                    if (LocaleUtil.isTraditionalChineseAppLang()) {
                        str = "traditional_chinese";
                    } else if (!LocaleUtil.isChineseAppLang()) {
                        str = "english";
                    }
                }
                JSONObject jSONObject3 = jSONObject2.getJSONObject(str);
                String string = jSONObject3.getString("content");
                String string2 = jSONObject3.getString("match");
                int i15 = jSONObject.getInt("interval");
                int i16 = jSONObject.getInt("max_time");
                if (!Util.isNullOrNil(string) && !Util.isNullOrNil(string2)) {
                    m.f(string, "content");
                    m.f(string2, "match");
                    c cVar = new c(string, string2, i15, i16);
                    if (a(cVar)) {
                        return cVar;
                    }
                }
                return null;
            } catch (Exception e15) {
                Log.e("MicroMsg.WxImeHelper", "getVoiceToTextAfterSendText, fail, reason:" + e15.getMessage());
            }
        }
        return null;
    }

    /* JADX WARNING: Code restructure failed: missing block: B:73:0x02cd, code lost:
        if (r0 == false) goto L_0x02d4;
     */
    /* JADX WARNING: Removed duplicated region for block: B:153:0x0794  */
    /* JADX WARNING: Removed duplicated region for block: B:154:0x07ff  */
    /* JADX WARNING: Removed duplicated region for block: B:203:0x0a24  */
    /* JADX WARNING: Removed duplicated region for block: B:204:0x0a39  */
    public final boolean h(View view, String str, String str2, Bundle bundle, u0 u0Var) {
        d dVar;
        String str3;
        com.tencent.mm.pluginsdk.model.app.j jVar;
        WXMediaMessage wXMediaMessage;
        Context context;
        com.tencent.mm.pluginsdk.model.app.j jVar2;
        l lVar;
        Exception e15;
        String str4;
        WXMediaMessage wXMediaMessage2;
        String D;
        String str5;
        b0 b0Var;
        String str6;
        c cVar;
        Context context2 = view != null ? view.getContext() : null;
        if (context2 == null) {
            return false;
        }
        d dVar2 = new d(view, str == null ? "" : str, bundle);
        if (!Util.isNullOrNil(str)) {
            if (!(str2 == null || str2.length() == 0) && bundle != null && c0.G(f298062e, str)) {
                Log.i("MicroMsg.WxImeHelper", "onPrivateCommandHandleByIme commandId:" + bundle.getString("command_id", "") + ", action:" + str);
                f298061d = str;
                if (Util.isEqual("verify_identity_token", str)) {
                    String string = bundle.getString("wt_id", "");
                    String string2 = bundle.getString("str", "");
                    String f15 = f(false);
                    Log.i("MicroMsg.WxImeHelper", "verifyIdentityToken wtId:" + string + ", token:" + string2 + ", wxId:" + f15);
                    long a15 = e6.a();
                    m.f(string, "wtId");
                    m.f(string2, XWalkReaderBasePlugin.PARAM_KEY_TOKEN);
                    c cVar2 = new a(string, f15, string2).f345492f;
                    if (cVar2 != null) {
                        l0.e(cVar2, new g(a15, dVar2, string2), false);
                        cVar = cVar2;
                    } else {
                        cVar = null;
                    }
                    if (cVar != null) {
                        return true;
                    }
                    d.b(dVar2, -1, "verifyIdentityToken reqResp is null!!", null, 4, null);
                    Log.e("MicroMsg.WxImeHelper", "verifyIdentityToken reqResp is null!!");
                    return true;
                } else if (Util.isEqual("verify_file", str)) {
                    int i15 = bundle.getInt("verify_ability", 1);
                    Log.i("MicroMsg.WxImeHelper", "verifyFile verifyAbility:" + i15);
                    if (i15 == 1) {
                        String string3 = bundle.getString(ConstantsKinda.INTENT_LITEAPP_PATH, "");
                        if (!Util.isUriSafeToBeCopySrc(Uri.parse(string3))) {
                            d.b(dVar2, 3, null, null, 6, null);
                            Log.w("MicroMsg.WxImeHelper", "verifyFile: VERIFY_ABILITY_FOR_FILE_PROVIDER isUriSafeToBeCopySrc false: no safe");
                            return true;
                        } else if (!((ln.l) j.c(ln.l.class)).zg(string3)) {
                            d.b(dVar2, 3, null, null, 6, null);
                            Log.w("MicroMsg.WxImeHelper", "verifyFile: VERIFY_ABILITY_FOR_FILE_PROVIDER checkFileValid is false ");
                            return true;
                        } else {
                            d.b(dVar2, 0, null, null, 6, null);
                            Log.w("MicroMsg.WxImeHelper", "verifyFile: VERIFY_ABILITY_FOR_FILE_PROVIDER success");
                            return true;
                        }
                    } else if (i15 != 2) {
                        d.b(dVar2, -1, null, null, 6, null);
                        Log.w("MicroMsg.WxImeHelper", "verifyFile UNKNOWN_ERR");
                        return true;
                    } else {
                        ParcelFileDescriptor parcelFileDescriptor = (ParcelFileDescriptor) bundle.getParcelable("pfd");
                        String string4 = bundle.getString("content", "");
                        if (parcelFileDescriptor == null) {
                            return true;
                        }
                        FileInputStream fileInputStream = new FileInputStream(parcelFileDescriptor.getFileDescriptor());
                        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                        byte[] bArr = new byte[1024];
                        while (true) {
                            int read = fileInputStream.read(bArr);
                            if (read <= 0) {
                                break;
                            }
                            byteArrayOutputStream.write(bArr, 0, read);
                        }
                        fileInputStream.close();
                        byteArrayOutputStream.close();
                        parcelFileDescriptor.close();
                        String f16 = g.f(byteArrayOutputStream.toByteArray());
                        Bundle bundle2 = dVar2.f298048c;
                        if (bundle2 != null) {
                            bundle2.remove("pfd");
                        }
                        Log.i("MicroMsg.WxImeHelper", "verifyFile contentMd5:" + string4 + ", generateMd5:" + f16);
                        if (Util.isEqual(string4, f16)) {
                            d.b(dVar2, 0, null, null, 6, null);
                            Log.w("MicroMsg.WxImeHelper", "verifyFile: VERIFY_ABILITY_FOR_PARCEL_FILE_DESCRIPTOR success");
                            return true;
                        }
                        d.b(dVar2, 5, null, null, 6, null);
                        Log.w("MicroMsg.WxImeHelper", "verifyFile: VERIFY_ABILITY_FOR_PARCEL_FILE_DESCRIPTOR checkFileValid is false ");
                        return true;
                    }
                } else if (Util.isEqual("check_identity_token", str)) {
                    String string5 = bundle.getString("str", "");
                    m.f(string5, XWalkReaderBasePlugin.PARAM_KEY_TOKEN);
                    l<Boolean, Boolean> m15 = m(string5);
                    if (!m15.f332807d.booleanValue()) {
                        d.b(dVar2, 6, null, null, 6, null);
                        return true;
                    } else if (!m15.f332808e.booleanValue()) {
                        d.b(dVar2, 7, null, null, 6, null);
                        return true;
                    } else {
                        d.b(dVar2, 0, null, null, 6, null);
                        return true;
                    }
                } else {
                    String string6 = bundle.getString("i_t", "");
                    if (Util.isNullOrNil(string6)) {
                        if (!WeChatEnvironment.isCoolassistEnv()) {
                            str3 = "MicroMsg.WxImeHelper";
                            boolean isEqual = Util.isEqual(d(), "com.tencent.wetype");
                            h hVar = f298058a;
                            f298059b = hVar.d();
                            if (isEqual) {
                                str6 = "com.tencent.wetype";
                                boolean isEqual2 = Util.isEqual(Util.getSignaturesMd5(d(), MMApplicationContext.getContext()), "07a34d20a6578d1a6810858534d160be");
                                dVar = dVar2;
                                f298060c = Util.getSignaturesMd5(hVar.d(), MMApplicationContext.getContext());
                            } else {
                                dVar = dVar2;
                                str6 = "com.tencent.wetype";
                            }
                            String str7 = f298059b;
                            String str8 = f298060c;
                            String str9 = f298061d;
                            WxImeSendFailedReportStruct wxImeSendFailedReportStruct = new WxImeSendFailedReportStruct();
                            wxImeSendFailedReportStruct.f72440d = wxImeSendFailedReportStruct.b("currentImePacketName", str7, true);
                            wxImeSendFailedReportStruct.f72441e = wxImeSendFailedReportStruct.b("currentImePacketNameMd5", str8, true);
                            wxImeSendFailedReportStruct.f72442f = wxImeSendFailedReportStruct.b("action", str9, true);
                            wxImeSendFailedReportStruct.f72443g = 0;
                            wxImeSendFailedReportStruct.n();
                            String q15 = wxImeSendFailedReportStruct.q();
                            m.f(q15, "struct.toShowString()");
                            Log.i("MicroMsg.WxImeReport", "report%s %s", 28540, y.q(q15, APLogFileUtil.SEPARATOR_LINE, " ", false));
                            HashMap e16 = Util.isEqual("verify_identity", str) ? r0.e(new l("str", f(true))) : null;
                            boolean isEqual3 = Util.isEqual(Util.getSignaturesMd5(d(), MMApplicationContext.getContext()), "07a34d20a6578d1a6810858534d160be");
                            f298060c = Util.getSignaturesMd5(hVar.d(), MMApplicationContext.getContext());
                            if (!isEqual3) {
                                d.b(dVar, 2, null, e16, 2, null);
                                return false;
                            }
                            boolean isEqual4 = Util.isEqual(d(), str6);
                            f298059b = hVar.d();
                            if (!isEqual4) {
                                d.b(dVar, 1, null, e16, 2, null);
                                return false;
                            }
                            d.b(dVar, -1, null, e16, 2, null);
                            return false;
                        }
                        dVar = dVar2;
                        str3 = "MicroMsg.WxImeHelper";
                        if (Util.isEqual("verify_identity", str)) {
                            d.b(dVar, 0, null, null, 6, null);
                            return true;
                        }
                    } else {
                        dVar = dVar2;
                        str3 = "MicroMsg.WxImeHelper";
                        m.f(string6, "identityToken");
                        l<Boolean, Boolean> m16 = m(string6);
                        if (!m16.f332807d.booleanValue()) {
                            d.b(dVar, 6, null, null, 6, null);
                            return false;
                        } else if (!m16.f332808e.booleanValue()) {
                            d.b(dVar, 7, null, null, 6, null);
                            return false;
                        }
                    }
                    WXMediaMessage fromBundle = WXMediaMessage.Builder.fromBundle(bundle);
                    Log.i(str3, "onPrivateCommandHandleByIme action:%s, toUser:%s, type:%s ", str, str2, Integer.valueOf(fromBundle.getType()));
                    com.tencent.mm.pluginsdk.model.app.j jVar3 = new com.tencent.mm.pluginsdk.model.app.j();
                    jVar3.field_appId = bundle.getString("appid", "");
                    if (Util.isEqual("send_appbrand", str)) {
                        new s.h(context2).p(str2);
                        String string7 = bundle.getString("appid", "");
                        m.f(string7, "bundle.getString(WxPCSendAppBrand.APP_ID, \"\")");
                        String string8 = bundle.getString("wxaPath", "");
                        m.f(string8, "bundle.getString(WxPCSendAppBrand.WXA_PATH, \"\")");
                        String string9 = bundle.getString(FFmpegMetadataRetriever.METADATA_KEY_TITLE, "");
                        m.f(string9, "bundle.getString(WxPCSendAppBrand.TITLE, \"\")");
                        String string10 = bundle.getString("appName", "");
                        m.f(string10, "bundle.getString(WxPCSendAppBrand.APP_NAME, \"\")");
                        byte[] byteArray = bundle.getByteArray("thumbArray");
                        m.g(str2, "toUser");
                        Bundle bundle3 = new Bundle();
                        bundle3.putInt("_wxapi_sendmessagetowx_req_media_type", 36);
                        bundle3.putString(ConstantsAPI.TOKEN, "OpenSdkToken@1637854984953");
                        bundle3.putString("_wxapi_basereq_transaction", string7);
                        bundle3.putInt("_wxobject_sdkVer", 0);
                        bundle3.putString("_wxminiprogram_path", string8);
                        bundle3.putInt("_wxminiprogram_type", 0);
                        bundle3.putString("_wxobject_description", string9);
                        bundle3.putString(ConstantsAPI.APP_PACKAGE, "net.sourceforge.simcpux");
                        bundle3.putString(ConstantsAPI.CONTENT, "");
                        bundle3.putString("_wxapi_sendmessagetowx_req_use_open_id", "webpage1637862529089");
                        bundle3.putBoolean("SendAppMessageWrapper_TokenValid", true);
                        bundle3.putString("SendAppMessageWrapper_PkgName", "net.sourceforge.simcpux");
                        bundle3.putBoolean("SendAppMessageWrapper_SkipCompressVideo", true);
                        bundle3.putBoolean("SendAppMessageWrapper_BlockInvalidToken", false);
                        bundle3.putInt("SendAppMessageWrapper_secFlagForSinglePageMode", 0);
                        bundle3.putString("SendAppMessageWrapper_videoTransPara", "");
                        bundle3.putString("SendAppMessageWrapper_videoTransPara", "");
                        ReportUtil.ReportArgs a16 = ReportUtil.a(bundle3, -2);
                        Intent intent = new Intent(context2, SelectConversationUI.class);
                        intent.putExtra("Select_Report_Args", a16);
                        intent.putExtra("Select_Conv_NextStep", new Intent(context2, SendAppMessageWrapperUI.class).putExtras(bundle3).putExtra("SendAppMessageWrapper_Scene", 0).putExtra("animation_pop_in", true));
                        intent.putExtra("Select_App_Id", string7);
                        intent.putExtra("Select_Open_Id", "");
                        intent.putExtra("Select_Conv_Type", 3);
                        intent.putExtra("mutil_select_is_ret", false);
                        intent.putExtra("Select_Conv_User", str2);
                        Intent putExtra = new Intent(context2, SendAppMessageWrapperUI.class).putExtras(bundle3).putExtra("SendAppMessageWrapper_Scene", 0).putExtra("animation_pop_in", true);
                        m.f(putExtra, "Intent(\n            cont…l.ANIMATION_POP_IN, true)");
                        Bundle extras = intent.getExtras();
                        m.d(extras);
                        putExtra.putExtras(extras);
                        WXMediaMessage wXMediaMessage3 = new WXMediaMessage();
                        wXMediaMessage3.sdkVer = Build.SDK_INT;
                        WXMiniProgramObject wXMiniProgramObject = new WXMiniProgramObject();
                        wXMiniProgramObject.path = string8;
                        wXMiniProgramObject.userName = string10;
                        wXMiniProgramObject.webpageUrl = "https://mp.weixin.qq.com/mp/waerrpage?appid=" + string7 + "&amp;type=upgrade&amp;upgradetype=3#wechat_redirect";
                        wXMediaMessage3.mediaObject = wXMiniProgramObject;
                        wXMediaMessage3.title = string9;
                        wXMediaMessage3.description = string9;
                        wXMediaMessage3.thumbData = byteArray;
                        LinkedList linkedList = new LinkedList();
                        linkedList.add(str2);
                        com.tencent.mm.pluginsdk.model.app.j jVar4 = new com.tencent.mm.pluginsdk.model.app.j();
                        jVar4.field_appId = string7;
                        WXMediaMessage.IMediaObject iMediaObject = wXMediaMessage3.mediaObject;
                        m.e(iMediaObject, "null cannot be cast to non-null type com.tencent.mm.opensdk.modelmsg.WXMiniProgramObject");
                        WXMiniProgramObject wXMiniProgramObject2 = (WXMiniProgramObject) iMediaObject;
                        ((c1) j.c(c1.class)).LN(wXMiniProgramObject2.userName).P(new e(wXMediaMessage3, wXMiniProgramObject2, linkedList, jVar4));
                        d.b(dVar, 0, null, null, 6, null);
                        i.a(i.f298063a, 1, 36, bundle.getString(FFmpegMetadataRetriever.METADATA_KEY_TITLE, ""), bundle.getString("appid", ""), null, null, null, null, null, null, 1008, null);
                        return true;
                    }
                    Context context3 = context2;
                    if (Util.isEqual("open_appbrand", str)) {
                        o oVar = new o();
                        oVar.f277591a = bundle.getString("appName", "");
                        oVar.f277596f = bundle.getString("wxaPath", "");
                        oVar.f277601k = jr0.a.CTRL_INDEX;
                        oVar.f277610t = str2;
                        ((d1) j.c(d1.class)).r80(context3, oVar);
                        d.b(dVar, 0, null, null, 6, null);
                        String string11 = bundle.getString("appid", "");
                        if (string11 == null || string11.length() == 0) {
                            string11 = i.a(oVar.f277591a);
                        }
                        i.a(i.f298063a, 2, 36, bundle.getString(FFmpegMetadataRetriever.METADATA_KEY_TITLE, ""), string11, null, null, null, null, null, null, 1008, null);
                        return true;
                    } else if (Util.isEqual("send_text", str)) {
                        if (u0Var != null) {
                            u0Var.u(bundle.getString("content", ""));
                        }
                        d.b(dVar, 0, null, null, 6, null);
                        return true;
                    } else if (Util.isEqual("send_big_emoji", str)) {
                        if (bundle.getBoolean("f_t_f_pfd", false)) {
                            ParcelFileDescriptor parcelFileDescriptor2 = (ParcelFileDescriptor) bundle.getParcelable("thumbPFD");
                            if (parcelFileDescriptor2 != null) {
                                FileInputStream fileInputStream2 = new FileInputStream(parcelFileDescriptor2.getFileDescriptor());
                                ByteArrayOutputStream byteArrayOutputStream2 = new ByteArrayOutputStream();
                                byte[] bArr2 = new byte[1024];
                                while (true) {
                                    try {
                                        int read2 = fileInputStream2.read(bArr2);
                                        if (read2 <= 0) {
                                            break;
                                        }
                                        byteArrayOutputStream2.write(bArr2, 0, read2);
                                    } catch (Exception e17) {
                                        str5 = str3;
                                        Log.e(str5, "fileReplace exception:" + e17.getMessage());
                                        fileInputStream2.close();
                                        byteArrayOutputStream2.close();
                                        parcelFileDescriptor2.close();
                                        bundle.remove("thumbPFD");
                                        wXMediaMessage2 = null;
                                    } catch (Throwable th5) {
                                        fileInputStream2.close();
                                        byteArrayOutputStream2.close();
                                        parcelFileDescriptor2.close();
                                        bundle.remove("thumbPFD");
                                        throw th5;
                                    }
                                }
                                WXMediaMessage wXMediaMessage4 = new WXMediaMessage(new WXEmojiObject(byteArrayOutputStream2.toByteArray()));
                                fileInputStream2.close();
                                byteArrayOutputStream2.close();
                                parcelFileDescriptor2.close();
                                bundle.remove("thumbPFD");
                                wXMediaMessage2 = wXMediaMessage4;
                                str5 = str3;
                                b0Var = b0.f332794a;
                            } else {
                                str5 = str3;
                                wXMediaMessage2 = null;
                                b0Var = null;
                            }
                            if (b0Var == null) {
                                Log.w(str5, "sendEmoji: pfd null");
                            }
                            if (wXMediaMessage2 == null) {
                                d.b(dVar, 5, null, null, 6, null);
                                Log.w(str5, "sendEmoji: msg null. pfd exception");
                            } else {
                                str4 = str5;
                                D = ((ic1.h) ((vb1.g) j.c(vb1.g.class)).bp()).D(context3, wXMediaMessage2, null);
                                Log.i(str4, "sendEmoji: emojiMd5:%s", D);
                                if (D == null) {
                                    EmojiInfo G = ((ic1.h) ((vb1.g) j.c(vb1.g.class)).bp()).G(D);
                                    G.field_activityid = bundle.getString(ConstantsAPI.WXWebPage.KEY_ACTIVITY_ID, "");
                                    G.field_groupId = bundle.getString("product_id", "");
                                    G.field_designerID = bundle.getString("designer_id", "");
                                    ((ic1.h) ((vb1.g) j.c(vb1.g.class)).bp()).S(str2, G, null);
                                    d.b(dVar, 0, null, null, 6, null);
                                    i.a(i.f298063a, 1, 8, null, null, null, D, bundle.getString("product_id", ""), null, null, null, 924, null);
                                } else {
                                    d.b(dVar, 3, null, null, 6, null);
                                    String str10 = f298059b;
                                    String str11 = f298060c;
                                    String str12 = f298061d;
                                    WxImeSendFailedReportStruct wxImeSendFailedReportStruct2 = new WxImeSendFailedReportStruct();
                                    wxImeSendFailedReportStruct2.f72440d = wxImeSendFailedReportStruct2.b("currentImePacketName", str10, true);
                                    wxImeSendFailedReportStruct2.f72441e = wxImeSendFailedReportStruct2.b("currentImePacketNameMd5", str11, true);
                                    wxImeSendFailedReportStruct2.f72442f = wxImeSendFailedReportStruct2.b("action", str12, true);
                                    wxImeSendFailedReportStruct2.f72443g = 1;
                                    wxImeSendFailedReportStruct2.n();
                                    String q16 = wxImeSendFailedReportStruct2.q();
                                    m.f(q16, "struct.toShowString()");
                                    Log.i("MicroMsg.WxImeReport", "report%s %s", 28540, y.q(q16, APLogFileUtil.SEPARATOR_LINE, " ", false));
                                    return true;
                                }
                            }
                        } else {
                            str4 = str3;
                            String string12 = bundle.getString("thumbPath", "");
                            if (!Util.isUriSafeToBeCopySrc(Uri.parse(string12))) {
                                d.b(dVar, 3, null, null, 6, null);
                                Log.w(str4, "sendEmoji: isUriSafeToBeCopySrc false: no safe");
                            } else {
                                wXMediaMessage2 = new WXMediaMessage(new WXEmojiObject(string12));
                                D = ((ic1.h) ((vb1.g) j.c(vb1.g.class)).bp()).D(context3, wXMediaMessage2, null);
                                Log.i(str4, "sendEmoji: emojiMd5:%s", D);
                                if (D == null) {
                                }
                            }
                        }
                        return true;
                    } else if (Util.isEqual("send_message", str)) {
                        if (fromBundle.getType() == 8) {
                            WXMediaMessage.IMediaObject iMediaObject2 = fromBundle.mediaObject;
                            m.e(iMediaObject2, "null cannot be cast to non-null type com.tencent.mm.opensdk.modelmsg.WXEmojiObject");
                            String C = ((ic1.h) ((vb1.g) j.c(vb1.g.class)).bp()).C(context3, ((WXEmojiObject) iMediaObject2).emojiPath);
                            if (C != null) {
                                ((ic1.h) ((vb1.g) j.c(vb1.g.class)).bp()).Q(context3, str2, C, -1);
                                i.a(i.f298063a, 1, 8, null, null, null, C, bundle.getString("product_id", ""), null, null, null, 924, null);
                                d.b(dVar, 0, null, null, 6, null);
                                return true;
                            }
                        } else {
                            if (fromBundle.getType() == 36) {
                                WXMediaMessage.IMediaObject iMediaObject3 = fromBundle.mediaObject;
                                m.e(iMediaObject3, "null cannot be cast to non-null type com.tencent.mm.opensdk.modelmsg.WXMiniProgramObject");
                                String a17 = i.a(((WXMiniProgramObject) iMediaObject3).userName);
                                jVar2 = jVar3;
                                if (a17 != null) {
                                    jVar2.field_appId = a17;
                                }
                                i.a(i.f298063a, 1, 36, fromBundle.title, jVar2.field_appId, null, null, null, null, null, null, 1008, null);
                            } else {
                                jVar2 = jVar3;
                                if (fromBundle.getType() == 76) {
                                    jVar2.field_appId = bundle.getString("appId", "wx5aa333606550dfd5");
                                    i.a(i.f298063a, 1, 76, null, null, null, null, null, fromBundle.title, null, null, n0.CTRL_INDEX, null);
                                    WXMediaMessage.IMediaObject iMediaObject4 = fromBundle.mediaObject;
                                    if (iMediaObject4 instanceof WXMusicVideoObject) {
                                        m.e(iMediaObject4, "null cannot be cast to non-null type com.tencent.mm.opensdk.modelmsg.WXMusicVideoObject");
                                        WXMusicVideoObject wXMusicVideoObject = (WXMusicVideoObject) iMediaObject4;
                                        if (bundle.getBoolean("f_t_f_pfd", false)) {
                                            ParcelFileDescriptor parcelFileDescriptor3 = (ParcelFileDescriptor) bundle.getParcelable("filePFD");
                                            if (parcelFileDescriptor3 != null) {
                                                String e18 = f298058a.e();
                                                FileInputStream fileInputStream3 = new FileInputStream(parcelFileDescriptor3.getFileDescriptor());
                                                wXMediaMessage = fromBundle;
                                                w1 w1Var = new w1(new q1(e18));
                                                try {
                                                    byte[] bArr3 = new byte[1024];
                                                    jVar = jVar2;
                                                    while (true) {
                                                        try {
                                                            int read3 = fileInputStream3.read(bArr3);
                                                            if (read3 <= 0) {
                                                                break;
                                                            }
                                                            context = context3;
                                                            try {
                                                                w1Var.write(bArr3, 0, read3);
                                                                context3 = context;
                                                            } catch (Exception e19) {
                                                                e15 = e19;
                                                                try {
                                                                    Log.e(str3, "fileReplace exception:" + e15.getMessage());
                                                                    lVar = new l(null, Boolean.FALSE);
                                                                    fileInputStream3.close();
                                                                    w1Var.close();
                                                                    parcelFileDescriptor3.close();
                                                                    bundle.remove("filePFD");
                                                                    if (lVar.f332808e.booleanValue()) {
                                                                    }
                                                                } catch (Throwable th6) {
                                                                    fileInputStream3.close();
                                                                    w1Var.close();
                                                                    parcelFileDescriptor3.close();
                                                                    bundle.remove("filePFD");
                                                                    throw th6;
                                                                }
                                                            }
                                                        } catch (Exception e25) {
                                                            e15 = e25;
                                                            context = context3;
                                                            Log.e(str3, "fileReplace exception:" + e15.getMessage());
                                                            lVar = new l(null, Boolean.FALSE);
                                                            fileInputStream3.close();
                                                            w1Var.close();
                                                            parcelFileDescriptor3.close();
                                                            bundle.remove("filePFD");
                                                            if (lVar.f332808e.booleanValue()) {
                                                            }
                                                        }
                                                    }
                                                    context = context3;
                                                    lVar = new l(e18, Boolean.TRUE);
                                                } catch (Exception e26) {
                                                    e15 = e26;
                                                    jVar = jVar2;
                                                    context = context3;
                                                    Log.e(str3, "fileReplace exception:" + e15.getMessage());
                                                    lVar = new l(null, Boolean.FALSE);
                                                    fileInputStream3.close();
                                                    w1Var.close();
                                                    parcelFileDescriptor3.close();
                                                    bundle.remove("filePFD");
                                                    if (lVar.f332808e.booleanValue()) {
                                                    }
                                                }
                                                fileInputStream3.close();
                                                w1Var.close();
                                                parcelFileDescriptor3.close();
                                                bundle.remove("filePFD");
                                            } else {
                                                wXMediaMessage = fromBundle;
                                                jVar = jVar2;
                                                context = context3;
                                                Log.w(str3, "getFilePathByPfd: pfd null");
                                                lVar = new l(null, Boolean.FALSE);
                                            }
                                        } else {
                                            wXMediaMessage = fromBundle;
                                            jVar = jVar2;
                                            context = context3;
                                            lVar = new l(null, Boolean.TRUE);
                                        }
                                        if (lVar.f332808e.booleanValue()) {
                                            Log.w(str3, "sendMessage: getFilePathByPfd false.");
                                            d.b(dVar, 5, null, null, 6, null);
                                        } else {
                                            A a18 = lVar.f332807d;
                                            if (a18 != null) {
                                                wXMusicVideoObject.hdAlbumThumbFilePath = a18;
                                            }
                                            if (!((ln.l) j.c(ln.l.class)).zg(wXMusicVideoObject.hdAlbumThumbFilePath)) {
                                                String str13 = f298059b;
                                                String str14 = f298060c;
                                                String str15 = f298061d;
                                                WxImeSendFailedReportStruct wxImeSendFailedReportStruct3 = new WxImeSendFailedReportStruct();
                                                wxImeSendFailedReportStruct3.f72440d = wxImeSendFailedReportStruct3.b("currentImePacketName", str13, true);
                                                wxImeSendFailedReportStruct3.f72441e = wxImeSendFailedReportStruct3.b("currentImePacketNameMd5", str14, true);
                                                wxImeSendFailedReportStruct3.f72442f = wxImeSendFailedReportStruct3.b("action", str15, true);
                                                wxImeSendFailedReportStruct3.f72443g = 2;
                                                wxImeSendFailedReportStruct3.n();
                                                String q17 = wxImeSendFailedReportStruct3.q();
                                                m.f(q17, "struct.toShowString()");
                                                Log.i("MicroMsg.WxImeReport", "report%s %s", 28540, y.q(q17, APLogFileUtil.SEPARATOR_LINE, " ", false));
                                            }
                                            d.b(dVar, 0, null, null, 6, null);
                                            Intent intent2 = new Intent();
                                            m.g(str2, "toUserName");
                                            LinkedList linkedList2 = new LinkedList();
                                            linkedList2.add(str2);
                                            n.k(context, intent2, jVar, wXMediaMessage, linkedList2, 1, true, false, "", 0, null, 2, null, null);
                                        }
                                    }
                                }
                            }
                            wXMediaMessage = fromBundle;
                            jVar = jVar2;
                            context = context3;
                            d.b(dVar, 0, null, null, 6, null);
                            Intent intent22 = new Intent();
                            m.g(str2, "toUserName");
                            LinkedList linkedList22 = new LinkedList();
                            linkedList22.add(str2);
                            n.k(context, intent22, jVar, wXMediaMessage, linkedList22, 1, true, false, "", 0, null, 2, null, null);
                        }
                        return true;
                    } else if (Util.isEqual("open_music_video", str)) {
                        if (!((e2) j.c(e2.class)).gq()) {
                            return true;
                        }
                        if (!c(bundle, "thumbPFD", "thumbPath")) {
                            Log.w(str3, "toMusicMvMainUI: fileReplacePfdToPath false.");
                            d.b(dVar, 5, null, null, 6, null);
                            return true;
                        }
                        Intent intent3 = new Intent();
                        intent3.putExtra("key_scene", 6);
                        intent3.putExtra("key_mv_song_name", bundle.getString(FFmpegMetadataRetriever.METADATA_KEY_TITLE));
                        intent3.putExtra("key_mv_song_lyric", bundle.getString("songLyric"));
                        intent3.putExtra("key_mv_singer_name", bundle.getString("singerName"));
                        intent3.putExtra("key_mv_album_name", bundle.getString("albumName"));
                        intent3.putExtra("key_mv_music_genre", bundle.getString("musicGenre"));
                        intent3.putExtra("key_mv_identification", bundle.getString("identification"));
                        intent3.putExtra("key_mv_thumb_path", bundle.getString("thumbPath"));
                        intent3.putExtra("key_mv_music_operation_url", bundle.getString("musicUrl"));
                        intent3.putExtra("key_mv_song_mid", bundle.getString("songMid"));
                        intent3.putExtra("key_mv_album_cover_url", bundle.getString("thumbUrl"));
                        Log.i(str3, "toMusicMvMainUI: SONG_MID: " + bundle.getString("songMid") + " MUSIC_ID:" + bundle.getString("musicId") + " THUMB_URL:" + bundle.getString("thumbUrl"));
                        intent3.setFlags(268435456);
                        q.INSTANCE.kvStat(10090, "0,1");
                        bh0.n Rf0 = ((jv.b) j.c(jv.b.class)).Rf0(0, "", bundle.getString(FFmpegMetadataRetriever.METADATA_KEY_TITLE), bundle.getString("singerName"), bundle.getString("musicUrl"), "", bundle.getString("musicDataUrl"), bundle.getString("musicId"), "", bundle.getString("thumbPath"), "", "wx5aa333606550dfd5");
                        Rf0.T = true;
                        String string13 = bundle.getString("songMid");
                        Rf0.P = string13;
                        Log.i(str3, "doPlayMusic, songName:%s, singer:%s, wrapper.songWebUrl:%s, wifiUrl:%s mid:%s musicId:%s", Rf0.f12707g, Rf0.f12708h, Rf0.f12713p, Rf0.f12711n, string13, Rf0.f12705e);
                        d.j(Rf0);
                        i.a(i.f298063a, 2, 76, null, null, null, null, null, bundle.getString(FFmpegMetadataRetriever.METADATA_KEY_TITLE), null, null, n0.CTRL_INDEX, null);
                        sv3.b.j(context3, "mv", ".ui.MusicMvMainUI", intent3, null);
                        d.b(dVar, 0, null, null, 6, null);
                        return true;
                    } else if (Util.isEqual("send_message_finder_card", str)) {
                        l.b bVar = new l.b();
                        f fVar = new f();
                        String string14 = bundle.getString("username", "");
                        m.f(string14, "bundle.getString(WxPCFinder.USERNAME, \"\")");
                        fVar.j(string14);
                        String string15 = bundle.getString("nickname", "");
                        m.f(string15, "bundle.getString(WxPCFinder.NICKNAME, \"\")");
                        fVar.i(string15);
                        String string16 = bundle.getString("headerUrl", "");
                        m.f(string16, "bundle.getString(WxPCFinder.HEAD_URL, \"\")");
                        fVar.h(string16);
                        int i16 = bundle.getInt("authIcon", 0);
                        fVar.f309472b.f27863h = i16;
                        fVar.f309477g = i16;
                        String string17 = bundle.getString("authJob", "");
                        m.f(string17, "bundle.getString(WxPCFinder.AUTH_JOB, \"\")");
                        fVar.g(string17);
                        String string18 = bundle.getString("authIconUrl", "");
                        m.f(string18, "bundle.getString(WxPCFinder.AUTH_ICON_URL, \"\")");
                        fVar.f309478h = string18;
                        bVar.f(fVar);
                        bVar.f76866i = 50;
                        bVar.f76854f = MMApplicationContext.getContext().getString(R.string.giz);
                        bVar.f76870j = MMApplicationContext.getContext().getString(R.string.f368791gj0);
                        q.a.a().EK(bVar, "", "", str2, "", null);
                        d.b(dVar, 0, null, null, 6, null);
                        i.a(i.f298063a, 1, 100000, null, null, null, null, null, null, bundle.getString("username", ""), null, 764, null);
                        return true;
                    } else if (Util.isEqual("send_message_biz_card", str)) {
                        String string19 = bundle.getString("username", "");
                        z1 z1Var = p3.b().v().get(string19);
                        if (((z1Var == null || !z1Var.u3()) ? null : bg0.l.b(z1Var.getUsername())) != null) {
                            hh2.n.a().Qa(string19, str2, z1.Y5(str2), null);
                        } else {
                            b3.a().a(string19, "", new f(str2));
                        }
                        d.b(dVar, 0, null, null, 6, null);
                        i.a(i.f298063a, 1, 100001, null, null, null, null, null, null, bundle.getString("username", ""), null, 764, null);
                        return true;
                    } else if (Util.isEqual("open_biz_profile", str)) {
                        i(context3, bundle);
                        return true;
                    } else if (Util.isEqual("open_finder_profile", str)) {
                        j(context3, bundle);
                        return true;
                    } else if (Util.isEqual("send_img", str)) {
                        l(context3, bundle, str2, dVar);
                        return true;
                    } else if (Util.isEqual("open_url_on_pc", str)) {
                        k(context3, bundle, dVar);
                        return true;
                    } else {
                        Log.w(str3, "onPrivateCommandHandleByIme: error action " + str);
                        return false;
                    }
                }
            }
        }
        d.b(dVar2, -1, null, null, 6, null);
        return false;
    }

    public final void i(Context context, Bundle bundle) {
        Intent intent = new Intent();
        intent.putExtra("Contact_User", bundle.getString("username", ""));
        intent.putExtra("Contact_Alias", bundle.getString("aliasName", ""));
        intent.putExtra("Contact_QuanPin", bundle.getString("nickname", ""));
        intent.putExtra("Contact_VUser_Info_Flag", bundle.getInt("verifyFlag", 0));
        intent.putExtra("Contact_VUser_Info", bundle.getString("certInfo", ""));
        intent.putExtra("Contact_BrandIconURL", bundle.getString("brandIconUrl", ""));
        intent.putExtra("Contact_Province", bundle.getString("province", ""));
        intent.putExtra("Contact_City", bundle.getString("city", ""));
        intent.putExtra("Contact_Sex", bundle.getInt("sex", 0));
        intent.putExtra("Contact_Signature", bundle.getString("signature", ""));
        intent.putExtra("Contact_ShowUserName", true);
        intent.putExtra("Contact_KSnsIFlag", 0);
        sv3.b.j(context, Scopes.PROFILE, ".ui.ContactInfoUI", intent, null);
        i.a(i.f298063a, 2, 100001, null, null, null, null, null, null, bundle.getString("username", ""), null, 764, null);
    }

    public final void j(Context context, Bundle bundle) {
        Intent intent = new Intent();
        int i15 = 2;
        if (z1.Y5(rz0.a.a())) {
            intent.putExtra("key_finder_teen_mode_scene", 2);
            intent.putExtra("report_scene", 2);
        } else {
            intent.putExtra("key_finder_teen_mode_scene", 1);
            intent.putExtra("report_scene", 1);
        }
        e2 e2Var = (e2) j.c(e2.class);
        if (z1.Y5(rz0.a.a())) {
            i15 = 3;
        }
        e2Var.I7(i15, 3, 32, intent);
        intent.putExtra("key_enter_profile_type", 4);
        intent.putExtra("key_entrance_type", 32);
        intent.putExtra("from_user", rz0.a.a());
        intent.putExtra("finder_username", bundle.getString("username", ""));
        intent.putExtra("KEY_DO_NOT_CHECK_ENTER_BIZ_PROFILE", true);
        intent.putExtra("key_finder_teen_mode_check", true);
        intent.putExtra("key_finder_teen_mode_user_name", bundle.getString("nickname", ""));
        ((e2) j.c(e2.class)).i2(context, intent);
        i.a(i.f298063a, 2, 100000, null, null, null, null, null, null, bundle.getString("username", ""), null, 764, null);
    }

    public final void k(Context context, Bundle bundle, d dVar) {
        String string = bundle.getString("pc_open_url", "");
        String string2 = bundle.getString("pc_open_title", string);
        String string3 = bundle.getString("pc_open_title", "");
        String string4 = bundle.getString("pc_open_title", "");
        if (string == null || string.length() == 0) {
            Log.e("MicroMsg.WxImeHelper", "openUrlOnPc Fail(empty url) url:" + string + ", title:" + string2);
            d.b(dVar, -1, null, null, 6, null);
        } else if (!((ya2.c) j.c(ya2.c.class)).AO()) {
            Log.e("MicroMsg.WxImeHelper", "openUrlOnPc Fail(pc not ready) url:" + string + ", title:" + string2);
            d.b(dVar, 4, null, null, 6, null);
        } else {
            m.f(string2, FFmpegMetadataRetriever.METADATA_KEY_TITLE);
            m.f(string, "url");
            m.f(string3, "icon");
            HandOffURL handOffURL = new HandOffURL(string2, string, string3, 0, null, null, null, 120, null);
            m.f(string4, "nickname");
            handOffURL.setNickname(string4);
            Log.i("MicroMsg.WxImeHelper", "openUrlOnPc Success(send success) url:" + string + ", title:" + string2);
            ((ya2.c) j.c(ya2.c.class)).Da0(handOffURL);
            d.b(dVar, 0, null, null, 6, null);
        }
    }

    public final void l(Context context, Bundle bundle, String str, d dVar) {
        String string = bundle.getString("imgUid", "");
        if (!c(bundle, "imgPfd", "imgPath")) {
            d.b(dVar, 5, null, null, 6, null);
            Log.w("MicroMsg.WxImeHelper", "shareImg: fileReplacePfdToPath false.");
            return;
        }
        String string2 = bundle.getString("imgPath", "");
        Log.i("MicroMsg.WxImeHelper", "shareImg() called with: context = " + context + ", imgPath = " + string2 + ", toUser = " + str + " imgUid:" + string);
        if (!Util.isUriSafeToBeCopySrc(Uri.parse(string2))) {
            d.b(dVar, 3, null, null, 6, null);
            Log.w("MicroMsg.WxImeHelper", "shareImg: isUriSafeToBeCopySrc false: no safe");
        } else if (!((ln.l) j.c(ln.l.class)).zg(string2)) {
            d.b(dVar, 3, null, null, 6, null);
            Log.w("MicroMsg.WxImeHelper", "shareImg: checkFileValid is false ");
        } else {
            hh2.n.a().Bi(context, str, string2, 1, "", "", null);
            i.a(i.f298063a, 2, 2, null, null, null, null, null, null, null, string, 508, null);
        }
    }

    public final wg4.l<Boolean, Boolean> m(String str) {
        String string = MultiProcessMMKV.getMMKV("mmkv_wetype").getString("mmkv_key_verify_token_success_str", "");
        Log.i("MicroMsg.WxImeHelper", "verifyIdentityTokenValid curToken:" + string + ", identityToken:" + str);
        if (Util.isEqual(string, str)) {
            long j15 = MultiProcessMMKV.getMMKV("mmkv_wetype").getLong("mmkv_key_verify_token_valid_time", 0);
            long b15 = e6.b();
            Log.i("MicroMsg.WxImeHelper", "verifyIdentityTokenValid validTimestamp:" + j15 + ", current:" + b15);
            return new wg4.l<>(Boolean.TRUE, Boolean.valueOf(j15 > b15));
        }
        Boolean bool = Boolean.FALSE;
        return new wg4.l<>(bool, bool);
    }
}