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


package com.tencent.mm.plugin.appbrand.launching;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Parcelable;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Pair;
import bw3.av5;
import bw3.cv;
import com.tencent.luggage.sdk.launching.ActivityStarterIpcDelegate;
import com.tencent.luggage.sdk.launching.h;
import com.tencent.mm.R;
import com.tencent.mm.autogen.mmdata.rpt.WeAppQualitySystemContactCGIStruct;
import com.tencent.mm.plugin.appbrand.a3;
import com.tencent.mm.plugin.appbrand.api.WeAppOpenDeclarePromptBundle;
import com.tencent.mm.plugin.appbrand.app.r1;
import com.tencent.mm.plugin.appbrand.appcache.f;
import com.tencent.mm.plugin.appbrand.appcache.f3;
import com.tencent.mm.plugin.appbrand.appcache.m;
import com.tencent.mm.plugin.appbrand.appusage.s;
import com.tencent.mm.plugin.appbrand.config.AppBrandInitConfigWC;
import com.tencent.mm.plugin.appbrand.config.AppBrandLaunchFromNotifyReferrer;
import com.tencent.mm.plugin.appbrand.config.HalfScreenConfig;
import com.tencent.mm.plugin.appbrand.config.WxaAttributes;
import com.tencent.mm.plugin.appbrand.config.k;
import com.tencent.mm.plugin.appbrand.keylogger.n;
import com.tencent.mm.plugin.appbrand.launching.e3;
import com.tencent.mm.plugin.appbrand.launching.l;
import com.tencent.mm.plugin.appbrand.launching.params.LaunchParcel;
import com.tencent.mm.plugin.appbrand.launching.report.AppBrandRuntimeReloadReportBundle;
import com.tencent.mm.plugin.appbrand.launching.u4;
import com.tencent.mm.plugin.appbrand.launching.v4;
import com.tencent.mm.plugin.appbrand.networking.lib_server_mode.WxAppLibServerMode;
import com.tencent.mm.plugin.appbrand.report.AppBrandStatObject;
import com.tencent.mm.plugin.appbrand.report.j0;
import com.tencent.mm.plugin.appbrand.report.quality.QualitySession;
import com.tencent.mm.plugin.appbrand.report.quality.i;
import com.tencent.mm.plugin.appbrand.report.t;
import com.tencent.mm.plugin.appbrand.step.KSProcessWeAppLaunch;
import com.tencent.mm.plugin.appbrand.task.AppBrandProcessesManager;
import com.tencent.mm.plugin.appbrand.ui.AppBrand404PageUI;
import com.tencent.mm.plugin.report.service.q;
import com.tencent.mm.sdk.http.HttpWrapperBase;
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.sdk.platformtools.WeChatHosts;
import d60.z;
import dx0.b;
import gk4.d1;
import hn0.f0;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Locale;
import java.util.concurrent.TimeoutException;
import jd4.c;
import lh4.m;
import org.json.JSONObject;
import rv0.d;
import xc4.j;
import xg4.u;
import yf0.b;
import yf0.n0;

public final class p extends l implements a2 {

    /* renamed from: p  reason: collision with root package name */
    public final boolean f91836p;

    /* renamed from: q  reason: collision with root package name */
    public b3 f91837q = null;

    /* renamed from: r  reason: collision with root package name */
    public final LaunchParcel f91838r;

    /* renamed from: s  reason: collision with root package name */
    public b f91839s = null;

    /* renamed from: t  reason: collision with root package name */
    public final String f91840t;

    /* renamed from: u  reason: collision with root package name */
    public final String f91841u;

    /* renamed from: v  reason: collision with root package name */
    public final int f91842v;

    /* renamed from: w  reason: collision with root package name */
    public final AppBrandLaunchFromNotifyReferrer f91843w;

    /* renamed from: x  reason: collision with root package name */
    public final HalfScreenConfig f91844x;

    /* renamed from: y  reason: collision with root package name */
    public volatile h f91845y = h.LEGACY;

    public interface a {
        void b(String str, String str2);
    }

    public interface b {
        void a();
    }

    public p(LaunchParcel launchParcel, String str, boolean z15, l.a<AppBrandInitConfigWC> aVar, b bVar) {
        super(launchParcel, aVar);
        this.f91838r = launchParcel;
        this.f91840t = str;
        this.f91841u = launchParcel.B;
        this.f91842v = launchParcel.C;
        this.f91839s = bVar;
        this.f91843w = launchParcel.D;
        this.f91836p = z15;
        this.f91844x = launchParcel.E;
        Log.i("MicroMsg.AppBrandPreLaunchProcessWC", "<init> username[%s] appId[%s] instanceId[%s] forceUseBackupWxaAttrs[%b]", launchParcel.f91876d, launchParcel.f91877e, str, Boolean.valueOf(z15));
    }

    /* JADX DEBUG: Failed to insert an additional move for type inference into block B:59:0x0184 */
    /* JADX DEBUG: Failed to insert an additional move for type inference into block B:71:0x01dc */
    /* JADX DEBUG: Multi-variable search result rejected for r2v28, resolved type: java.lang.String */
    /* JADX DEBUG: Multi-variable search result rejected for r2v33, resolved type: java.lang.String */
    /* JADX DEBUG: Multi-variable search result rejected for r2v65, resolved type: java.lang.String */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARNING: Removed duplicated region for block: B:110:0x031f  */
    /* JADX WARNING: Removed duplicated region for block: B:118:0x0338  */
    /* JADX WARNING: Removed duplicated region for block: B:132:0x03a7  */
    /* JADX WARNING: Removed duplicated region for block: B:143:0x03cc A[RETURN] */
    /* JADX WARNING: Removed duplicated region for block: B:147:0x03d2  */
    /* JADX WARNING: Removed duplicated region for block: B:158:0x0403  */
    /* JADX WARNING: Removed duplicated region for block: B:168:? A[ORIG_RETURN, RETURN, SYNTHETIC] */
    public boolean a(WxaAttributes wxaAttributes, boolean z15) {
        boolean z16;
        boolean z17;
        int i15;
        boolean z18;
        WxaAttributes wxaAttributes2;
        String str;
        String str2;
        String str3;
        String str4;
        int i16;
        Pair pair;
        int intValue;
        v4.a aVar;
        int ordinal;
        char c15;
        char c16;
        String str5;
        int i17;
        int i18;
        String str6;
        String str7;
        Exception e15;
        WxaAttributes wxaAttributes3;
        WxaAttributes wxaAttributes4;
        int i19;
        Object[] objArr;
        String str8;
        WxaAttributes wxaAttributes5;
        WxaAttributes wxaAttributes6;
        WxaAttributes wxaAttributes7;
        cv cvVar;
        WxaAttributes wxaAttributes8 = wxaAttributes;
        String str9 = wxaAttributes8.field_appId;
        int i25 = 1;
        if (((jt3.b) z.q(jt3.b.class)).gv0().b("WeAppForbiddenSwitch", 0) == 1) {
            Log.i("MicroMsg.AppBrand.PreLaunchCheckForOversea", "startApp, WeAppForbiddenSwitch == 1, go webview, appId %s", str9);
            Intent intent = new Intent();
            String str10 = a3.f83433d;
            Intent putExtra = intent.putExtra("rawUrl", String.format(Locale.US, HttpWrapperBase.PROTOCAL_HTTPS + WeChatHosts.domainString(R.string.fy9) + "/mp/waerrpage?appid=%s&type=overseas#wechat_redirect", str9)).putExtra("forceHideShare", true);
            Context context = MMApplicationContext.getContext();
            if (!(context instanceof Activity)) {
                putExtra.addFlags(268435456);
            }
            sv3.b.j(context, "webview", ".ui.tools.WebViewUI", putExtra, null);
            z16 = true;
        } else {
            z16 = false;
        }
        if (z16) {
            return true;
        }
        if (2 == this.f91751f) {
            b bVar = this.f91839s;
            if (bVar != null) {
                bVar.a();
            }
            boolean G = AppBrandProcessesManager.J().G(str9);
            Log.i("MicroMsg.AppBrand.PrepareStepOpBan", "checkDemoInfo for appId:%s, fromBackground:%b", str9, Boolean.valueOf(G));
            if ((!G || !l1.f91759a.c()) && (G || !l1.f91759a.b() || TextUtils.isEmpty(((f) r1.dO0(f.class)).Sa(str9, 2)))) {
                b.c b15 = n0.b(v4.a(str9, null, null), 20000);
                int i26 = b15.f345499a;
                String str11 = ".ui.tools.WebViewUI";
                if (i26 != 0) {
                    str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                    str3 = "rawUrl";
                    str5 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                    c15 = 0;
                    c16 = 1;
                    str2 = str11;
                    str = "webview";
                    i25 = 2;
                    str11 = "forceHideShare";
                    i17 = 4;
                } else if (b15.f345500b != 0) {
                    str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                    str3 = "rawUrl";
                    str5 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                    c15 = 0;
                    c16 = 1;
                    str2 = str11;
                    str = "webview";
                    i17 = 4;
                    i25 = 2;
                    str11 = "forceHideShare";
                } else {
                    try {
                        cv cvVar2 = (cv) b15.f345502d;
                        String str12 = cvVar2.f18687o;
                        try {
                            av5 av5 = cvVar2.f18679d;
                            if (av5 == null) {
                                try {
                                    Log.e("MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo", "CgiCheckDemoInfo, appId %s, null wxaapp resp", str9);
                                    pair = Pair.create(4, str12);
                                    i19 = 3;
                                } catch (Exception e16) {
                                    e15 = e16;
                                    str6 = str12;
                                    str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                                    str3 = "rawUrl";
                                    str7 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                                    i18 = 1;
                                    str2 = str11;
                                    str = "webview";
                                    i25 = 2;
                                    str11 = "forceHideShare";
                                    Object[] objArr2 = new Object[i18];
                                    objArr2[0] = str9;
                                    Log.printErrStackTrace(str7, e15, "CgiCheckDemoInfo, appId %s, cast response failed", objArr2);
                                    pair = Pair.create(4, str6);
                                    i16 = 3;
                                    intValue = ((Integer) pair.first).intValue();
                                    String str13 = (String) pair.second;
                                    Object[] objArr3 = new Object[i16];
                                    objArr3[0] = str9;
                                    objArr3[1] = Integer.valueOf(intValue);
                                    objArr3[i25] = Boolean.valueOf(G);
                                    Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr3);
                                    if (intValue >= 0) {
                                    }
                                    aVar = null;
                                    if (aVar == null) {
                                    }
                                    i25 = 0;
                                    z17 = true;
                                    if (i25 == 0) {
                                    }
                                    i15 = this.f91751f;
                                    if (z17 == i15) {
                                    }
                                    if (i15 == 0) {
                                    }
                                }
                            } else {
                                try {
                                    objArr = new Object[5];
                                    objArr[0] = str9;
                                    objArr[1] = Integer.valueOf(av5.f16664d);
                                } catch (Exception e17) {
                                    e15 = e17;
                                    str6 = str12;
                                    str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                                    str3 = "rawUrl";
                                    wxaAttributes4 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                                    str2 = str11;
                                    str = "webview";
                                    i25 = 2;
                                    str11 = "forceHideShare";
                                    wxaAttributes3 = wxaAttributes4;
                                    i18 = 1;
                                    str7 = wxaAttributes3;
                                    Object[] objArr22 = new Object[i18];
                                    objArr22[0] = str9;
                                    Log.printErrStackTrace(str7, e15, "CgiCheckDemoInfo, appId %s, cast response failed", objArr22);
                                    pair = Pair.create(4, str6);
                                    i16 = 3;
                                    intValue = ((Integer) pair.first).intValue();
                                    String str132 = (String) pair.second;
                                    Object[] objArr32 = new Object[i16];
                                    objArr32[0] = str9;
                                    objArr32[1] = Integer.valueOf(intValue);
                                    objArr32[i25] = Boolean.valueOf(G);
                                    Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr32);
                                    if (intValue >= 0) {
                                    }
                                    aVar = null;
                                    if (aVar == null) {
                                    }
                                    i25 = 0;
                                    z17 = true;
                                    if (i25 == 0) {
                                    }
                                    i15 = this.f91751f;
                                    if (z17 == i15) {
                                    }
                                    if (i15 == 0) {
                                    }
                                }
                                try {
                                    objArr[2] = Boolean.valueOf(cvVar2.f18680e);
                                    i19 = 3;
                                    objArr[3] = cvVar2.f18681f;
                                    objArr[4] = cvVar2.f18682g;
                                    Log.i("MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo", "CgiCheckDemoInfo, appId %s, wxa.ErrCode %d, has_new_demo %b, url %s, md5 %s", objArr);
                                    int i27 = cvVar2.f18679d.f16664d;
                                    if (i27 != 0) {
                                        try {
                                            pair = Pair.create(Integer.valueOf(i27), str12);
                                        } catch (Exception e18) {
                                            e15 = e18;
                                            str6 = str12;
                                            str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                                            str3 = "rawUrl";
                                            str7 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                                            i18 = 1;
                                            str2 = str11;
                                            str = "webview";
                                            i25 = 2;
                                            str11 = "forceHideShare";
                                            Object[] objArr222 = new Object[i18];
                                            objArr222[0] = str9;
                                            Log.printErrStackTrace(str7, e15, "CgiCheckDemoInfo, appId %s, cast response failed", objArr222);
                                            pair = Pair.create(4, str6);
                                            i16 = 3;
                                            intValue = ((Integer) pair.first).intValue();
                                            String str1322 = (String) pair.second;
                                            Object[] objArr322 = new Object[i16];
                                            objArr322[0] = str9;
                                            objArr322[1] = Integer.valueOf(intValue);
                                            objArr322[i25] = Boolean.valueOf(G);
                                            Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr322);
                                            if (intValue >= 0) {
                                            }
                                            aVar = null;
                                            if (aVar == null) {
                                            }
                                            i25 = 0;
                                            z17 = true;
                                            if (i25 == 0) {
                                            }
                                            i15 = this.f91751f;
                                            if (z17 == i15) {
                                            }
                                            if (i15 == 0) {
                                            }
                                        }
                                    } else {
                                        if (cvVar2.f18680e) {
                                            try {
                                                if (!Util.isNullOrNil(cvVar2.f18682g)) {
                                                    try {
                                                        String Sa = ((f) r1.dO0(f.class)).Sa(str9, 2);
                                                        Log.i("MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo", "CgiCheckDemoInfo, appId:%s, has_new_demo=TRUE, localDemoVersionMd5:%s", str9, Sa);
                                                        if (!cvVar2.f18682g.equals(Sa)) {
                                                            if (!Util.isNullOrNil(cvVar2.f18681f)) {
                                                                str8 = str12;
                                                                cvVar = cvVar2;
                                                                str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                                                                str3 = "rawUrl";
                                                                wxaAttributes8 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                                                                str2 = str11;
                                                                str = "webview";
                                                                str11 = "forceHideShare";
                                                                i25 = 2;
                                                                try {
                                                                    boolean j15 = r1.XN0().j(str9, 2, cvVar2.f18681f, cvVar2.f18682g, 0, 0);
                                                                    if (j15 && G) {
                                                                        AppBrandProcessesManager.J().t(str9, 2);
                                                                    }
                                                                    if (j15) {
                                                                        d.a(str9, 2);
                                                                        dx0.b bVar2 = (dx0.b) r1.dO0(dx0.b.class);
                                                                        bVar2.getClass();
                                                                        bVar2.Ga(str9, 2, b.AbstractC2266b.a.f203921a);
                                                                    }
                                                                } catch (Exception e19) {
                                                                    e15 = e19;
                                                                    wxaAttributes6 = wxaAttributes8;
                                                                    str6 = str8;
                                                                    wxaAttributes3 = wxaAttributes6;
                                                                    i18 = 1;
                                                                    str7 = wxaAttributes3;
                                                                    Object[] objArr2222 = new Object[i18];
                                                                    objArr2222[0] = str9;
                                                                    Log.printErrStackTrace(str7, e15, "CgiCheckDemoInfo, appId %s, cast response failed", objArr2222);
                                                                    pair = Pair.create(4, str6);
                                                                    i16 = 3;
                                                                    intValue = ((Integer) pair.first).intValue();
                                                                    String str13222 = (String) pair.second;
                                                                    Object[] objArr3222 = new Object[i16];
                                                                    objArr3222[0] = str9;
                                                                    objArr3222[1] = Integer.valueOf(intValue);
                                                                    objArr3222[i25] = Boolean.valueOf(G);
                                                                    Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr3222);
                                                                    if (intValue >= 0) {
                                                                    }
                                                                    aVar = null;
                                                                    if (aVar == null) {
                                                                    }
                                                                    i25 = 0;
                                                                    z17 = true;
                                                                    if (i25 == 0) {
                                                                    }
                                                                    i15 = this.f91751f;
                                                                    if (z17 == i15) {
                                                                    }
                                                                    if (i15 == 0) {
                                                                    }
                                                                }
                                                            } else {
                                                                str8 = str12;
                                                                cvVar = cvVar2;
                                                                str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                                                                i25 = 2;
                                                                str3 = "rawUrl";
                                                                wxaAttributes8 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                                                                str2 = str11;
                                                                str = "webview";
                                                                str11 = "forceHideShare";
                                                            }
                                                            ((j1) r1.dO0(j1.class)).fb(str9, i25, cvVar.f18686n, true);
                                                            ((f) r1.dO0(f.class)).fb(str9, i25, cvVar.f18682g);
                                                            wxaAttributes5 = wxaAttributes8;
                                                        } else {
                                                            str8 = str12;
                                                            str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                                                            i25 = 2;
                                                            str3 = "rawUrl";
                                                            wxaAttributes5 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                                                            str2 = str11;
                                                            str = "webview";
                                                            str11 = "forceHideShare";
                                                            ((j1) r1.dO0(j1.class)).fb(str9, 2, cvVar2.f18686n, false);
                                                        }
                                                        str6 = str8;
                                                        try {
                                                            pair = Pair.create(0, str6);
                                                        } catch (Exception e25) {
                                                            e15 = e25;
                                                            wxaAttributes3 = wxaAttributes5;
                                                            i18 = 1;
                                                            str7 = wxaAttributes3;
                                                            Object[] objArr22222 = new Object[i18];
                                                            objArr22222[0] = str9;
                                                            Log.printErrStackTrace(str7, e15, "CgiCheckDemoInfo, appId %s, cast response failed", objArr22222);
                                                            pair = Pair.create(4, str6);
                                                            i16 = 3;
                                                            intValue = ((Integer) pair.first).intValue();
                                                            String str132222 = (String) pair.second;
                                                            Object[] objArr32222 = new Object[i16];
                                                            objArr32222[0] = str9;
                                                            objArr32222[1] = Integer.valueOf(intValue);
                                                            objArr32222[i25] = Boolean.valueOf(G);
                                                            Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr32222);
                                                            if (intValue >= 0) {
                                                            }
                                                            aVar = null;
                                                            if (aVar == null) {
                                                            }
                                                            i25 = 0;
                                                            z17 = true;
                                                            if (i25 == 0) {
                                                            }
                                                            i15 = this.f91751f;
                                                            if (z17 == i15) {
                                                            }
                                                            if (i15 == 0) {
                                                            }
                                                        }
                                                    } catch (Exception e26) {
                                                        e15 = e26;
                                                        str8 = str12;
                                                        str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                                                        i25 = 2;
                                                        str3 = "rawUrl";
                                                        wxaAttributes7 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                                                        str2 = str11;
                                                        str = "webview";
                                                        str11 = "forceHideShare";
                                                        wxaAttributes6 = wxaAttributes7;
                                                        str6 = str8;
                                                        wxaAttributes3 = wxaAttributes6;
                                                        i18 = 1;
                                                        str7 = wxaAttributes3;
                                                        Object[] objArr222222 = new Object[i18];
                                                        objArr222222[0] = str9;
                                                        Log.printErrStackTrace(str7, e15, "CgiCheckDemoInfo, appId %s, cast response failed", objArr222222);
                                                        pair = Pair.create(4, str6);
                                                        i16 = 3;
                                                        intValue = ((Integer) pair.first).intValue();
                                                        String str1322222 = (String) pair.second;
                                                        Object[] objArr322222 = new Object[i16];
                                                        objArr322222[0] = str9;
                                                        objArr322222[1] = Integer.valueOf(intValue);
                                                        objArr322222[i25] = Boolean.valueOf(G);
                                                        Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr322222);
                                                        if (intValue >= 0) {
                                                        }
                                                        aVar = null;
                                                        if (aVar == null) {
                                                        }
                                                        i25 = 0;
                                                        z17 = true;
                                                        if (i25 == 0) {
                                                        }
                                                        i15 = this.f91751f;
                                                        if (z17 == i15) {
                                                        }
                                                        if (i15 == 0) {
                                                        }
                                                    }
                                                    i16 = 3;
                                                    intValue = ((Integer) pair.first).intValue();
                                                    String str13222222 = (String) pair.second;
                                                    Object[] objArr3222222 = new Object[i16];
                                                    objArr3222222[0] = str9;
                                                    objArr3222222[1] = Integer.valueOf(intValue);
                                                    objArr3222222[i25] = Boolean.valueOf(G);
                                                    Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr3222222);
                                                    if (intValue >= 0) {
                                                        v4.a[] values = v4.a.values();
                                                        int length = values.length;
                                                        int i28 = 0;
                                                        while (true) {
                                                            if (i28 >= length) {
                                                                break;
                                                            }
                                                            aVar = values[i28];
                                                            if (aVar.ordinal() == intValue) {
                                                                break;
                                                            }
                                                            i28++;
                                                        }
                                                        if (aVar == null) {
                                                            if (!G && (ordinal = aVar.ordinal()) != 0) {
                                                                if (ordinal != i25) {
                                                                    k4.a(R.string.f367118kr, this);
                                                                    t.l(str9, 13, 3);
                                                                } else {
                                                                    k4.a(R.string.f367119ks, this);
                                                                    t.l(str9, 13, 3);
                                                                }
                                                            }
                                                            i25 = 1;
                                                        } else if (intValue == -13003) {
                                                            if (d()) {
                                                                if (Util.isNullOrNil(str13222222)) {
                                                                    k4.a(R.string.f367121ku, this);
                                                                } else {
                                                                    sv3.b.j(MMApplicationContext.getContext(), str, str2, new Intent().putExtra(str3, str13222222).putExtra(str11, true), null);
                                                                }
                                                            }
                                                            t.l(str9, 12, 3);
                                                        } else if (intValue != -13002) {
                                                            if (!G) {
                                                                Resources resources = MMApplicationContext.getResources();
                                                                Object[] objArr4 = new Object[i25];
                                                                objArr4[0] = 3;
                                                                objArr4[1] = Integer.valueOf(intValue);
                                                                k4.b(resources.getString(R.string.p_, objArr4), this);
                                                            }
                                                            i25 = 1;
                                                        } else {
                                                            k4.a(R.string.f367120kt, this);
                                                            t.l(str9, 13, 3);
                                                        }
                                                        i25 = 0;
                                                    }
                                                    aVar = null;
                                                    if (aVar == null) {
                                                    }
                                                    i25 = 0;
                                                }
                                            } catch (Exception e27) {
                                                e15 = e27;
                                                str8 = str12;
                                                str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                                                str3 = "rawUrl";
                                                wxaAttributes7 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                                                str2 = str11;
                                                str = "webview";
                                                i25 = 2;
                                                str11 = "forceHideShare";
                                                wxaAttributes6 = wxaAttributes7;
                                                str6 = str8;
                                                wxaAttributes3 = wxaAttributes6;
                                                i18 = 1;
                                                str7 = wxaAttributes3;
                                                Object[] objArr2222222 = new Object[i18];
                                                objArr2222222[0] = str9;
                                                Log.printErrStackTrace(str7, e15, "CgiCheckDemoInfo, appId %s, cast response failed", objArr2222222);
                                                pair = Pair.create(4, str6);
                                                i16 = 3;
                                                intValue = ((Integer) pair.first).intValue();
                                                String str132222222 = (String) pair.second;
                                                Object[] objArr32222222 = new Object[i16];
                                                objArr32222222[0] = str9;
                                                objArr32222222[1] = Integer.valueOf(intValue);
                                                objArr32222222[i25] = Boolean.valueOf(G);
                                                Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr32222222);
                                                if (intValue >= 0) {
                                                }
                                                aVar = null;
                                                if (aVar == null) {
                                                }
                                                i25 = 0;
                                                z17 = true;
                                                if (i25 == 0) {
                                                }
                                                i15 = this.f91751f;
                                                if (z17 == i15) {
                                                }
                                                if (i15 == 0) {
                                                }
                                            }
                                        }
                                        str8 = str12;
                                        str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                                        str3 = "rawUrl";
                                        wxaAttributes5 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                                        str2 = str11;
                                        str = "webview";
                                        i25 = 2;
                                        str11 = "forceHideShare";
                                        try {
                                            str6 = str8;
                                            pair = Pair.create(0, str6);
                                        } catch (Exception e28) {
                                            e15 = e28;
                                            wxaAttributes6 = wxaAttributes5;
                                            str6 = str8;
                                            wxaAttributes3 = wxaAttributes6;
                                            i18 = 1;
                                            str7 = wxaAttributes3;
                                            Object[] objArr22222222 = new Object[i18];
                                            objArr22222222[0] = str9;
                                            Log.printErrStackTrace(str7, e15, "CgiCheckDemoInfo, appId %s, cast response failed", objArr22222222);
                                            pair = Pair.create(4, str6);
                                            i16 = 3;
                                            intValue = ((Integer) pair.first).intValue();
                                            String str1322222222 = (String) pair.second;
                                            Object[] objArr322222222 = new Object[i16];
                                            objArr322222222[0] = str9;
                                            objArr322222222[1] = Integer.valueOf(intValue);
                                            objArr322222222[i25] = Boolean.valueOf(G);
                                            Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr322222222);
                                            if (intValue >= 0) {
                                            }
                                            aVar = null;
                                            if (aVar == null) {
                                            }
                                            i25 = 0;
                                            z17 = true;
                                            if (i25 == 0) {
                                            }
                                            i15 = this.f91751f;
                                            if (z17 == i15) {
                                            }
                                            if (i15 == 0) {
                                            }
                                        }
                                        i16 = 3;
                                        intValue = ((Integer) pair.first).intValue();
                                        String str13222222222 = (String) pair.second;
                                        Object[] objArr3222222222 = new Object[i16];
                                        objArr3222222222[0] = str9;
                                        objArr3222222222[1] = Integer.valueOf(intValue);
                                        objArr3222222222[i25] = Boolean.valueOf(G);
                                        Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr3222222222);
                                        if (intValue >= 0) {
                                        }
                                        aVar = null;
                                        if (aVar == null) {
                                        }
                                        i25 = 0;
                                    }
                                } catch (Exception e29) {
                                    e15 = e29;
                                    str6 = str12;
                                    str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                                    str3 = "rawUrl";
                                    wxaAttributes4 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                                    str2 = str11;
                                    str = "webview";
                                    i25 = 2;
                                    str11 = "forceHideShare";
                                    wxaAttributes3 = wxaAttributes4;
                                    i18 = 1;
                                    str7 = wxaAttributes3;
                                    Object[] objArr222222222 = new Object[i18];
                                    objArr222222222[0] = str9;
                                    Log.printErrStackTrace(str7, e15, "CgiCheckDemoInfo, appId %s, cast response failed", objArr222222222);
                                    pair = Pair.create(4, str6);
                                    i16 = 3;
                                    intValue = ((Integer) pair.first).intValue();
                                    String str132222222222 = (String) pair.second;
                                    Object[] objArr32222222222 = new Object[i16];
                                    objArr32222222222[0] = str9;
                                    objArr32222222222[1] = Integer.valueOf(intValue);
                                    objArr32222222222[i25] = Boolean.valueOf(G);
                                    Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr32222222222);
                                    if (intValue >= 0) {
                                    }
                                    aVar = null;
                                    if (aVar == null) {
                                    }
                                    i25 = 0;
                                    z17 = true;
                                    if (i25 == 0) {
                                    }
                                    i15 = this.f91751f;
                                    if (z17 == i15) {
                                    }
                                    if (i15 == 0) {
                                    }
                                }
                            }
                            str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                            str3 = "rawUrl";
                            str2 = str11;
                            str = "webview";
                            i16 = i19;
                            i25 = 2;
                            str11 = "forceHideShare";
                        } catch (Exception e35) {
                            e15 = e35;
                            str6 = str12;
                            str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                            i25 = 2;
                            str3 = "rawUrl";
                            wxaAttributes4 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                            str2 = str11;
                            str = "webview";
                            str11 = "forceHideShare";
                            wxaAttributes3 = wxaAttributes4;
                            i18 = 1;
                            str7 = wxaAttributes3;
                            Object[] objArr2222222222 = new Object[i18];
                            objArr2222222222[0] = str9;
                            Log.printErrStackTrace(str7, e15, "CgiCheckDemoInfo, appId %s, cast response failed", objArr2222222222);
                            pair = Pair.create(4, str6);
                            i16 = 3;
                            intValue = ((Integer) pair.first).intValue();
                            String str1322222222222 = (String) pair.second;
                            Object[] objArr322222222222 = new Object[i16];
                            objArr322222222222[0] = str9;
                            objArr322222222222[1] = Integer.valueOf(intValue);
                            objArr322222222222[i25] = Boolean.valueOf(G);
                            Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr322222222222);
                            if (intValue >= 0) {
                            }
                            aVar = null;
                            if (aVar == null) {
                            }
                            i25 = 0;
                            z17 = true;
                            if (i25 == 0) {
                            }
                            i15 = this.f91751f;
                            if (z17 == i15) {
                            }
                            if (i15 == 0) {
                            }
                        }
                    } catch (Exception e36) {
                        e15 = e36;
                        str4 = "MicroMsg.AppBrand.PrepareStepOpBan";
                        i25 = 2;
                        str3 = "rawUrl";
                        wxaAttributes3 = "MicroMsg.AppBrand.PrepareStepOpBanCheckDemoInfo";
                        str2 = str11;
                        str = "webview";
                        str11 = "forceHideShare";
                        str6 = null;
                        i18 = 1;
                        str7 = wxaAttributes3;
                        Object[] objArr22222222222 = new Object[i18];
                        objArr22222222222[0] = str9;
                        Log.printErrStackTrace(str7, e15, "CgiCheckDemoInfo, appId %s, cast response failed", objArr22222222222);
                        pair = Pair.create(4, str6);
                        i16 = 3;
                        intValue = ((Integer) pair.first).intValue();
                        String str13222222222222 = (String) pair.second;
                        Object[] objArr3222222222222 = new Object[i16];
                        objArr3222222222222[0] = str9;
                        objArr3222222222222[1] = Integer.valueOf(intValue);
                        objArr3222222222222[i25] = Boolean.valueOf(G);
                        Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr3222222222222);
                        if (intValue >= 0) {
                        }
                        aVar = null;
                        if (aVar == null) {
                        }
                        i25 = 0;
                        z17 = true;
                        if (i25 == 0) {
                        }
                        i15 = this.f91751f;
                        if (z17 == i15) {
                        }
                        if (i15 == 0) {
                        }
                    }
                    intValue = ((Integer) pair.first).intValue();
                    String str132222222222222 = (String) pair.second;
                    Object[] objArr32222222222222 = new Object[i16];
                    objArr32222222222222[0] = str9;
                    objArr32222222222222[1] = Integer.valueOf(intValue);
                    objArr32222222222222[i25] = Boolean.valueOf(G);
                    Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr32222222222222);
                    if (intValue >= 0) {
                    }
                    aVar = null;
                    if (aVar == null) {
                    }
                    i25 = 0;
                }
                Object[] objArr5 = new Object[i17];
                objArr5[c15] = str9;
                objArr5[c16] = Integer.valueOf(i26);
                objArr5[i25] = Integer.valueOf(b15.f345500b);
                i16 = 3;
                objArr5[3] = b15.f345501c;
                Log.e(str5, "CgiCheckDemoInfo, appId %s, errType %d, errCode %d, errMsg %s", objArr5);
                pair = Pair.create(3, null);
                intValue = ((Integer) pair.first).intValue();
                String str1322222222222222 = (String) pair.second;
                Object[] objArr322222222222222 = new Object[i16];
                objArr322222222222222[0] = str9;
                objArr322222222222222[1] = Integer.valueOf(intValue);
                objArr322222222222222[i25] = Boolean.valueOf(G);
                Log.i(str4, "checkDemoInfo, appId %s, ret %d, ignoreCgiError %b", objArr322222222222222);
                if (intValue >= 0) {
                }
                aVar = null;
                if (aVar == null) {
                }
                i25 = 0;
            }
            z17 = true;
            if (i25 == 0) {
                return true;
            }
        } else {
            z17 = true;
        }
        i15 = this.f91751f;
        if (z17 == i15) {
            if (this.f91838r.f91880h != 0) {
                b bVar3 = this.f91839s;
                if (bVar3 != null) {
                    bVar3.a();
                }
                int i29 = this.f91838r.f91880h;
                m.g(str9, "appId");
                return !((Boolean) gk4.h.e(d1.f221178c, new p4(str9, i29, this, null))).booleanValue();
            }
            z17 = true;
        }
        if (i15 == 0) {
            return false;
        }
        ActivityStarterIpcDelegate activityStarterIpcDelegate = this.f91757o;
        if (z17 == wxaAttributes.t2().f85659f) {
            int i35 = AppBrand404PageUI.f95091e;
            AppBrand404PageUI.U7(MMApplicationContext.getContext().getString(R.string.f367216nh), null, activityStarterIpcDelegate);
            wxaAttributes2 = wxaAttributes;
            String str14 = wxaAttributes2.field_appId;
            int i36 = z17 ? 1 : 0;
            int i37 = z17 ? 1 : 0;
            int i38 = z17 ? 1 : 0;
            int i39 = z17 ? 1 : 0;
            int i45 = z17 ? 1 : 0;
            t.l(str14, 14, i36);
            z18 = false;
        } else {
            wxaAttributes2 = wxaAttributes;
            boolean z19 = z17 ? 1 : 0;
            boolean z25 = z17 ? 1 : 0;
            boolean z26 = z17 ? 1 : 0;
            boolean z27 = z17 ? 1 : 0;
            boolean z28 = z17 ? 1 : 0;
            z18 = z19;
        }
        if (z18) {
            return false;
        }
        if (!z15) {
            k.o(wxaAttributes2.field_username);
        }
        return z17;
    }

    public final void b(int i15) {
        try {
            q.INSTANCE.t(369, i15);
        } catch (Throwable th5) {
            Log.e("MicroMsg.AppBrandPreLaunchProcessWC", "reportFallbackIDKey key(%d) get exception %s", Integer.valueOf(i15), th5);
        }
    }

    @Override // com.tencent.mm.plugin.appbrand.launching.a2
    public boolean d() {
        return !this.f91838r.L.h();
    }

    /* JADX WARNING: Code restructure failed: missing block: B:100:0x0262, code lost:
        r2 = r38;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:103:?, code lost:
        com.tencent.mm.sdk.platformtools.Log.e(r6, "prepareStepCheckWxaAttributes() report fallback get exception %s", r0);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:105:0x0272, code lost:
        if (r9.first == null) goto L_0x0274;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:106:0x0274, code lost:
        com.tencent.mm.plugin.appbrand.launching.k4.b(com.tencent.mm.sdk.platformtools.MMApplicationContext.getContext().getString(com.tencent.mm.R.string.f367279p9, r37), r40);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:107:0x0286, code lost:
        r0 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:108:0x0288, code lost:
        r0 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:109:0x0289, code lost:
        r2 = r38;
        r9 = r33;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:110:0x028d, code lost:
        com.tencent.mm.sdk.platformtools.Log.e(r6, "prepareStepCheckWxaAttributes fallback with username[%s] appId[%s], get exception[%s]", r40.f91754i, r40.f91753h, r0);
        com.tencent.mm.plugin.appbrand.launching.k4.b(com.tencent.mm.sdk.platformtools.MMApplicationContext.getContext().getString(com.tencent.mm.R.string.f367279p9, r37), r40);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:42:0x00fc, code lost:
        r0 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:43:0x0105, code lost:
        r0 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:45:0x0111, code lost:
        r0 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:46:0x0112, code lost:
        r38 = r2;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:49:0x011e, code lost:
        r0 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:50:0x011f, code lost:
        r38 = r2;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:75:0x01b9, code lost:
        r5 = com.tencent.mm.plugin.appbrand.launching.e3.f91640a;
        com.tencent.mm.sdk.platformtools.Log.i(r6, r39, r40.f91754i, r40.f91753h);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:77:?, code lost:
        com.tencent.mm.plugin.appbrand.launching.e3.b.b(r40.f91840t, 0);
        r7 = new com.tencent.mm.plugin.appbrand.launching.a3(r40.f91754i, r40.f91753h, r40.f91755j, r0 instanceof com.tencent.mm.plugin.appbrand.launching.u4.a);
        r40.f91837q = r7;
        r9 = r7.d();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:80:?, code lost:
        b(33);
        r5 = (com.tencent.mm.plugin.appbrand.config.WxaAttributes) r9.first;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:81:0x01f0, code lost:
        if (r5 != null) goto L_0x01f2;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:82:0x01f2, code lost:
        r7 = new com.tencent.mm.autogen.mmdata.rpt.WAAppTaskVersionFallBackActionStruct();
        r7.f71255d = r7.b("Appid", r5.field_appId, true);
        r7.f71256e = r7.b("Username", r5.field_username, true);
        r8 = r40.f91756n;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:83:0x020f, code lost:
        if (r8 == null) goto L_0x0211;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:84:0x0211, code lost:
        r10 = 0;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:85:0x0214, code lost:
        r10 = (long) r8.f93944f;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:86:0x0217, code lost:
        r7.f71257f = r10;
        r7.f71258g = 0;
        r7.f71259h = (long) r5.t2().f85657d;
        r7.f71260i = 0;
        r7.f71261j = r2;
        r7.f71262k = r7.b("NetType", com.tencent.mm.plugin.appbrand.report.j0.b(com.tencent.mm.sdk.platformtools.MMApplicationContext.getContext()), true);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:87:0x023d, code lost:
        if ((r0 instanceof com.tencent.mm.plugin.appbrand.launching.u4.b) == false) goto L_0x023f;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:89:0x0243, code lost:
        if (com.tencent.mm.plugin.appbrand.launching.e3.e() != false) goto L_0x0245;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:91:0x0246, code lost:
        r2 = 0;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:92:0x0249, code lost:
        r2 = 1;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:93:0x024b, code lost:
        r7.f71263l = r2;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:94:0x024f, code lost:
        r2 = r38;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:96:?, code lost:
        r7.f71264m = r7.b(r2, r40.f91840t, true);
        r7.n();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:97:0x025c, code lost:
        r0 = th;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:98:0x025e, code lost:
        r0 = th;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:99:0x025f, code lost:
        r2 = r38;
     */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Removed duplicated region for block: B:106:0x0274 A[Catch:{ Exception -> 0x0286 }] */
    /* JADX WARNING: Removed duplicated region for block: B:115:0x02cb  */
    /* JADX WARNING: Removed duplicated region for block: B:128:0x0366  */
    /* JADX WARNING: Removed duplicated region for block: B:43:0x0105 A[ExcHandler: Exception (e java.lang.Exception), Splitter:B:36:0x00c7] */
    /* JADX WARNING: Removed duplicated region for block: B:45:0x0111 A[ExcHandler: Exception (e java.lang.Exception), Splitter:B:30:0x00bf] */
    /* JADX WARNING: Removed duplicated region for block: B:75:0x01b9  */
    public void run() {
        WeAppQualitySystemContactCGIStruct.b bVar;
        Class cls;
        String str;
        Pair<WxaAttributes, Boolean> pair;
        WxaAttributes wxaAttributes;
        int i15;
        WxAppLibServerMode wxAppLibServerMode;
        f3 x15;
        String str2;
        String str3;
        Iterator it;
        int i16;
        WeAppQualitySystemContactCGIStruct.a aVar;
        Pair<WxaAttributes, Boolean> pair2;
        String str4;
        String str5;
        Object obj;
        Pair<WxaAttributes, Boolean> pair3;
        Object e15;
        Exception e16;
        int i17;
        String str6 = "InstanceId";
        WeAppQualitySystemContactCGIStruct.b bVar2 = WeAppQualitySystemContactCGIStruct.b.sync;
        String str7 = "MicroMsg.AppBrandPreLaunchProcessWC";
        Pair<WxaAttributes, Boolean> pair4 = new Pair<>(null, Boolean.FALSE);
        try {
            if (m.a.b(this.f91751f)) {
                if (this.f91836p) {
                    Log.i(str7, "prepareStepCheckWxaAttributes() username[%s] appId[%s] forceUseBackupWxaAttrs[TRUE]", this.f91754i, this.f91753h);
                    b(31);
                    e3.b.b(this.f91840t, 0);
                    a3 a3Var = new a3(this.f91754i, this.f91753h, this.f91755j, false);
                    this.f91837q = a3Var;
                    pair = a3Var.d();
                } else if (e3.b(this.f91754i, this.f91753h)) {
                    Log.i(str7, "prepareStepCheckWxaAttributes() username[%s] appId[%s] checkIfUseBackupWxaAttrsForLaunchDirectly[TRUE]", this.f91754i, this.f91753h);
                    b(32);
                    e3.b.b(this.f91840t, 0);
                    a3 a3Var2 = new a3(this.f91754i, this.f91753h, this.f91755j, false);
                    this.f91837q = a3Var2;
                    pair = a3Var2.d();
                }
                str = "debug_launch_info";
                cls = j1.class;
                bVar = bVar2;
                wxaAttributes = (WxaAttributes) pair.first;
                boolean booleanValue = ((Boolean) pair.second).booleanValue();
                String str8 = "NetworkTypeStr";
                if (wxaAttributes != null) {
                    Log.i(str7, "onGetWxaAttr null return");
                    WeAppQualitySystemContactCGIStruct weAppQualitySystemContactCGIStruct = new WeAppQualitySystemContactCGIStruct();
                    weAppQualitySystemContactCGIStruct.f72103d = weAppQualitySystemContactCGIStruct.b(str6, this.f91840t, true);
                    weAppQualitySystemContactCGIStruct.f72104e = weAppQualitySystemContactCGIStruct.b("AppId", this.f91753h, true);
                    weAppQualitySystemContactCGIStruct.f72105f = (long) this.f91752g;
                    int i18 = this.f91751f + 1;
                    if (i18 == 1) {
                        aVar = WeAppQualitySystemContactCGIStruct.a.release;
                    } else if (i18 != 2) {
                        aVar = i18 != 3 ? null : WeAppQualitySystemContactCGIStruct.a.demo;
                    } else {
                        aVar = WeAppQualitySystemContactCGIStruct.a.debug;
                    }
                    weAppQualitySystemContactCGIStruct.f72106g = aVar;
                    weAppQualitySystemContactCGIStruct.f72107h = 0;
                    weAppQualitySystemContactCGIStruct.f72109j = (long) this.f91756n.f93944f;
                    weAppQualitySystemContactCGIStruct.f72112m = WeAppQualitySystemContactCGIStruct.c.common_fail;
                    weAppQualitySystemContactCGIStruct.f72113n = bVar;
                    weAppQualitySystemContactCGIStruct.f72114o = (long) i.c();
                    weAppQualitySystemContactCGIStruct.f72115p = weAppQualitySystemContactCGIStruct.b("UserName", this.f91754i, true);
                    long a15 = this.f91837q.a();
                    weAppQualitySystemContactCGIStruct.f72110k = a15;
                    weAppQualitySystemContactCGIStruct.e("StartTimeStampMs", a15);
                    long b15 = this.f91837q.b();
                    weAppQualitySystemContactCGIStruct.f72111l = b15;
                    weAppQualitySystemContactCGIStruct.e("EndTimeStampMs", b15);
                    long c15 = this.f91837q.c();
                    weAppQualitySystemContactCGIStruct.f72108i = c15;
                    weAppQualitySystemContactCGIStruct.c("CostTimeMs", c15);
                    weAppQualitySystemContactCGIStruct.f72116q = weAppQualitySystemContactCGIStruct.b(str8, j0.b(MMApplicationContext.getContext()), true);
                    weAppQualitySystemContactCGIStruct.n();
                    l.a aVar2 = this.f91750e;
                    if (aVar2 != null) {
                        aVar2.a(null, null, 2);
                        return;
                    }
                    return;
                } else if (a(wxaAttributes, booleanValue)) {
                    n.b(wxaAttributes.field_appId, KSProcessWeAppLaunch.stepCheckBan);
                    l.a aVar3 = this.f91750e;
                    if (aVar3 != null) {
                        aVar3.a(null, null, 2);
                        return;
                    }
                    return;
                } else {
                    if (!(!m.a.b(this.f91751f) || wxaAttributes.r2() == null || wxaAttributes.r2().f85711v == null)) {
                        String str9 = wxaAttributes.r2().f85711v.f17734d;
                        if (!am4.h.e(str9) && !am4.h.c(str9, wxaAttributes.field_appId) && (this.f91750e instanceof a)) {
                            Log.i(str7, "run with username:%s, appId:%s, instanceId:%s, should migrate to %s", this.f91754i, this.f91753h, this.f91840t, str9);
                            ((a) this.f91750e).b(wxaAttributes.r2().f85692c, str9);
                            return;
                        }
                    }
                    n.e(wxaAttributes.field_appId, KSProcessWeAppLaunch.stepCheckBan);
                    this.f91754i = wxaAttributes.field_username;
                    e eVar = e.f91634a;
                    String str10 = this.f91840t;
                    String str11 = this.f91754i;
                    byte[] bArr = wxaAttributes.s2().f85620a.M;
                    int i19 = this.f91751f;
                    lh4.m.g(str10, "instanceId");
                    lh4.m.g(str11, "userName");
                    lh4.m.g(bArr, "cgiPrefetchTypes");
                    if (bArr.length == 0) {
                        Log.i("MicroMsg.AppBrandCgiPrefetchBeforeLaunch", "prefetch: empty types");
                    }
                    ArrayList arrayList = new ArrayList(bArr.length);
                    int length = bArr.length;
                    int i25 = 0;
                    while (i25 < length) {
                        arrayList.add(Boolean.valueOf(bArr[i25] == 1));
                        i25++;
                        length = length;
                        bArr = bArr;
                    }
                    Iterator it4 = arrayList.iterator();
                    int i26 = 0;
                    while (it4.hasNext()) {
                        Object next = it4.next();
                        int i27 = i26 + 1;
                        if (i26 >= 0) {
                            if (((Boolean) next).booleanValue()) {
                                xc4.t tVar = j.f338034d;
                                it = it4;
                                d dVar = new d(i26, str11, i19);
                                j jVar = (j) tVar;
                                jVar.getClass();
                                str3 = str8;
                                str2 = str7;
                                i16 = i27;
                                c r15 = jVar.r(dVar, 0, null);
                                long elapsedRealtime = SystemClock.elapsedRealtime();
                                lh4.m.f(r15, "future");
                                e.f91635b.add(new f(str10, str11, i19, i26, elapsedRealtime, r15));
                            } else {
                                str3 = str8;
                                str2 = str7;
                                it = it4;
                                i16 = i27;
                            }
                            i26 = i16;
                            it4 = it;
                            str8 = str3;
                            str7 = str2;
                        } else {
                            u.l();
                            throw null;
                        }
                    }
                    AppBrandInitConfigWC e17 = com.tencent.mm.plugin.appbrand.config.d.f().a(wxaAttributes);
                    e17.f85473g = this.f91751f;
                    e17.f55440x0 = this.f91841u;
                    e17.V0 = this.f91842v;
                    e17.f85492v1 = wxaAttributes.r2() != null ? wxaAttributes.r2().f85705p : 0;
                    e17.f85493w1 = wxaAttributes.r2() != null ? wxaAttributes.r2().f85706q : 0;
                    e17.f85494x1 = wxaAttributes.s2().f85620a.H;
                    e17.f85490t1 = this.f91843w;
                    e17.W0 = this.f91844x;
                    LaunchParcel launchParcel = this.f91838r;
                    e17.L = launchParcel.f91889t;
                    e17.N = launchParcel.f91890u;
                    e17.f55442y0 = launchParcel.N;
                    e17.F1 = launchParcel.R;
                    e17.E1 = launchParcel.P;
                    e17.G1 = launchParcel.Q;
                    e17.T0 = hy3.c.b();
                    e17.U0 = ((kd3.i) yz3.j.c(kd3.i.class)).isTeenMode();
                    this.f91753h = e17.f85470d;
                    ((dx0.b) r1.dO0(dx0.b.class)).Sa(e17);
                    e17.f85488r1 = ((jt3.b) z.q(jt3.b.class)).gv0().b("ClientBenchmarkLevel", -1);
                    com.tencent.mm.plugin.appbrand.report.u.a(e17.f85470d, e17.f55436u);
                    e17.f85485o1 = new QualitySession(this.f91840t, e17, this.f91756n);
                    e17.f85485o1.f94274n = !((s) r1.dO0(s.class)).Ga(this.f91754i);
                    e17.l(this.f91840t);
                    if (((Boolean) pair.second).booleanValue()) {
                        e17.f55423b1 = true;
                        WeAppQualitySystemContactCGIStruct a16 = i.a(e17.f85485o1);
                        a16.f72112m = WeAppQualitySystemContactCGIStruct.c.ok;
                        long a17 = this.f91837q.a();
                        a16.f72110k = a17;
                        a16.e("StartTimeStampMs", a17);
                        long b16 = this.f91837q.b();
                        a16.f72111l = b16;
                        a16.e("EndTimeStampMs", b16);
                        long c16 = this.f91837q.c();
                        a16.f72108i = c16;
                        a16.c("CostTimeMs", c16);
                        a16.f72113n = bVar;
                        a16.f72114o = (long) i.c();
                        a16.f72116q = a16.b(str8, j0.b(MMApplicationContext.getContext()), true);
                        a16.n();
                    } else {
                        e17.f55423b1 = false;
                    }
                    if (this.f91751f == 0) {
                        e17.f85474h = wxaAttributes.t2().f85661h;
                    } else {
                        String Ga = ((j1) r1.dO0(cls)).Ga(this.f91753h, this.f91751f);
                        e17.A = Ga;
                        try {
                            JSONObject jSONObject = new JSONObject(Ga);
                            e17.f85474h = jSONObject.optString("device_orientation");
                            e17.B = jSONObject.optBoolean("open_remote", false);
                            e17.M = jSONObject.optString(str, null);
                            WxaAttributes.WxaVersionInfo a18 = f0.a(e17.A);
                            e17.H = a18;
                            if (TextUtils.isEmpty(a18.f85660g) && (x15 = r1.XN0().ea(this.f91753h, this.f91751f, "versionMd5")) != null) {
                                e17.H.f85660g = x15.field_versionMd5;
                            }
                            jSONObject.remove(str);
                            ((j1) r1.dO0(cls)).Sa(this.f91753h, this.f91751f, jSONObject.toString());
                        } catch (Exception e18) {
                            Log.printErrStackTrace(str7, e18, "run() process extInfo with appId[%s] versionType[%d]", this.f91753h, Integer.valueOf(this.f91751f));
                        }
                    }
                    if (this.f91756n == null) {
                        this.f91756n = new AppBrandStatObject();
                    }
                    if (this.f91837q instanceof a3) {
                        e17.f85495y1 = true;
                    }
                    LaunchParcel launchParcel2 = this.f91838r;
                    Parcelable parcelable = launchParcel2.I;
                    if (parcelable != null) {
                        e17.A1 = (WeAppOpenDeclarePromptBundle) parcelable;
                    }
                    AppBrandRuntimeReloadReportBundle appBrandRuntimeReloadReportBundle = launchParcel2.J;
                    if (appBrandRuntimeReloadReportBundle != null) {
                        e17.f55428g1 = appBrandRuntimeReloadReportBundle;
                    }
                    int a19 = vu0.f.a();
                    e17.f55427f1 = a19;
                    if (4 != a19) {
                        i15 = 1;
                        wxAppLibServerMode = new WxAppLibServerMode(true, WxAppLibServerMode.b.Offline);
                    } else {
                        i15 = 1;
                        wxAppLibServerMode = WxAppLibServerMode.f92651f;
                    }
                    e17.f55426e1 = wxAppLibServerMode;
                    AppBrandStatObject appBrandStatObject = this.f91756n;
                    l.a aVar4 = this.f91750e;
                    if (aVar4 != null) {
                        aVar4.a(e17, appBrandStatObject, i15);
                        return;
                    }
                    return;
                }
            }
            AppBrandStatObject appBrandStatObject2 = this.f91756n;
            if (appBrandStatObject2 == null) {
                i17 = 0;
            } else {
                i17 = appBrandStatObject2.f93944f;
            }
            pair3 = pair4;
            try {
                str = "debug_launch_info";
                try {
                    cls = j1.class;
                    try {
                        bVar = bVar2;
                        try {
                            obj = "";
                            str5 = str6;
                        } catch (u4.a | u4.b | TimeoutException e19) {
                            e15 = e19;
                            str5 = str6;
                            str4 = "prepareStepCheckWxaAttributes() username[%s] appId[%s] checkIfUseBackupWxaAttrsForLaunchDirectly[TRUE]";
                            Log.e(str7, "prepareStepCheckWxaAttributes legacy task abort with username[%s] appId[%s] step[%s], by exception:%s", this.f91754i, this.f91753h, this.f91837q.name(), e15);
                            long c17 = this.f91837q.c();
                            if (m.a.b(this.f91751f)) {
                            }
                            str6 = str5;
                            pair2 = pair3;
                            pair = pair2;
                            wxaAttributes = (WxaAttributes) pair.first;
                            boolean booleanValue2 = ((Boolean) pair.second).booleanValue();
                            String str82 = "NetworkTypeStr";
                            if (wxaAttributes != null) {
                            }
                        } catch (Exception e25) {
                        }
                    } catch (u4.a | u4.b | TimeoutException e26) {
                        e15 = e26;
                        str5 = str6;
                        bVar = bVar2;
                        obj = "";
                        str4 = "prepareStepCheckWxaAttributes() username[%s] appId[%s] checkIfUseBackupWxaAttrsForLaunchDirectly[TRUE]";
                        Log.e(str7, "prepareStepCheckWxaAttributes legacy task abort with username[%s] appId[%s] step[%s], by exception:%s", this.f91754i, this.f91753h, this.f91837q.name(), e15);
                        long c172 = this.f91837q.c();
                        if (m.a.b(this.f91751f)) {
                        }
                        str6 = str5;
                        pair2 = pair3;
                        pair = pair2;
                        wxaAttributes = (WxaAttributes) pair.first;
                        boolean booleanValue22 = ((Boolean) pair.second).booleanValue();
                        String str822 = "NetworkTypeStr";
                        if (wxaAttributes != null) {
                        }
                    } catch (Exception e27) {
                        e16 = e27;
                        str5 = str6;
                        bVar = bVar2;
                        Log.printErrStackTrace(str7, e16, "get attr ", new Object[0]);
                        str6 = str5;
                        pair2 = pair3;
                        pair = pair2;
                        wxaAttributes = (WxaAttributes) pair.first;
                        boolean booleanValue222 = ((Boolean) pair.second).booleanValue();
                        String str8222 = "NetworkTypeStr";
                        if (wxaAttributes != null) {
                        }
                    }
                } catch (u4.a | u4.b | TimeoutException e28) {
                    e15 = e28;
                    str5 = str6;
                    cls = j1.class;
                    bVar = bVar2;
                    obj = "";
                    str4 = "prepareStepCheckWxaAttributes() username[%s] appId[%s] checkIfUseBackupWxaAttrsForLaunchDirectly[TRUE]";
                    Log.e(str7, "prepareStepCheckWxaAttributes legacy task abort with username[%s] appId[%s] step[%s], by exception:%s", this.f91754i, this.f91753h, this.f91837q.name(), e15);
                    long c1722 = this.f91837q.c();
                    if (m.a.b(this.f91751f)) {
                    }
                    str6 = str5;
                    pair2 = pair3;
                    pair = pair2;
                    wxaAttributes = (WxaAttributes) pair.first;
                    boolean booleanValue2222 = ((Boolean) pair.second).booleanValue();
                    String str82222 = "NetworkTypeStr";
                    if (wxaAttributes != null) {
                    }
                } catch (Exception e29) {
                    e16 = e29;
                    str5 = str6;
                    cls = j1.class;
                    bVar = bVar2;
                    Log.printErrStackTrace(str7, e16, "get attr ", new Object[0]);
                    str6 = str5;
                    pair2 = pair3;
                    pair = pair2;
                    wxaAttributes = (WxaAttributes) pair.first;
                    boolean booleanValue22222 = ((Boolean) pair.second).booleanValue();
                    String str822222 = "NetworkTypeStr";
                    if (wxaAttributes != null) {
                    }
                }
                try {
                    str4 = "prepareStepCheckWxaAttributes() username[%s] appId[%s] checkIfUseBackupWxaAttrsForLaunchDirectly[TRUE]";
                    u4 u4Var = new u4(this.f91754i, this.f91753h, this.f91751f, this.f91752g, i17, this.f91755j, this.f91756n, this.f91749d, this.f91840t, this.f91843w, 1173 == i17 ? ev0.a.b(this.f91838r.f91889t) : null, this.f91842v, new o(this), this.f91845y);
                    this.f91837q = u4Var;
                    pair2 = (Pair) u4Var.e();
                    str6 = str5;
                } catch (u4.a | u4.b | TimeoutException e35) {
                    e15 = e35;
                    str4 = "prepareStepCheckWxaAttributes() username[%s] appId[%s] checkIfUseBackupWxaAttrsForLaunchDirectly[TRUE]";
                    Log.e(str7, "prepareStepCheckWxaAttributes legacy task abort with username[%s] appId[%s] step[%s], by exception:%s", this.f91754i, this.f91753h, this.f91837q.name(), e15);
                    long c17222 = this.f91837q.c();
                    if (m.a.b(this.f91751f)) {
                    }
                    str6 = str5;
                    pair2 = pair3;
                    pair = pair2;
                    wxaAttributes = (WxaAttributes) pair.first;
                    boolean booleanValue222222 = ((Boolean) pair.second).booleanValue();
                    String str8222222 = "NetworkTypeStr";
                    if (wxaAttributes != null) {
                    }
                } catch (Exception e36) {
                }
            } catch (u4.a | u4.b | TimeoutException e37) {
                e15 = e37;
                str5 = str6;
                str = "debug_launch_info";
                cls = j1.class;
                bVar = bVar2;
                obj = "";
                str4 = "prepareStepCheckWxaAttributes() username[%s] appId[%s] checkIfUseBackupWxaAttrsForLaunchDirectly[TRUE]";
                Log.e(str7, "prepareStepCheckWxaAttributes legacy task abort with username[%s] appId[%s] step[%s], by exception:%s", this.f91754i, this.f91753h, this.f91837q.name(), e15);
                long c172222 = this.f91837q.c();
                if (m.a.b(this.f91751f)) {
                }
                str6 = str5;
                pair2 = pair3;
                pair = pair2;
                wxaAttributes = (WxaAttributes) pair.first;
                boolean booleanValue2222222 = ((Boolean) pair.second).booleanValue();
                String str82222222 = "NetworkTypeStr";
                if (wxaAttributes != null) {
                }
            } catch (Exception e38) {
                e16 = e38;
                str5 = str6;
                str = "debug_launch_info";
                cls = j1.class;
                bVar = bVar2;
                Log.printErrStackTrace(str7, e16, "get attr ", new Object[0]);
                str6 = str5;
                pair2 = pair3;
                pair = pair2;
                wxaAttributes = (WxaAttributes) pair.first;
                boolean booleanValue22222222 = ((Boolean) pair.second).booleanValue();
                String str822222222 = "NetworkTypeStr";
                if (wxaAttributes != null) {
                }
            }
        } catch (u4.a | u4.b | TimeoutException e39) {
            e15 = e39;
            str5 = str6;
            str = "debug_launch_info";
            cls = j1.class;
            bVar = bVar2;
            obj = "";
            str4 = "prepareStepCheckWxaAttributes() username[%s] appId[%s] checkIfUseBackupWxaAttrsForLaunchDirectly[TRUE]";
            pair3 = pair4;
            Log.e(str7, "prepareStepCheckWxaAttributes legacy task abort with username[%s] appId[%s] step[%s], by exception:%s", this.f91754i, this.f91753h, this.f91837q.name(), e15);
            long c1722222 = this.f91837q.c();
            if (m.a.b(this.f91751f)) {
            }
            str6 = str5;
            pair2 = pair3;
            pair = pair2;
            wxaAttributes = (WxaAttributes) pair.first;
            boolean booleanValue222222222 = ((Boolean) pair.second).booleanValue();
            String str8222222222 = "NetworkTypeStr";
            if (wxaAttributes != null) {
            }
        } catch (Exception e45) {
            e16 = e45;
            str5 = str6;
            str = "debug_launch_info";
            cls = j1.class;
            bVar = bVar2;
            pair3 = pair4;
            Log.printErrStackTrace(str7, e16, "get attr ", new Object[0]);
            str6 = str5;
            pair2 = pair3;
            pair = pair2;
            wxaAttributes = (WxaAttributes) pair.first;
            boolean booleanValue2222222222 = ((Boolean) pair.second).booleanValue();
            String str82222222222 = "NetworkTypeStr";
            if (wxaAttributes != null) {
            }
        }
        pair = pair2;
        wxaAttributes = (WxaAttributes) pair.first;
        boolean booleanValue22222222222 = ((Boolean) pair.second).booleanValue();
        String str822222222222 = "NetworkTypeStr";
        if (wxaAttributes != null) {
        }
    }
}