package com.ss.android.ugc.aweme.shortvideo.ui;

import X.070;
import X.0AP;
import X.0Bs;
import X.0Bv;
import X.0Bx;
import X.0By;
import X.1hK;
import X.2GD;
import X.2GO;
import X.2HZ;
import X.2OR;
import X.2fU;
import X.2nK;
import X.3G4;
import X.3i8;
import X.542;
import X.56Y;
import X.5Fn;
import X.5gd;
import X.6CS;
import X.6CT;
import X.6EB;
import X.6Hn;
import X.6J4;
import X.6Jy;
import X.6ZS;
import X.6Zq;
import X.6lv;
import X.6ma;
import X.6nl;
import X.6r4;
import X.6xb;
import X.6xi;
import X.6zL;
import X.6zP;
import X.6zd;
import X.71H;
import X.78o;
import X.7he;
import X.7lW;
import X.8gF;
import X.8no;
import X.9HM;
import X.9Y3;
import X.C1045MjQ;
import X.C1629Msq;
import X.C1906MxJ;
import X.C2089N0q;
import X.C2466NFd;
import X.C2498NGj;
import X.C2700NOd;
import X.C2711NOo;
import X.C2719NOw;
import X.C2752NQd;
import X.C2753NQe;
import X.C2757NQi;
import X.C2762NQn;
import X.C2770NQv;
import X.C2961NYe;
import X.C3056Nal;
import X.C3060Nap;
import X.C3091NbK;
import X.C3178Ncj;
import X.C3206NdB;
import X.C3211NdG;
import X.C3218NdN;
import X.C3220NdP;
import X.C3224NdT;
import X.C3226NdV;
import X.C3230NdZ;
import X.C3231Nda;
import X.C3237Ndg;
import X.C3238Ndh;
import X.C3239Ndi;
import X.C3243Ndm;
import X.C3253Ndw;
import X.C3276NeJ;
import X.C3284NeR;
import X.C3678Nkn;
import X.C4087NrO;
import X.C4209NtM;
import X.C4220NtX;
import X.C4568Nz9;
import X.C4742O4r;
import X.C5906Ofd;
import X.C5924Ofv;
import X.CqM;
import X.Crj;
import X.FR3;
import X.FWb;
import X.FcR;
import X.FgP;
import X.FmC;
import X.FmG;
import X.FmK;
import X.FmQ;
import X.Fmi;
import X.FnB;
import X.FnV;
import X.Fnq;
import X.FoK;
import X.Fpn;
import X.FsG;
import X.Hy6;
import X.I12;
import X.I8D;
import X.ISm;
import X.J67;
import X.ME7;
import X.MJK;
import X.MW9;
import X.MWE;
import X.N9L;
import X.NB5;
import X.NBR;
import X.NBS;
import X.NDV;
import X.NED;
import X.NFG;
import X.NG3;
import X.NHB;
import X.NI0;
import X.NIL;
import X.NKD;
import X.NKE;
import X.NNA;
import X.NNW;
import X.NOC;
import X.NPK;
import X.NQJ;
import X.NQV;
import X.O41;
import X.ODZ;
import X.RSB;
import X.Rc9;
import X.T93;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Looper;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.SurfaceView;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import androidx.fragment.app.Fragment;
import com.bytedance.als.ApiCenter;
import com.bytedance.apm.agent.v2.instrumentation.ActivityAgent;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer;
import com.ss.android.ttve.monitor.TEMonitorInvoker;
import com.ss.android.ugc.aweme.adaptation.analysis.Analysis;
import com.ss.android.ugc.aweme.commerce.tools.challenge.CommerceToolsChallengeService;
import com.ss.android.ugc.aweme.commerce.tools.common.CommerceToolsModel;
import com.ss.android.ugc.aweme.commerce.tools.tcm.service.CommerceToolsTcmServiceImpl;
import com.ss.android.ugc.aweme.detail.panel.DuetModeCameraServiceImpl;
import com.ss.android.ugc.aweme.initializer.AVServiceProxyImpl;
import com.ss.android.ugc.aweme.internal.AVCommerceServiceImpl;
import com.ss.android.ugc.aweme.port.internal.IVideoRecordPreferences;
import com.ss.android.ugc.aweme.shortvideo.AVChallenge;
import com.ss.android.ugc.aweme.shortvideo.SafeHandler;
import com.ss.android.ugc.aweme.shortvideo.ShortVideoContext;
import com.ss.android.ugc.aweme.shortvideo.ShortVideoContextViewModel;
import com.ss.android.ugc.aweme.shortvideo.edit.VideoPublishEditModel;
import com.ss.android.ugc.aweme.shortvideo.library.LibraryMaterialInfoSv;
import com.ss.android.ugc.aweme.shortvideo.library.LibraryParams;
import com.ss.android.ugc.aweme.shortvideo.model.GreenScreenMaterial;
import com.ss.android.ugc.aweme.shortvideo.model.MusicModel;
import com.ss.android.ugc.aweme.shortvideo.mvtemplate.choosemedia.an;
import com.ss.android.ugc.aweme.sticker.StickerWrapper;
import com.ss.android.ugc.effectmanager.effect.model.Effect;
import com.ss.android.vesdk.runtime.VEMem;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.ThreadMode;

public class VideoRecordNewActivity extends 6Jy implements C2752NQd, 6zL, C2753NQe, FsG, C2762NQn, NB5, 2HZ, 2GO {
    public final Crj<ApiCenter> LJ = 7he.LIZ(new C3218NdN(this));
    public C4087NrO LJFF;
    public ShortVideoContext LJI;
    public SafeHandler LJII = new SafeHandler(this);
    public C2770NQv LJIIIIZZ;
    public FrameLayout LJIIIZ;
    public SurfaceView LJIIJ;
    public C3056Nal LJIIJJI = null;
    public FrameLayout LJIIL;
    public List<String> LJIILIIL;
    public Effect LJIILJJIL;
    public ArrayList<GreenScreenMaterial> LJIILL = new ArrayList<>();
    public boolean LJIILLIIL;
    public String LJIIZILJ;
    public String LJIJ;
    public NIL LJIJI = new NIL();
    public C2757NQi LJIJJ;
    public an LJIJJLI;
    public Effect LJIL;
    public FrameLayout LJJ;
    public volatile boolean LJJI = true;
    public boolean LJJIFFI;
    public boolean LJJII = false;
    public NQJ LJJIII;
    public String LJJIIJ;
    public ArrayList<StickerWrapper> LJJIIJZLJL = new ArrayList<>();
    public long LJJIIZ;
    public C1906MxJ LJJIIZI;
    public NQV LJJIJ;
    public C2498NGj LJJIJIIJI;
    public C2719NOw LJJIJIIJIL;
    public NI0 LJJIJIL;
    public List<6CT> LJJIJL = new ArrayList();
    public List<6CS> LJJIJLIJ = new ArrayList();
    public FrameLayout LJJIL;
    public C3243Ndm LJJIZ;
    public boolean LJJJ = false;
    public boolean LJJJI = false;
    public int LJJJIL;
    public boolean LJJJJ;
    public boolean LJJJJI;
    public NNA LJJJJIZL;
    public C3224NdT LJJJJJ;
    public final 6lv LJJJJJL = new 6lv();
    public boolean LJJJJL = false;

    static {
        Covode.recordClassIndex(112861);
    }

    public final String LJIIL() {
        return "VideoRecordNewActivity";
    }

    public final boolean cz_() {
        return true;
    }

    public Map<Integer, Object> getSubscriberEventTypes() {
        HashMap hashMap = new HashMap();
        hashMap.put(298, new Rc9(VideoRecordNewActivity.class, "receiveToast", C3220NdP.class, ThreadMode.POSTING, 0, true));
        hashMap.put(299, new Rc9(VideoRecordNewActivity.class, "onEvent", 6Hn.class, ThreadMode.MAIN, 0, false));
        return hashMap;
    }

    public void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity", "onWindowFocusChanged", true);
        VideoRecordNewActivity.super.onWindowFocusChanged(z);
    }

    public final C4087NrO LJIIIZ() {
        return this.LJFF;
    }

    public final FrameLayout LJIIJ() {
        return this.LJJIL;
    }

    public final T93 LJIIZILJ() {
        return this.LJIIIIZZ;
    }

    public final void LIZ(boolean z) {
        C2757NQi nQi = this.LJIJJ;
        if (nQi != null) {
            nQi.LIZ(z);
        }
    }

    public final void LIZ(boolean z, boolean z2) {
        if (z) {
            SurfaceView surfaceView = this.LJIIJ;
            int i = this.LJI.LIZJ.LIZJ;
            int i2 = this.LJI.LIZJ.LIZLLL;
            if (surfaceView != null) {
                Context context = surfaceView.getContext();
                int LJ2 = 3G4.LJ(context);
                int LIZIZ = 3G4.LIZIZ(context);
                FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -1);
                if (LJ2 * 9 < LIZIZ * 16 || i >= i2) {
                    layoutParams.width = LIZIZ;
                    layoutParams.height = (i2 * LIZIZ) / i;
                    layoutParams.topMargin = (LJ2 - layoutParams.height) / 2;
                    layoutParams.topMargin = layoutParams.topMargin >= 0 ? layoutParams.topMargin : 0;
                    layoutParams.leftMargin = 0;
                } else {
                    layoutParams.width = (i * LJ2) / i2;
                    layoutParams.height = LJ2;
                    layoutParams.leftMargin = (LIZIZ - layoutParams.width) / 2;
                    layoutParams.topMargin = 0;
                }
                layoutParams.setMarginStart(layoutParams.leftMargin);
                surfaceView.setLayoutParams(layoutParams);
            }
        }
        if (z2) {
            dP_();
        }
    }

    public final void LIZ(boolean z, MusicModel musicModel, String str) {
        an anVar = this.LJIJJLI;
        if (anVar != null) {
            anVar.LIZ(z, musicModel, str);
        }
    }

    public final void LJI() {
        an anVar = this.LJIJJLI;
        if (anVar != null) {
            anVar.LJJLI = false;
        }
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [android.content.Context, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity] */
    public final int cA_() {
        return 070.LIZJ(this, 2131099762);
    }

    private void LJJIFFI() {
        CommerceToolsChallengeService.LIZ().LIZ(getIntent(), this.LJI);
    }

    public final void LIZLLL() {
        getWindow().setFlags(0, Integer.MIN_VALUE);
    }

    public final boolean LJII() {
        an anVar = this.LJIJJLI;
        if (anVar != null) {
            return anVar.LJJLI;
        }
        return false;
    }

    public final FrameLayout.LayoutParams LJIIJJI() {
        SurfaceView surfaceView = this.LJIIJ;
        if (surfaceView == null) {
            return null;
        }
        return (FrameLayout.LayoutParams) surfaceView.getLayoutParams();
    }

    public final ShortVideoContextViewModel LJIJJ() {
        return LIZ((1hK) this).LIZ(ShortVideoContextViewModel.class);
    }

    public final void LJIJJLI() {
        NQV nqv = this.LJJIJ;
        if (nqv != null) {
            nqv.LIZIZ(false);
        }
    }

    public void onAttachedToWindow() {
        VideoRecordNewActivity.super.onAttachedToWindow();
        if (!this.LJI.LJJLL) {
            LJJI();
        }
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [X.6GL, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity, android.app.Activity] */
    public void onStart() {
        8gF.LIZ(this);
        VideoRecordNewActivity.super.onStart();
        C3678Nkn.LIZ((MWE) new C3211NdG());
    }

    private C1629Msq LJJIII() {
        return ((ApiCenter) this.LJ.getValue()).LIZIZ(C1629Msq.class);
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [android.content.Context, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity] */
    private void LJJIIJZLJL() {
        IVideoRecordPreferences iVideoRecordPreferences = (IVideoRecordPreferences) new 8no((byte) 0).LIZ(this, IVideoRecordPreferences.class);
        if (iVideoRecordPreferences != null && iVideoRecordPreferences.isFirstEnterRecordPage(true)) {
            iVideoRecordPreferences.setFirstEnterRecordPage(false);
        }
    }

    public final O41 LJ() {
        an anVar = this.LJIJJLI;
        if (anVar == null || anVar.LJIILIIL == null) {
            return new O41((MusicModel) null, (String) null);
        }
        return this.LJIJJLI.LJ();
    }

    public final void LJIILIIL() {
        if (!isFinishing() && getIntent().getBooleanExtra("auto_start_recording", false)) {
            this.LJJIJ.LJJI();
        }
    }

    public final NI0 LJIJ() {
        if (this.LJJIJIL == null) {
            this.LJJIJIL = (NI0) this.LJFF.LIZIZ(NI0.class);
        }
        return this.LJJIJIL;
    }

    public final NDV LJIJI() {
        return ((ApiCenter) this.LJ.getValue()).LIZIZ(NDV.class);
    }

    private void LJIL() {
        this.LJJIIZI.LJJIJ().LIZ((I12) new I8D(new 71H(this.LJI.LIZJ.LJII)), this.LJI.LIZJ.LJII.LJ().getAbsolutePath());
        this.LJJIIZI.LJJIIZI();
    }

    private void LJJ() {
        if (6zP.LIZ(this.LJI)) {
            NNA nna = this.LJJJJIZL;
            if (nna != null) {
                nna.LIZIZ();
            }
            NNA nna2 = new NNA(this, this.LJJIIZI.LJJIJ(), LJIJ(), this.LJIIIIZZ, new Fpn(this, this.LJJIIZI), this.LJFF);
            this.LJJJJIZL = nna2;
            nna2.LIZ();
            this.LJJIJ.LIZ(new NNW(this.LJI.LIZJ.LIZIZ));
        }
    }

    private void LJJI() {
        if (this.LJI.LLF == null) {
            if (Build.VERSION.SDK_INT < 28 || getWindow().getDecorView().getRootWindowInsets() != null) {
                this.LJJIIZI.LJJIJ().getMediaController().LIZ(0, J67.LIZ.LIZ((ViewGroup.MarginLayoutParams) this.LJIIJ.getLayoutParams(), getWindow(), this.LJJJJ));
            }
        }
    }

    private boolean LJJIIZ() {
        boolean z;
        if (this.LJI.LJIILLIIL != null) {
            z = true;
        } else {
            z = false;
        }
        if (this.LJI.LJJLL || this.LJI.LJJZ || z || ME7.LIZ()) {
            return false;
        }
        return true;
    }

    public final Analysis LJFF() {
        if (VideoRecordNewActivity.super.LJFF() == null) {
            return VideoRecordNewActivity.super.LJFF();
        }
        HashMap hashMap = new HashMap();
        hashMap.put("creation_id", this.LJI.LJIJ.getCreationId());
        hashMap.put("is_story_shoot", "0");
        Analysis LJFF2 = VideoRecordNewActivity.super.LJFF();
        LJFF2.setExtraMap(hashMap);
        return LJFF2;
    }

    public final void LJIIIIZZ() {
        if (this.LJI != null) {
            dN_().LIZ(this.LJIIJ, this.LJI.LIZJ.LIZJ, this.LJI.LIZJ.LIZLLL);
        }
        C2757NQi nQi = this.LJIJJ;
        if (nQi != null) {
            nQi.LIZIZ();
        }
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [android.content.Context, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity] */
    public final void LJIILLIIL() {
        if (this.LJIIJJI == null) {
            this.LJIIJJI = C3056Nal.LIZ(this, C3060Nap.VISIBLE_AFTER_5S, C3253Ndw.LIZ);
        }
        this.LJIIJJI.setMessage(getString(2131832501));
        this.LJIIJJI.setCancelable(false);
        this.LJIIJJI.setIndeterminate(true);
        LIZ(this.LJIIJJI);
    }

    /* JADX WARNING: type inference failed for: r4v0, types: [android.content.Context, X.Ltg, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity, android.app.Activity] */
    public void onPause() {
        8gF.LIZJ(this);
        VideoRecordNewActivity.super.onPause();
        this.LJJJI = false;
        Hy6.LIZ.LIZIZ();
        56Y.LIZ.pause(this, "record", this.LJI.LJIJI, this.LJI.LJIJ.getCreationId());
        MW9.LIZ("tool_record_enter");
        RSB.LJIILIIL.LIZ().LIZIZ("tool_record");
        VEMem.getInstance().uploadVirtualMemSize(1);
    }

    public final O41 LIZ() {
        an anVar = this.LJIJJLI;
        if (anVar == null || anVar.LJIILIIL == null) {
            return new O41((MusicModel) null, (String) null);
        }
        return this.LJIJJLI.LIZ();
    }

    /* JADX WARNING: type inference failed for: r5v0, types: [X.1oX, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity, android.app.Activity] */
    public final void LJIILL() {
        MethodCollector.i(5321);
        if (isFinishing()) {
            MethodCollector.o(5321);
            return;
        }
        56Y.LIZ.step("av_video_record_init", "addFragment");
        6Zq.LIZ("addFragment PlanC");
        C3243Ndm ndm = this.LJJIZ;
        if (ndm != null) {
            ndm.LIZIZ();
            this.LJJIZ = null;
            ((ViewGroup) findViewById(2131369374)).removeAllViews();
        }
        C2757NQi LIZ = LIZ(getIntent());
        this.LJIJJ = LIZ;
        LIZ.LJFF = new C3178Ncj(this);
        ODZ LIZ2 = C5906Ofd.LIZ((Activity) this, (Class<? extends C5924Ofv>) C2757NQi.class);
        LIZ2.LJ = false;
        LIZ2.LJFF = new C3206NdB(this);
        LIZ2.LIZIZ = false;
        LIZ2.LIZJ = false;
        LIZ2.LIZLLL = 2131369374;
        this.LJJIZ = LIZ2.LIZ();
        MethodCollector.o(5321);
    }

    /* JADX WARNING: type inference failed for: r6v0, types: [X.Ltg, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity, android.app.Activity] */
    public void onStop() {
        8gF.LIZLLL(this);
        VideoRecordNewActivity.super.onStop();
        LJIJJLI();
        C3224NdT ndT = this.LJJJJJ;
        if (!(ndT == null || ndT.LIZ() == -1)) {
            long currentTimeMillis = System.currentTimeMillis() - this.LJJJJJ.LIZ();
            if (currentTimeMillis < 10000) {
                this.LJJJJJL.LIZ("click_close_camera", currentTimeMillis);
            }
            this.LJJJJJ.LIZIZ();
        }
        if (EnterTransitionCrashOptimizer.getContext() != null) {
            try {
                getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
            } catch (Throwable unused) {
            }
        }
        try {
            getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
        } catch (Throwable unused2) {
        }
    }

    /* JADX WARNING: Can't fix incorrect switch cases order */
    /* JADX WARNING: Code restructure failed: missing block: B:14:0x003b, code lost:
        if (r5.equals("reuse_giphy_gif") == false) goto L_0x0020;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:25:0x0066, code lost:
        if (r5.equals("prop_reuse") == false) goto L_0x0020;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:26:0x0069, code lost:
        r6 = "prop_reuse";
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    private void LJJII() {
        /*
            r7 = this;
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r0 = r7.LJI
            java.lang.String r0 = r0.LJIJI
            if (r0 != 0) goto L_0x0007
            return
        L_0x0007:
            java.lang.String r6 = com.ss.android.ugc.aweme.sticker.model.FaceStickerBean.sCurPropSource
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r0 = r7.LJI
            java.lang.String r5 = r0.LJIJI
            r5.hashCode()
            r0 = -1
            int r0 = r5.hashCode()
            java.lang.String r4 = "challenge"
            java.lang.String r3 = "direct_shoot"
            java.lang.String r2 = "single_song"
            java.lang.String r1 = "prop_reuse"
            switch(r0) {
                case -1731750228: goto L_0x006b;
                case -1098262888: goto L_0x0062;
                case 3449699: goto L_0x0056;
                case 3524221: goto L_0x004a;
                case 403708324: goto L_0x003e;
                case 474773721: goto L_0x0035;
                case 669986889: goto L_0x002c;
                case 1402633315: goto L_0x0023;
                default: goto L_0x0020;
            }
        L_0x0020:
            com.ss.android.ugc.aweme.sticker.model.FaceStickerBean.sCurPropSource = r6
            return
        L_0x0023:
            boolean r0 = r5.equals(r4)
            if (r0 != 0) goto L_0x002a
            goto L_0x0020
        L_0x002a:
            r6 = r4
            goto L_0x0020
        L_0x002c:
            boolean r0 = r5.equals(r3)
            if (r0 != 0) goto L_0x0033
            goto L_0x0020
        L_0x0033:
            r6 = r3
            goto L_0x0020
        L_0x0035:
            java.lang.String r0 = "reuse_giphy_gif"
            boolean r0 = r5.equals(r0)
            if (r0 != 0) goto L_0x0069
            goto L_0x0020
        L_0x003e:
            java.lang.String r0 = "share_panel"
            boolean r0 = r5.equals(r0)
            if (r0 != 0) goto L_0x0047
            goto L_0x0020
        L_0x0047:
            java.lang.String r6 = "prop_share_panel"
            goto L_0x0020
        L_0x004a:
            java.lang.String r0 = "scan"
            boolean r0 = r5.equals(r0)
            if (r0 != 0) goto L_0x0053
            goto L_0x0020
        L_0x0053:
            java.lang.String r6 = "qr_code"
            goto L_0x0020
        L_0x0056:
            java.lang.String r0 = "prop"
            boolean r0 = r5.equals(r0)
            if (r0 != 0) goto L_0x005f
            goto L_0x0020
        L_0x005f:
            java.lang.String r6 = "homepage_prop_maker"
            goto L_0x0020
        L_0x0062:
            boolean r0 = r5.equals(r1)
            if (r0 != 0) goto L_0x0069
            goto L_0x0020
        L_0x0069:
            r6 = r1
            goto L_0x0020
        L_0x006b:
            boolean r0 = r5.equals(r2)
            if (r0 != 0) goto L_0x0072
            goto L_0x0020
        L_0x0072:
            r6 = r2
            goto L_0x0020
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity.LJJII():void");
    }

    private void LJJIIJ() {
        ArrayList<GreenScreenMaterial> arrayList;
        56Y.LIZ.step("av_video_record_init", "init stickerModule start");
        C2466NFd nFd = (C2466NFd) this.LJFF.LIZ(C2466NFd.class);
        if (NFG.LIZ("gs_enable_tt_effect_page_filter", this.LJIILJJIL) && 542.LIZIZ(this.LJIILL) && (arrayList = this.LJIILL) != null) {
            ArrayList<NG3> arrayList2 = nFd.LJJJ;
            ArrayList arrayList3 = new ArrayList(9HM.LIZ(arrayList, 10));
            for (GreenScreenMaterial greenScreenMaterial : arrayList) {
                arrayList3.add(new NG3(greenScreenMaterial.getLocalPath(), 0, greenScreenMaterial.getType(), greenScreenMaterial.getResId(), greenScreenMaterial.getAuthorName(), "prop_reuse"));
            }
            arrayList2.addAll(arrayList3);
        }
        nFd.LIZ((NHB) new NHB() {
            static {
                Covode.recordClassIndex(112867);
            }

            public final void LIZIZ() {
                VideoRecordNewActivity.this.LJJIJ.LIZIZ("sticker stop record");
            }

            public final boolean LIZJ() {
                if (VideoRecordNewActivity.this.LJI != null && !542.LIZ(VideoRecordNewActivity.this.LJI.LIZJ.LIZLLL())) {
                    return true;
                }
                return false;
            }

            public final boolean LIZ() {
                if (VideoRecordNewActivity.this.LJIJJ == null || VideoRecordNewActivity.this.LJIJJ.LJJIJIIJI() == null || VideoRecordNewActivity.this.LJJIJ == null) {
                    return true;
                }
                return ((Boolean) VideoRecordNewActivity.this.LJJIJ.LIZJ().LIZ()).booleanValue();
            }
        });
        this.LJJIJ.LJIJ().LIZ(this, new C3231Nda(nFd));
        nFd.LJIJJLI().LIZ((N9L) new N9L() {
            static {
                Covode.recordClassIndex(112866);
            }

            public final void LIZ(NBR nbr) {
                6ZS.LIZ(C4568Nz9.LIZ);
            }

            public final void LIZ(NBS nbs) {
                6ZS.LIZ(C4568Nz9.LIZ, nbs.LIZ.getName());
            }
        });
        List LJFF2 = getSupportFragmentManager().LJFF();
        if (5Fn.LIZIZ(LJFF2)) {
            List<Fragment> LIZ = FcR.LIZ(LJFF2, C3226NdV.LIZ);
            if (5Fn.LIZIZ(LIZ)) {
                0AP LIZ2 = getSupportFragmentManager().LIZ();
                for (Fragment LIZ3 : LIZ) {
                    LIZ2.LIZ(LIZ3);
                }
                LIZ2.LIZJ();
            }
        }
        56Y.LIZ.step("av_video_record_init", "init stickerModule end");
    }

    /* JADX WARNING: type inference failed for: r5v0, types: [X.6Jy, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity, android.app.Activity] */
    public void finish() {
        String LIZ = LIZ(getIntent(), "backurl");
        if (LIZJ(getIntent())) {
            AVServiceProxyImpl.createIAVServiceProxybyMonsterPlugin(false).getMiniAppService().LIZ(getIntent().getSerializableExtra("micro_app_info").getAppId());
        }
        int intExtra = getIntent().getIntExtra("translation_type", 0);
        VideoRecordNewActivity.super.finish();
        if (this.LJIJJ != null) {
            if (Looper.myLooper() == Looper.getMainLooper()) {
                LJIJJLI();
            } else {
                runOnUiThread(new C3230NdZ(this));
            }
        }
        if (!TextUtils.isEmpty(LIZ) && !LIZJ(getIntent()) && !TextUtils.isEmpty(LIZ) && !TextUtils.equals("__BACKURL__", LIZ)) {
            try {
                Uri parse = Uri.parse(LIZ);
                Intent intent = new Intent();
                intent.setData(parse);
                intent.setAction("android.intent.action.VIEW");
                intent.addCategory("android.intent.category.BROWSABLE");
                intent.setComponent((ComponentName) null);
                intent.setSelector((Intent) null);
                startActivityIfNeeded(intent, -1);
                moveTaskToBack(true);
            } catch (Exception unused) {
            }
        }
        if (intExtra == 3) {
            Fnq.LIZIZ(this, 3);
        } else if (intExtra == 7) {
            Fnq.LIZIZ(this, 7);
        } else if (intExtra == 8) {
            Fnq.LIZIZ(this, 8);
        } else if (intExtra == 9) {
            Fnq.LIZIZ(this, 9);
        } else if (intExtra == 5) {
            Fnq.LIZIZ(this, 5);
        }
        6nl.LIZ().LJII();
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [android.content.Context, X.6Jy, java.lang.Object, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity, android.app.Activity] */
    public void onDestroy() {
        8gF.LJ(this);
        VideoRecordNewActivity.super.onDestroy();
        C1045MjQ.LIZ.LIZ();
        C2089N0q.LIZJ.LIZ();
        LJJIIJZLJL();
        NOC.LIZJ.LIZ();
        C4220NtX.LJI.LJIIIIZZ().LIZLLL();
        this.LJIJJ = null;
        EventBus.LIZ().LIZIZ(this);
        Hy6.LIZ.LIZ();
        C4220NtX.LJIILLIIL.LIZJ();
        C4209NtM.LIZIZ();
        FWb.LIZIZ.LIZ().LJIILLIIL().LIZIZ();
        AVCommerceServiceImpl.LJ().LIZIZ();
        56Y.LIZ.leave(this, "record");
        5gd.LIZIZ.LIZ();
        if (!this.LJJJJL) {
            6nl.LIZ().LIZLLL();
            this.LJJJJL = false;
        }
        C3276NeJ.LIZ("normal").LIZ("at_shoot_page");
        ShortVideoContext shortVideoContext = this.LJI;
        if (shortVideoContext != null) {
            CommerceToolsModel commerceToolsModel = shortVideoContext.LIZIZ.getCommerceToolsModel();
            commerceToolsModel.setShowedCommerceTransformButton(false);
            commerceToolsModel.setShowedCommerceTransformBottomButton(false);
        }
    }

    /* JADX WARNING: type inference failed for: r11v0, types: [android.content.Context, X.1hK, X.6GL, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity, android.app.Activity] */
    public void onResume() {
        String str;
        boolean z;
        boolean z2;
        8gF.LIZIZ(this);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity", "onResume", true);
        6Zq.LIZ("VideoRecordNewActivity => onResume start");
        VideoRecordNewActivity.super.onResume();
        if (this.LJI.LJJJJI) {
            CqM.LIZ(new 6EB());
        }
        RSB.LJIILIIL.LIZ().LIZ("tool_record");
        this.LJJJI = true;
        if (this.LJJJ) {
            C4220NtX.LJJIIJZLJL.LIZ(this, C4220NtX.LJJIIJZLJL.LIZ());
            this.LJJJ = false;
        }
        6J4 r7 = new 6J4();
        r7.LIZ("scene", "resume_record");
        r7.LIZ("shoot_way", this.LJI.LJIJI);
        r7.LIZ("creation_id", this.LJI.LJIJ.getCreationId());
        r7.LIZ("enter_from", this.LJI.LJJIFFI);
        r7.LIZ("dalvikPss", Hy6.LIZ.LIZJ);
        r7.LIZ("nativePss", Hy6.LIZ.LIZLLL);
        r7.LIZ("otherPss", Hy6.LIZ.LJFF);
        r7.LIZ("totalPss", Hy6.LIZ.LJ);
        2nK.LIZ("av_memory_log", r7.LIZ);
        6Zq.LIZ("VideoRecordNewActivity => onResume end");
        Hy6.LIZ.LIZ(this, this.LJJIL);
        if (this.LJI != null) {
            C3284NeR LJJIJ2 = this.LJJIIZI.LJJIJ();
            if (this.LJI.LIZJ.LIZ() || this.LJI.LJJ()) {
                z = true;
            } else {
                z = false;
            }
            LJJIJ2.LJ(z);
            C3284NeR LJJIJ3 = this.LJJIIZI.LJJIJ();
            if (this.LJI.LIZJ.LIZ() || this.LJI.LJJ()) {
                z2 = true;
            } else {
                z2 = false;
            }
            LJJIJ3.LJFF(z2);
        }
        boolean LIZ = FR3.LIZ();
        boolean LIZ2 = FnV.LIZ();
        if (LIZ || LIZ2) {
            Fmi.LIZ.LIZ(this, new C3237Ndg(this));
        } else {
            FnB fnB = FnB.LIZ;
            Context applicationContext = getApplicationContext();
            if (7lW.LIZJ && applicationContext == null) {
                applicationContext = 7lW.LIZ;
            }
            if (!fnB.LIZ(applicationContext, true)) {
                FoK.LIZIZ.LIZ(this, new C3238Ndh(this), new C3239Ndi(this));
            }
        }
        VEMem.getInstance().uploadVirtualMemSize(0);
        this.LJJJJJL.LIZ("click_plus", System.currentTimeMillis() - getIntent().getLongExtra("extra_start_record_time", 0), true);
        ShortVideoContext shortVideoContext = this.LJI;
        if (shortVideoContext != null) {
            ArrayList arrayList = new ArrayList();
            arrayList.addAll(NFG.LIZ(shortVideoContext.LJJJLIIL));
            List<String> list = this.LJIILIIL;
            if (list != null) {
                arrayList.addAll(list);
            }
            CommerceToolsModel commerceToolsModel = shortVideoContext.LIZIZ.getCommerceToolsModel();
            if (commerceToolsModel == null || commerceToolsModel.getMission() == null) {
                str = "";
            } else {
                str = commerceToolsModel.getMission().getMissionId();
            }
            CommerceToolsModel commerceToolsModel2 = shortVideoContext.LIZIZ.getCommerceToolsModel();
            AVChallenge aVChallenge = null;
            if (!(commerceToolsModel2 == null || commerceToolsModel2.getRecordChallenge() == null)) {
                aVChallenge = commerceToolsModel2.getRecordChallenge();
            }
            FmQ fmQ = new FmQ(arrayList, str, aVChallenge);
            FmK.LIZ.LIZ(shortVideoContext.LJIJ.getCreationId(), new FmG(FmC.ENTER_RECORD, shortVideoContext, Arrays.asList(new FmQ[]{fmQ})), this);
        }
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity", "onResume", false);
    }

    public static Bundle LIZIZ(Intent intent) {
        try {
            return intent.getExtras();
        } catch (Exception unused) {
            return null;
        }
    }

    public final void LIZJ(6CS r2) {
        this.LJJIJLIJ.remove(r2);
    }

    public static 0Bx LIZ(1hK r2) {
        0Bx LIZ = 0By.LIZ(r2, (0Bv) null);
        if (2GD.LIZ) {
            0Bs.LIZ(LIZ, r2);
        }
        return LIZ;
    }

    private boolean LIZJ(Intent intent) {
        if (intent == null || intent.getSerializableExtra("micro_app_info") == null) {
            return false;
        }
        return true;
    }

    public final void LIZIZ(6CS r2) {
        this.LJJIJLIJ.add(r2);
    }

    public static void LIZ(C3056Nal nal) {
        nal.show();
        2fU.LIZ.LIZ(nal);
    }

    public final void LIZIZ(6CT r2) {
        this.LJJIJL.remove(r2);
    }

    private C2757NQi LIZ(Intent intent) {
        if (intent == null) {
            ShortVideoContext shortVideoContext = this.LJI;
            Intent intent2 = getIntent();
            this.LJJIIZI.LJJIJ();
            return new C2757NQi(shortVideoContext, intent2, this.LJFF, NKD.LIZ);
        }
        ShortVideoContext shortVideoContext2 = this.LJI;
        this.LJJIIZI.LJJIJ();
        return new C2757NQi(shortVideoContext2, intent, this.LJFF, NKE.LIZ);
    }

    public final void LIZIZ(boolean z) {
        this.LJJJJ = z;
        C2757NQi nQi = this.LJIJJ;
        if (nQi != null) {
            nQi.LIZIZ(z);
        }
        LJJI();
    }

    public boolean dispatchTouchEvent(MotionEvent motionEvent) {
        if (motionEvent.getAction() == 0) {
            this.LJJIIZ = System.currentTimeMillis();
            C2961NYe nYe = (C2961NYe) LIZ(C2961NYe.class);
            if (nYe != null) {
                nYe.dismissSuperEntranceEvent();
            }
            C2961NYe nYe2 = (C2961NYe) LIZ(C2961NYe.class);
            if (nYe2 != null) {
                nYe2.dismissUploadPopEntranceEvent();
            }
            C2961NYe nYe3 = (C2961NYe) LIZ(C2961NYe.class);
            if (nYe3 != null) {
                nYe3.dismissLivePopupEvent();
            }
        }
        return VideoRecordNewActivity.super.dispatchTouchEvent(motionEvent);
    }

    public void onConfigurationChanged(Configuration configuration) {
        VideoRecordNewActivity.super.onConfigurationChanged(configuration);
        if (this.LJJJIL != configuration.screenWidthDp) {
            this.LJJJIL = configuration.screenWidthDp;
            dN_().LIZ(this.LJIIJ, this.LJI.LIZJ.LIZJ, this.LJI.LIZJ.LIZLLL);
        }
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [android.content.Context, X.Ltg, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity] */
    public void onSaveInstanceState(Bundle bundle) {
        VideoRecordNewActivity.super.onSaveInstanceState(bundle);
        bundle.remove("android:fragments");
        if (9Y3.LIZ(9Y3.LIZ(), true, "disable_remove_fragment_inrecord_page", true)) {
            bundle.remove("android:support:fragments");
        }
        this.LJJJJL = true;
        bundle.putParcelable("save_state_short_video_context", this.LJI);
        78o r0 = 78o.LJ;
        getIntent();
        r0.LIZ(this, bundle);
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [android.content.Context, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity] */
    @ISm(LIZIZ = true)
    public void receiveToast(C3220NdP ndP) {
        if (TextUtils.equals(ndP.LIZ, "sticker_unlocked")) {
            this.LJJJ = true;
            this.LJIL = ndP.LIZIZ;
            if (this.LJJJI && !ndP.LIZLLL) {
                C4220NtX.LJJIIJZLJL.LIZ(this, C4220NtX.LJJIIJZLJL.LIZ());
                this.LJJJ = false;
            }
            EventBus.LIZ().LJFF(ndP);
        }
    }

    @ISm(LIZ = ThreadMode.MAIN)
    public void onEvent(6Hn r6) {
        C2757NQi nQi;
        if (MJK.LIZ() && this.LJI.LIZJ.LJIIIIZZ() > 0 && this.LJI.LIZJ.LJIIIIZZ() >= this.LJI.LIZJ.LJIIJJI() && (nQi = this.LJIJJ) != null && nQi.LIZ().LIZ(C2700NOd.class) != null && this.LJIJJ.LIZ().LIZ(C2711NOo.class) != null) {
            ((C2700NOd) this.LJIJJ.LIZ().LIZ(C2700NOd.class)).updateBottomTab();
            ((C2711NOo) this.LJIJJ.LIZ().LIZ(C2711NOo.class)).LIZLLL();
        }
        if (r6.LIZ != null) {
            this.LJI.LJJLIIJ.LIZJ = r6.LIZ;
        }
    }

    public final <T> T LIZ(Class<T> cls) {
        C2757NQi nQi = this.LJIJJ;
        if (nQi == null) {
            return null;
        }
        return nQi.LIZ().LIZIZ(cls);
    }

    public final void LIZ(6CS r3) {
        this.LJJIJLIJ.add(0, r3);
    }

    /* JADX WARNING: type inference failed for: r5v0, types: [android.content.Context, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity] */
    private void LIZ(Bundle bundle) {
        List<String> list;
        boolean z;
        boolean z2;
        if (bundle != null) {
            ShortVideoContext parcelable = bundle.getParcelable("save_state_short_video_context");
            this.LJI = parcelable;
            if (!(parcelable == null || parcelable.LJJLIIIJJIZ == null)) {
                6nl.LIZ().LJ();
            }
            StringBuilder sb = new StringBuilder("initData with outState,shortVideoContext is NULL:");
            if (this.LJI == null) {
                z2 = true;
            } else {
                z2 = false;
            }
            sb.append(z2);
            6Zq.LIZ(sb.toString());
        }
        if (this.LJI == null) {
            FWb.LIZIZ.LIZ().LJIL();
            this.LJI = 6xi.LIZ(getIntent(), this);
            StringBuilder sb2 = new StringBuilder("initData with intent,shortVideoContext is NULL:");
            if (this.LJI == null) {
                z = true;
            } else {
                z = false;
            }
            sb2.append(z);
            6Zq.LIZ(sb2.toString());
        }
        if (getIntent().getBooleanExtra("reuse_mvtheme_enter", false)) {
            this.LJI.LJIILLIIL = getIntent().getParcelableExtra("extra_mv_effect");
        }
        this.LJIIZILJ = LIZ(getIntent(), "extra_sticker_from");
        this.LJIJ = LIZ(getIntent(), "grade_key");
        LJJII();
        6nl.LIZ().LJ = this.LJI.LJIJI;
        6xb.LIZ(this.LJI.LJIJ);
        6xb.LIZ(6zd.LJ);
        ShortVideoContextViewModel LJIJJ2 = LJIJJ();
        LJIJJ2.LIZ = this.LJI;
        LJIJJ2.LIZ(this.LJI.LJJLIIIJILLIZJL);
        this.LJIILLIIL = getIntent().getBooleanExtra("sticker_pannel_show", false);
        this.LJIILIIL = getIntent().getStringArrayListExtra("reuse_sticker_ids");
        Effect parcelableExtra = getIntent().getParcelableExtra("first_sticker");
        this.LJIILJJIL = parcelableExtra;
        if (parcelableExtra != null && NFG.LIZ("gs_enable_tt_effect_page_filter", parcelableExtra)) {
            ArrayList<GreenScreenMaterial> parcelableArrayListExtra = getIntent().getParcelableArrayListExtra("green_screen_material_list");
            this.LJIILL = parcelableArrayListExtra;
            this.LJI.LJJ = VideoPublishEditModel.getGiphyGifIds(parcelableArrayListExtra);
        }
        this.LJJIIJ = LIZ(getIntent(), "update_effect_id");
        this.LJJIIJZLJL = getIntent().getParcelableArrayListExtra("update_effect_extra");
        this.LJJJJI = getIntent().getBooleanExtra("draft_music_legal", true);
        if (2OR.LIZ.LIZIZ.getStickerUpdateApp().booleanValue() && "direct_shoot".equals(this.LJI.LJIJI) && this.LJIILJJIL == null && ((list = this.LJIILIIL) == null || list.size() == 0)) {
            String LIZ = C4220NtX.LJIIZILJ.LIZ(this);
            if (!TextUtils.isEmpty(LIZ)) {
                ArrayList arrayList = new ArrayList();
                this.LJIILIIL = arrayList;
                arrayList.add(LIZ);
            }
        }
        if (!TextUtils.isEmpty(LIZ(getIntent(), "star_atlas_object"))) {
            this.LJI.LIZIZ.getCommerceToolsModel().getTcmModel().setOuterTcmOrder(LIZ(getIntent(), "star_atlas_object"));
            this.LJI.LIZIZ.getCommerceToolsModel().getTcmModel().setTcmPreventSelfSee(2);
            CommerceToolsTcmServiceImpl.LJFF().LIZ(this.LJI.LIZIZ.getCommerceToolsModel().getTcmModel());
        } else {
            this.LJI.LIZIZ.getCommerceToolsModel().getTcmModel().setTcmPreventSelfSee(1);
        }
        if (this.LJIILJJIL != null || 542.LIZIZ(this.LJIILIIL)) {
            this.LJI.LIZJ.LJIJ = true;
        } else if (this.LJI.LJJJLZIJ != null) {
            this.LJI.LIZJ.LJIJ = this.LJI.LJJJLZIJ.preSetEffect();
        } else {
            this.LJI.LIZJ.LJIJ = false;
        }
        String LIZ2 = LIZ(getIntent(), "music_origin");
        ShortVideoContext shortVideoContext = this.LJI;
        if (LIZ2 == null) {
            LIZ2 = "original";
        }
        shortVideoContext.LJIIJJI = LIZ2;
        LJJIFFI();
        6r4.LIZJ();
    }

    /* JADX WARNING: type inference failed for: r9v0, types: [android.content.Context, X.1hK, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity, android.app.Activity] */
    public void onNewIntent(Intent intent) {
        C3091NbK LIZ;
        boolean z;
        boolean z2;
        NED ned;
        MethodCollector.i(4979);
        VideoRecordNewActivity.super.onNewIntent(intent);
        6Zq.LIZ("VideoRecordNewActivity onNewIntent");
        78o.LJ.LIZ(this, intent, (Bundle) null);
        if (this.LJI == null || !FgP.LIZ(this)) {
            6Zq.LIZ("close record page because of null shortVideoContext instance when invoking onNewIntent method");
            finish();
            MethodCollector.o(4979);
            return;
        }
        int intExtra = intent.getIntExtra("retake_shoot_mode", -1);
        boolean z3 = true;
        if (intExtra == 1) {
            6xi.LIZ(intent, this.LJI);
            LJIL();
            NPK npk = (NPK) LIZ(NPK.class);
            if (npk != null) {
                npk.LIZ(this.LJI.LJIIZILJ());
                npk.LIZ(0);
            }
            if (this.LJIJJ != null) {
                this.LJJIJ.LJIL();
            }
            this.LJJIJIIJI.LIZ(true);
        } else if (intExtra == 2) {
            6xi.LIZIZ(intent, this.LJI);
            LJIL();
            if (this.LJIJJ != null) {
                if (!this.LJI.LIZJ() || this.LJI.LJJIJIIJI.LIZIZ == null) {
                    LIZ = C3091NbK.LIZ((List<TimeSpeedModelExtension>) this.LJI.LIZJ.LIZLLL(), this.LJI.LIZJ.LJIIIIZZ(), false);
                } else {
                    LIZ = C3091NbK.LIZ((List<TimeSpeedModelExtension>) this.LJI.LIZJ.LIZLLL(), this.LJI.LIZJ.LJIIIIZZ(), this.LJI.LJJIJIIJI.LIZIZ);
                }
                this.LJJIJ.LIZ(LIZ);
                NED LIZIZ = ((ApiCenter) this.LJ.getValue()).LIZIZ(NED.class);
                if (LIZIZ != null) {
                    LIZIZ.changeMusicUi();
                }
            }
            this.LJJIJIIJI.LIZ(false);
        }
        if (this.LJI.LIZJ.LJFF() == null && (ned = (NED) LIZ(NED.class)) != null) {
            ned.handleCancelMusicResultEvent();
        }
        LibraryParams parcelableExtra = intent.getParcelableExtra("library_params");
        LibraryMaterialInfoSv parcelableExtra2 = intent.getParcelableExtra("library_material_info");
        if (!(LJJIII() == null || parcelableExtra == null || parcelableExtra2 == null)) {
            C1629Msq LJJIII2 = LJJIII();
            ShortVideoContext shortVideoContext = this.LJI;
            if (this.LJIJJ != null) {
                z2 = true;
            } else {
                z2 = false;
            }
            LJJIII2.LIZ(shortVideoContext, parcelableExtra, parcelableExtra2, z2);
        }
        LJJIIJZLJL();
        boolean booleanExtra = intent.getBooleanExtra("recreate_record_and_clear", false);
        this.LJIILLIIL = intent.getBooleanExtra("sticker_pannel_show", false);
        boolean booleanExtra2 = intent.getBooleanExtra("enter_record_from_other_platform", false);
        int intExtra2 = intent.getIntExtra("translation_type", 0);
        if (intExtra2 == 3) {
            Fnq.LIZ(this, 3);
        } else if (intExtra2 == 7) {
            Fnq.LIZ(this, 7);
        } else if (intExtra2 == 8) {
            Fnq.LIZ(this, 8);
        } else if (intExtra2 == 9) {
            Fnq.LIZ(this, 9);
        } else if (intExtra2 == 1) {
            Fnq.LIZ(this, 1);
        }
        if (booleanExtra) {
            6Zq.LIZ("VideoRecordNewActivity isClear");
            setIntent(intent);
            C1906MxJ mxJ = this.LJJIIZI;
            if (mxJ != null) {
                mxJ.LIZ(C4742O4r.NORMAL);
            }
            this.LJJIJ.LIZLLL(true);
            TEMonitorInvoker.nativeReset();
            if (LJIJ() != null) {
                LJIJ().LJIILJJIL();
            }
            C4220NtX.LJJII.LJIJI().LIZJ().LIZ();
            LIZ((Bundle) null);
            LJIILL();
        } else if (this.LJI == null) {
            LIZ((Bundle) null);
        }
        ShortVideoContext shortVideoContext2 = this.LJI;
        if (booleanExtra2 || shortVideoContext2.LJJLJ != null) {
            z = true;
        } else {
            z = false;
        }
        shortVideoContext2.LJJLJLI = z;
        if (this.LJIILLIIL && LJIJI() != null) {
            LJIJI().LIZ(true);
        }
        String LIZ2 = LIZ(intent, "enter_from");
        if (!TextUtils.equals(LIZ2, "from_duet_mode") && !TextUtils.equals(LIZ2, "duet_mode_to_normal")) {
            z3 = false;
        }
        if (6ma.LIZ.LJFF().LJII() && z3) {
            setIntent(intent);
            LIZ((Bundle) null);
            6xi.LIZJ(intent, this.LJI);
            if (LIZ2.equals("from_duet_mode")) {
                LJJ();
            }
        }
        if (6ma.LIZ.LJFF().LJII() && TextUtils.equals(LIZ(intent, "enter_from"), "from_duet_mode")) {
            DuetModeCameraServiceImpl.LIZJ().LIZIZ().LIZ(intent);
        }
        MethodCollector.o(4979);
    }

    public final void LIZ(6CT r2) {
        this.LJJIJL.add(r2);
    }

    /* JADX WARNING: type inference failed for: r0v1, types: [android.content.Context, X.0CH, X.6Jy, X.1hK, X.Ltg, X.1oX, java.lang.Object, X.19u, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity, android.app.Activity] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* JADX WARNING: Unknown variable types count: 1 */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public void onCreate(android.os.Bundle r29) {
        /*
            r28 = this;
            r0 = r28
            r0 = r0
            r14 = 5241(0x1479, float:7.344E-42)
            com.bytedance.frameworks.apm.trace.MethodCollector.i(r14)
            r12 = r29
            X.8gF.LIZ(r0, r12)
            java.lang.String r13 = "com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity"
            java.lang.String r11 = "onCreate"
            r3 = 1
            com.bytedance.apm.agent.v2.instrumentation.ActivityAgent.onTrace(r13, r11, r3)
            X.6nl r1 = X.6nl.LIZ()
            r1.LIZLLL()
            X.Ng0 r2 = X.56Y.LIZ
            java.lang.String r1 = "record"
            r2.enter(r0, r1)
            int r5 = X.MFA.LIZIZ()
            int r1 = X.MFA.LIZJ()
            long r1 = (long) r1
            java.lang.String r4 = "tool_record_enter"
            X.MW9.LIZ(r4, r5, r1)
            X.78o r2 = X.78o.LJ
            android.content.Intent r1 = r0.getIntent()
            r2.LIZ(r0, r1, r12)
            r0.LIZ((android.os.Bundle) r12)
            X.FWb r1 = X.FWb.LIZIZ
            X.7CX r1 = r1.LIZ()
            X.6mP r2 = r1.LJIILLIIL()
            java.lang.String r1 = "record_page_create"
            r2.LIZ(r1)
            java.lang.StringBuilder r2 = new java.lang.StringBuilder
            java.lang.String r1 = "VideoRecordNewActivity => onCreate start, creation: "
            r2.<init>(r1)
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r1 = r0.LJI
            com.ss.android.ugc.aweme.creative.CreativeInfo r1 = r1.LJIJ
            java.lang.String r1 = r1.getCreationId()
            r2.append(r1)
            java.lang.String r1 = " shootway: "
            r2.append(r1)
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r1 = r0.LJI
            java.lang.String r1 = r1.LJIJI
            r2.append(r1)
            java.lang.String r1 = r2.toString()
            X.6Zq.LIZ(r1)
            X.Ng0 r2 = X.56Y.LIZ
            java.lang.String r10 = "av_video_record_init"
            java.lang.String r1 = "init recorderModule start"
            r2.step((java.lang.String) r10, (java.lang.String) r1)
            X.78B r1 = X.78B.LJFF
            r1.LIZ(r0)
            X.6nl r1 = X.6nl.LIZ()
            X.OZG r4 = r1.LIZ
            if (r4 == 0) goto L_0x0095
            int r1 = r4.getDuration()
            if (r1 <= 0) goto L_0x0095
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r2 = r0.LJI
            int r1 = r4.getDuration()
            r2.LJIIJ = r1
        L_0x0095:
            X.C4220NtX.LIZLLL()
            X.M12.LIZ(r0)
            X.MUD r1 = X.MUD.LIZ
            X.0PG.LIZ(r0, r1)
            X.NDl r1 = new X.NDl
            r1.<init>(r0)
            X.0PH.LIZ(r0, r1)
            X.0PC r1 = new X.0PC
            com.bytedance.als.AlsLogicContainer r2 = X.0PD.LIZIZ(r0)
            r1.<init>(r2)
            X.0P9 r20 = X.0P9.IMMEDIATE
            X.0PE r2 = new X.0PE
            r2.<init>()
            com.bytedance.als.AlsLogicContainer r15 = r1.LIZ
            java.lang.Class<X.MxJ> r7 = X.C1906MxJ.class
            java.lang.Class<X.NeP> r4 = X.C3282NeP.class
            X.NBZ r6 = r15.LJI
            X.Nd7 r5 = new X.Nd7
            r5.<init>(r2, r0)
            r2 = 0
            r6.LIZ(r4, (java.lang.String) r2, r5)
            r15.LIZ(r7, r4)
            r17 = 0
            r5 = 0
            r19 = 0
            r18 = 0
            r16 = r4
            r15.LIZ(r16, r17, r18, r19, r20)
            X.0P9 r25 = X.0P9.IMMEDIATE
            X.0PE r9 = new X.0PE
            r9.<init>()
            com.bytedance.als.AlsLogicContainer r6 = r1.LIZ
            java.lang.Class<X.NQ0> r8 = X.NQ0.class
            java.lang.Class<X.NRW> r5 = X.NRW.class
            X.NBZ r7 = r6.LJI
            X.NRZ r4 = new X.NRZ
            r4.<init>(r9, r0)
            r7.LIZ(r5, (java.lang.String) r2, r4)
            r6.LIZ(r8, r5)
            r22 = 0
            r23 = 0
            r24 = 0
            r20 = r6
            r21 = r5
            r20.LIZ(r21, r22, r23, r24, r25)
            X.0P9 r25 = X.0P9.IMMEDIATE
            X.0PE r9 = new X.0PE
            r9.<init>()
            com.bytedance.als.AlsLogicContainer r6 = r1.LIZ
            java.lang.Class<X.Mjs> r8 = X.C1073Mjs.class
            java.lang.Class<X.Mjo> r5 = X.C1069Mjo.class
            X.NBZ r7 = r6.LJI
            X.MkG r4 = new X.MkG
            r4.<init>(r9)
            r7.LIZ(r5, (java.lang.String) r2, r4)
            r6.LIZ(r8, r5)
            r22 = 0
            r23 = 0
            r24 = 0
            r20 = r6
            r21 = r5
            r20.LIZ(r21, r22, r23, r24, r25)
            X.0P9 r22 = X.0P9.IMMEDIATE
            X.0PE r9 = new X.0PE
            r9.<init>()
            com.bytedance.als.AlsLogicContainer r7 = r1.LIZ
            java.lang.Class<X.N38> r8 = X.N38.class
            java.lang.Class<X.MnS> r6 = X.C1295MnS.class
            X.NBZ r5 = r7.LJI
            X.MnX r4 = new X.MnX
            r4.<init>(r9)
            r5.LIZ(r6, (java.lang.String) r2, r4)
            r7.LIZ(r8, r6)
            r20 = 0
            r21 = 0
            r17 = r7
            r18 = r6
            r17.LIZ(r18, r19, r20, r21, r22)
            X.0P9 r27 = X.0P9.IMMEDIATE
            X.0PE r9 = new X.0PE
            r9.<init>()
            com.bytedance.als.AlsLogicContainer r6 = r1.LIZ
            java.lang.Class<X.NOw> r8 = X.C2719NOw.class
            java.lang.Class<X.NjA> r5 = X.C3577NjA.class
            X.NBZ r7 = r6.LJI
            X.Mu0 r4 = new X.Mu0
            r4.<init>(r9)
            r7.LIZ(r5, (java.lang.String) r2, r4)
            r6.LIZ(r8, r5)
            r24 = 0
            r25 = 0
            r26 = 0
            r22 = r6
            r23 = r5
            r22.LIZ(r23, r24, r25, r26, r27)
            X.0P9 r22 = X.0P9.IMMEDIATE
            X.0PE r9 = new X.0PE
            r9.<init>()
            com.bytedance.als.AlsLogicContainer r8 = r1.LIZ
            java.lang.Class<X.NI0> r7 = X.NI0.class
            java.lang.Class<X.NFd> r6 = X.C2466NFd.class
            X.NBZ r5 = r8.LJI
            X.N3e r4 = new X.N3e
            r4.<init>(r9)
            r5.LIZ(r6, (java.lang.String) r2, r4)
            r8.LIZ(r7, r6)
            r17 = r8
            r18 = r6
            r17.LIZ(r18, r19, r20, r21, r22)
            X.0P9 r27 = X.0P9.IMMEDIATE
            X.0PE r9 = new X.0PE
            r9.<init>()
            com.bytedance.als.AlsLogicContainer r8 = r1.LIZ
            java.lang.Class<X.N00> r7 = X.N00.class
            java.lang.Class<X.Mzx> r6 = X.C2070Mzx.class
            X.NBZ r5 = r8.LJI
            X.N1o r4 = new X.N1o
            r4.<init>(r9)
            r5.LIZ(r6, (java.lang.String) r2, r4)
            r8.LIZ(r7, r6)
            r22 = r8
            r23 = r6
            r22.LIZ(r23, r24, r25, r26, r27)
            X.0P9 r22 = X.0P9.IMMEDIATE
            X.0PE r9 = new X.0PE
            r9.<init>()
            com.bytedance.als.AlsLogicContainer r8 = r1.LIZ
            java.lang.Class<X.NGj> r7 = X.C2498NGj.class
            java.lang.Class<X.Mzj> r6 = X.C2056Mzj.class
            X.NBZ r5 = r8.LJI
            X.Mzt r4 = new X.Mzt
            r4.<init>(r9)
            r5.LIZ(r6, (java.lang.String) r2, r4)
            r8.LIZ(r7, r6)
            r17 = r8
            r18 = r6
            r17.LIZ(r18, r19, r20, r21, r22)
            X.0P9 r27 = X.0P9.IMMEDIATE
            X.0PE r9 = new X.0PE
            r9.<init>()
            com.bytedance.als.AlsLogicContainer r8 = r1.LIZ
            java.lang.Class<X.N2x> r7 = X.C2148N2x.class
            java.lang.Class<X.N2r> r6 = X.C2142N2r.class
            X.NBZ r5 = r8.LJI
            X.N34 r4 = new X.N34
            r4.<init>(r9)
            r5.LIZ(r6, (java.lang.String) r2, r4)
            r8.LIZ(r7, r6)
            r22 = r8
            r23 = r6
            r22.LIZ(r23, r24, r25, r26, r27)
            X.0P9 r22 = X.0P9.IMMEDIATE
            X.0PE r9 = new X.0PE
            r9.<init>()
            com.bytedance.als.AlsLogicContainer r8 = r1.LIZ
            java.lang.Class<X.NCN> r7 = X.NCN.class
            java.lang.Class<X.NFn> r6 = X.C2476NFn.class
            X.NBZ r5 = r8.LJI
            X.NCb r4 = new X.NCb
            r4.<init>(r9)
            r5.LIZ(r6, (java.lang.String) r2, r4)
            r8.LIZ(r7, r6)
            r17 = r8
            r18 = r6
            r17.LIZ(r18, r19, r20, r21, r22)
            X.0P9 r27 = X.0P9.IMMEDIATE
            X.0PE r9 = new X.0PE
            r9.<init>()
            com.bytedance.als.AlsLogicContainer r8 = r1.LIZ
            java.lang.Class<X.Ml0> r7 = X.C1143Ml0.class
            java.lang.Class<X.Mkz> r6 = X.C1142Mkz.class
            X.NBZ r5 = r8.LJI
            X.Ml2 r4 = new X.Ml2
            r4.<init>(r9)
            r5.LIZ(r6, (java.lang.String) r2, r4)
            r8.LIZ(r7, r6)
            r22 = r8
            r23 = r6
            r22.LIZ(r23, r24, r25, r26, r27)
            r1.LIZ()
            com.bytedance.als.AlsLogicContainer r1 = X.0PD.LIZIZ(r0)
            X.NrO r1 = r1.LJII
            r0.LJFF = r1
            X.5E9 r1 = X.5E9.LIZ
            r1.LIZIZ()
            X.NrO r2 = r0.LJFF
            java.lang.Class<X.MxJ> r1 = X.C1906MxJ.class
            java.lang.Object r1 = r2.LIZ(r1)
            X.MxJ r1 = (X.C1906MxJ) r1
            r0.LJJIIZI = r1
            X.NrO r2 = r0.LJFF
            java.lang.Class<X.NQV> r1 = X.NQV.class
            java.lang.Object r1 = r2.LIZ(r1)
            X.NQV r1 = (X.NQV) r1
            r0.LJJIJ = r1
            X.NrO r2 = r0.LJFF
            java.lang.Class<X.NGj> r1 = X.C2498NGj.class
            java.lang.Object r1 = r2.LIZ(r1)
            X.NGj r1 = (X.C2498NGj) r1
            r0.LJJIJIIJI = r1
            X.MxJ r1 = r0.LJJIIZI
            X.NQv r1 = r1.LJJZ()
            r0.LJIIIIZZ = r1
            X.MxJ r1 = r0.LJJIIZI
            android.view.SurfaceView r1 = r1.LJJIJIIJIL()
            r0.LJIIJ = r1
            X.Muq r2 = new X.Muq
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r1 = r0.LJI
            r2.<init>(r1)
            boolean r6 = r2.LIZ()
            com.ss.android.ugc.aweme.shortvideo.SafeHandler r5 = r0.LJII
            X.NdK r4 = new X.NdK
            r4.<init>(r0)
            r8 = 0
            if (r6 == 0) goto L_0x03c3
            r1 = 2000(0x7d0, double:9.88E-321)
        L_0x0294:
            r5.postDelayed(r4, r1)
            if (r6 == 0) goto L_0x02a0
            X.MxJ r2 = r0.LJJIIZI
            com.bytedance.bpea.basics.PrivacyCert r1 = X.N2V.LIZJ
            r2.LIZ((com.bytedance.bpea.basics.Cert) r1, (boolean) r3)
        L_0x02a0:
            X.MxJ r1 = r0.LJJIIZI
            X.0PM r2 = r1.LJIIIIZZ()
            X.NdE r1 = new X.NdE
            r1.<init>(r0)
            r2.LIZ(r0, r1)
            X.MxJ r2 = r0.LJJIIZI
            X.6s8 r1 = new X.6s8
            r1.<init>()
            r2.LIZ((X.N2Z) r1)
            X.MxJ r1 = r0.LJJIIZI
            X.0PL r2 = r1.LJIJ()
            X.758 r1 = new X.758
            r1.<init>(r0)
            r2.LIZ(r0, r1)
            X.MxJ r1 = r0.LJJIIZI
            X.NeR r4 = r1.LJJIJ()
            X.OJL r2 = new X.OJL
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r1 = r0.LJI
            com.ss.android.ugc.aweme.creative.CreativeInfo r1 = r1.LJIJ
            java.lang.String r1 = r1.getCreationId()
            if (r1 != 0) goto L_0x03b9
            java.lang.String r1 = ""
        L_0x02da:
            r2.<init>(r1)
            r4.setControllerCallback(r2)
            X.NrO r2 = r0.LJFF
            java.lang.Class<X.NOw> r1 = X.C2719NOw.class
            java.lang.Object r1 = r2.LIZ(r1)
            X.NOw r1 = (X.C2719NOw) r1
            r0.LJJIJIIJIL = r1
            r0.LJJ()
            X.NQV r1 = r0.LJJIJ
            X.0PL r2 = r1.LJIILL()
            X.Ndy r1 = new X.Ndy
            r1.<init>(r0)
            r2.LIZ(r0, r1)
            X.Ng0 r2 = X.56Y.LIZ
            java.lang.String r1 = "init recorderModule end"
            r2.step((java.lang.String) r10, (java.lang.String) r1)
            X.7CX r1 = X.C4220NtX.LJJII
            X.6J1 r1 = r1.LJ()
            r1.LJ()
            r4 = 0
            X.6mc.LIZ = r4
            X.Ng0 r1 = X.56Y.LIZ
            r1.step((java.lang.String) r10, (java.lang.String) r11)
            X.NdG r1 = new X.NdG
            r1.<init>()
            X.C3678Nkn.LIZ((X.MWE) r1)
            X.Nks r1 = new X.Nks
            r1.<init>(r0)
            X.C3678Nkn.LIZ((X.MWE) r1)
            X.LFn r1 = new X.LFn
            r1.<init>()
            X.C3678Nkn.LIZ((X.MWE) r1)
            X.FWb r1 = X.FWb.LIZIZ
            r1.LIZ()
            X.6mL r1 = X.6mL.LIZ
            X.MV8.LIZ(r0, r1)
            android.content.Intent r2 = r0.getIntent()
            java.lang.String r1 = "translation_type"
            int r5 = r2.getIntExtra(r1, r4)
            r1 = 3
            r2 = 7
            if (r5 != r1) goto L_0x0396
            X.Fnq.LIZ(r0, r1)
        L_0x0348:
            com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity.super.onCreate(r12)
            com.ss.android.ugc.aweme.framework.services.ServiceManager r6 = com.ss.android.ugc.aweme.framework.services.ServiceManager.get()
            java.lang.Class<com.ss.android.ugc.aweme.service.IToolsOfflineService> r1 = com.ss.android.ugc.aweme.service.IToolsOfflineService.class
            java.lang.Object r1 = r6.getService(r1)
            com.ss.android.ugc.aweme.service.IToolsOfflineService r1 = (com.ss.android.ugc.aweme.service.IToolsOfflineService) r1
            r1.LIZ(r0)
            android.view.Window r6 = r0.getWindow()
            r1 = 128(0x80, float:1.794E-43)
            r6.addFlags(r1)
            r1 = 2131558531(0x7f0d0083, float:1.874238E38)
            r0.setContentView(r1)
            android.content.res.Resources r1 = r0.getResources()
            android.content.res.Configuration r1 = r1.getConfiguration()
            if (r1 == 0) goto L_0x0394
            android.content.res.Resources r1 = r0.getResources()
            android.content.res.Configuration r1 = r1.getConfiguration()
            int r1 = r1.screenWidthDp
        L_0x037d:
            r0.LJJJIL = r1
            boolean r1 = X.FgP.LIZ(r0)
            if (r1 != 0) goto L_0x03c7
            java.lang.String r1 = "RecordConditionCheck.check() false"
            X.6Zq.LIZ(r1)
            r0.finish()
            com.bytedance.apm.agent.v2.instrumentation.ActivityAgent.onTrace(r13, r11, r4)
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r14)
            return
        L_0x0394:
            r1 = 0
            goto L_0x037d
        L_0x0396:
            if (r5 != r3) goto L_0x039c
            X.Fnq.LIZ(r0, r3)
            goto L_0x0348
        L_0x039c:
            r1 = 6
            if (r5 != r1) goto L_0x03a3
            X.Fnq.LIZ(r0, r1)
            goto L_0x0348
        L_0x03a3:
            if (r5 != r2) goto L_0x03a9
            X.Fnq.LIZ(r0, r2)
            goto L_0x0348
        L_0x03a9:
            r1 = 8
            if (r5 != r1) goto L_0x03b1
            X.Fnq.LIZ(r0, r1)
            goto L_0x0348
        L_0x03b1:
            r1 = 9
            if (r5 != r1) goto L_0x0348
            X.Fnq.LIZ(r0, r1)
            goto L_0x0348
        L_0x03b9:
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r1 = r0.LJI
            com.ss.android.ugc.aweme.creative.CreativeInfo r1 = r1.LJIJ
            java.lang.String r1 = r1.getCreationId()
            goto L_0x02da
        L_0x03c3:
            r1 = 0
            goto L_0x0294
        L_0x03c7:
            boolean r1 = X.Ijf.LIZ()
            if (r1 == 0) goto L_0x03cf
            r2 = 15
        L_0x03cf:
            X.IDi.LIZ(r2)
            r1 = 2131369724(0x7f0a1efc, float:1.8359434E38)
            android.view.View r2 = r0.findViewById(r1)
            android.widget.FrameLayout r2 = (android.widget.FrameLayout) r2
            r0.LJJIL = r2
            boolean r1 = r0.LJJJJI
            if (r1 != 0) goto L_0x03e9
            com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity$1 r1 = new com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity$1
            r1.<init>()
            r2.post(r1)
        L_0x03e9:
            r1 = 2131366972(0x7f0a143c, float:1.8353853E38)
            android.view.View r2 = r0.findViewById(r1)
            android.widget.FrameLayout r2 = (android.widget.FrameLayout) r2
            r0.LJIIIZ = r2
            X.MxJ r1 = r0.LJJIIZI
            X.NeR r1 = r1.LJJIJ()
            r2.addView(r1)
            r0.LJJIIJ()
            android.content.Intent r2 = r0.getIntent()
            java.lang.String r1 = "tabs"
            int r2 = r2.getIntExtra(r1, r4)
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r1 = r0.LJI
            r1.LJLIIIL = r2
            X.6ku r1 = new X.6ku
            r1.<init>()
            X.C3678Nkn.LIZ((X.MWE) r1)
            android.content.Intent r1 = r0.getIntent()
            java.lang.String r6 = "extra_qa_origin"
            boolean r1 = r1.hasExtra(r6)
            if (r1 == 0) goto L_0x0431
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r1 = r0.LJI
            com.ss.android.ugc.aweme.shortvideo.model.CreativeFlowData r2 = r1.LIZIZ
            android.content.Intent r1 = r0.getIntent()
            java.lang.String r1 = LIZ((android.content.Intent) r1, (java.lang.String) r6)
            r2.setQaOrigin(r1)
        L_0x0431:
            android.content.Intent r1 = r0.getIntent()
            java.lang.String r6 = "extra_qa_origin_group_id"
            boolean r1 = r1.hasExtra(r6)
            if (r1 == 0) goto L_0x044c
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r1 = r0.LJI
            com.ss.android.ugc.aweme.shortvideo.model.CreativeFlowData r2 = r1.LIZIZ
            android.content.Intent r1 = r0.getIntent()
            java.lang.String r1 = LIZ((android.content.Intent) r1, (java.lang.String) r6)
            r2.setQaOriginGroupId(r1)
        L_0x044c:
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r1 = r0.LJI
            X.6pk.LIZ(r1)
            X.FRf r2 = X.C4220NtX.LIZJ
            java.lang.String r1 = "SHOOT"
            r2.LIZ(r1)
            X.0CD r2 = r0.getLifecycle()
            X.2fs r1 = com.ss.android.ugc.aweme.shortvideo.ui.AudioFocusManager.LIZIZ
            com.ss.android.ugc.aweme.shortvideo.ui.AudioFocusManager r1 = r1.LIZ(r0)
            r2.LIZ(r1)
            r1 = 2131366846(0x7f0a13be, float:1.8353597E38)
            android.view.View r1 = r0.findViewById(r1)
            android.widget.FrameLayout r1 = (android.widget.FrameLayout) r1
            r0.LJJ = r1
            if (r5 != r3) goto L_0x0661
            com.ss.android.ugc.aweme.services.IAVServiceProxy r1 = com.ss.android.ugc.aweme.initializer.AVServiceProxyImpl.createIAVServiceProxybyMonsterPlugin(r4)
            X.6jF r1 = r1.getStoryService()
            boolean r1 = r1.LIZLLL()
            if (r1 == 0) goto L_0x0661
            android.widget.FrameLayout r7 = r0.LJJ
            boolean r1 = r0.LJJIIZ()
            X.M12.LIZ(r0, r7)
            if (r1 == 0) goto L_0x04a7
            X.3G8 r1 = new X.3G8
            r1.<init>(r0)
            X.6Uq r6 = new X.6Uq
            r6.<init>(r1)
            X.04n r5 = new X.04n
            r5.<init>(r0)
            X.C3204Nd9.LIZ = r3
            r2 = 2131558658(0x7f0d0102, float:1.8742638E38)
            X.7M2 r1 = new X.7M2
            r1.<init>(r6, r7)
            r5.LIZ(r2, r7, r1)
        L_0x04a7:
            com.ss.android.ugc.aweme.shortvideo.SafeHandler r2 = r0.LJII
            X.NCU r1 = new X.NCU
            r1.<init>(r0)
            r2.post(r1)
            X.5rv.LJIIJJI = r3
            java.lang.String r1 = "VideoRecordNewActivity => onCreate end"
            X.6Zq.LIZ(r1)
            X.C4209NtM.LIZ()
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r5 = r0.LJI
            android.content.Intent r2 = r0.getIntent()
            java.lang.String r1 = "share_id"
            java.lang.String r1 = LIZ((android.content.Intent) r2, (java.lang.String) r1)
            r5.LJIIIZ = r1
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r5 = r0.LJI
            android.content.Intent r2 = r0.getIntent()
            java.lang.String r1 = "channel"
            java.lang.String r1 = LIZ((android.content.Intent) r2, (java.lang.String) r1)
            r5.LJJIIJZLJL = r1
            android.content.Intent r1 = r0.getIntent()
            java.lang.String r5 = "green_screen_kit_config"
            boolean r1 = r1.hasExtra(r5)
            if (r1 == 0) goto L_0x04f1
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r2 = r0.LJI
            android.content.Intent r1 = r0.getIntent()
            java.io.Serializable r1 = r1.getSerializableExtra(r5)
            X.6E7 r1 = (X.6E7) r1
            r2.LLIIZ = r1
        L_0x04f1:
            android.content.Intent r1 = r0.getIntent()
            java.lang.String r5 = "share_kit_panel"
            boolean r1 = r1.hasExtra(r5)
            if (r1 == 0) goto L_0x050e
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r1 = r0.LJI
            com.ss.android.ugc.aweme.shortvideo.model.CreativeFlowData r2 = r1.LIZIZ
            android.content.Intent r1 = r0.getIntent()
            java.io.Serializable r1 = r1.getSerializableExtra(r5)
            com.ss.android.ugc.aweme.common.ShareKitPanel r1 = (com.ss.android.ugc.aweme.common.ShareKitPanel) r1
            r2.setShareKitPanel(r1)
        L_0x050e:
            boolean r1 = X.6Jc.LIZ()
            if (r1 == 0) goto L_0x051c
            X.6Jm r1 = new X.6Jm
            r1.<init>()
            X.C3678Nkn.LIZ((X.MWE) r1)
        L_0x051c:
            X.Nkq r1 = new X.Nkq
            r1.<init>()
            X.C3678Nkn.LIZ((X.MWE) r1)
            X.MW5 r1 = new X.MW5
            r1.<init>()
            X.C3678Nkn.LIZ((X.MWE) r1)
            X.7M4 r1 = new X.7M4
            r1.<init>(r0)
            X.C3678Nkn.LIZ((X.MWE) r1)
            com.ss.android.ugc.aweme.shortvideo.ui.task.PreloadMediaDataTask r6 = new com.ss.android.ugc.aweme.shortvideo.ui.task.PreloadMediaDataTask
            X.0CD r5 = r0.getLifecycle()
            long r1 = java.lang.System.currentTimeMillis()
            r6.<init>(r5, r0, r1)
            X.C3678Nkn.LIZ((X.MWE) r6)
            com.ss.android.ugc.aweme.shortvideo.ui.task.PreloadMusicListTask r2 = new com.ss.android.ugc.aweme.shortvideo.ui.task.PreloadMusicListTask
            X.0CD r1 = r0.getLifecycle()
            r2.<init>(r1)
            X.C3678Nkn.LIZ((X.MWE) r2)
            X.NgH r1 = new X.NgH
            r1.<init>(r0)
            X.C3678Nkn.LIZ((X.MWE) r1)
            com.ss.android.ugc.aweme.shortvideo.ui.task.CacheChooseMediaViewHolderTask r2 = new com.ss.android.ugc.aweme.shortvideo.ui.task.CacheChooseMediaViewHolderTask
            X.0CD r1 = r0.getLifecycle()
            r2.<init>(r0, r1)
            X.C3678Nkn.LIZ((X.MWE) r2)
            X.5m9 r1 = X.5m9.LIZ
            boolean r1 = r1.LIZ()
            if (r1 != 0) goto L_0x0574
            X.5mA r1 = X.5mA.LIZ
            boolean r1 = r1.LIZ()
            if (r1 == 0) goto L_0x057c
        L_0x0574:
            X.6Jl r1 = new X.6Jl
            r1.<init>()
            X.C3678Nkn.LIZ((X.MWE) r1)
        L_0x057c:
            boolean r1 = X.6Jc.LIZ()
            if (r1 != 0) goto L_0x058a
            X.6Jm r1 = new X.6Jm
            r1.<init>()
            X.C3678Nkn.LIZ((X.MWE) r1)
        L_0x058a:
            X.Ng0 r2 = X.56Y.LIZ
            java.lang.String r1 = "onCreate end"
            r2.step((java.lang.String) r10, (java.lang.String) r1)
            X.MxJ r1 = r0.LJJIIZI
            r1.LJJIL()
            boolean r1 = X.ME7.LIZ()
            if (r1 == 0) goto L_0x05ad
            android.content.Intent r2 = r0.getIntent()
            java.lang.String r1 = "auto_start_recording"
            boolean r1 = r2.getBooleanExtra(r1, r4)
            if (r1 != 0) goto L_0x05ad
            r0.LJIILL()
            r0.LJJI = r4
        L_0x05ad:
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r1 = r0.LJI
            com.ss.android.ugc.aweme.shortvideo.model.CreativeFlowData r1 = r1.LIZIZ
            com.ss.android.ugc.aweme.shortvideo.model.CreativeDurationExtra r7 = r1.getCreativeDurationExtra()
            long r5 = r7.getStartTime()
            int r1 = (r5 > r8 ? 1 : (r5 == r8 ? 0 : -1))
            if (r1 != 0) goto L_0x05c4
            long r1 = java.lang.System.currentTimeMillis()
            r7.setStartTime(r1)
        L_0x05c4:
            java.lang.String r1 = "normal"
            X.6H0 r2 = X.C3276NeJ.LIZ(r1)
            java.lang.String r1 = "at_shoot_page"
            r2.LIZ(r1, r4)
            android.content.Intent r2 = r0.getIntent()
            java.lang.String r1 = "session"
            java.lang.String r7 = LIZ((android.content.Intent) r2, (java.lang.String) r1)
            android.content.Intent r2 = r0.getIntent()
            java.lang.String r1 = "host_uid"
            java.lang.String r6 = LIZ((android.content.Intent) r2, (java.lang.String) r1)
            android.content.Intent r2 = r0.getIntent()
            java.lang.String r1 = "host_name"
            java.lang.String r5 = LIZ((android.content.Intent) r2, (java.lang.String) r1)
            if (r7 == 0) goto L_0x0617
            com.ss.android.ugc.effectmanager.effect.model.Effect r1 = r0.LJIILJJIL
            if (r1 == 0) goto L_0x0617
            X.NI0 r1 = r0.LJIJ()
            X.NLv r2 = r1.LJJIJIL()
            com.ss.android.ugc.effectmanager.effect.model.Effect r1 = r0.LJIILJJIL
            r2.LIZ(r1)
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r1 = r0.LJI
            r1.LIZ(r3)
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r1 = r0.LJI
            com.ss.android.ugc.aweme.sharedar.SharedARModel r1 = r1.LJJJJLI
            if (r1 == 0) goto L_0x0617
            r1.setSharedARSessionId(r7)
            r1.setSharedARMultiPlayerUserName(r5)
            r1.setSharedARMultiPlayerUserId(r6)
            r0.LJIILLIIL()
        L_0x0617:
            X.NI0 r1 = r0.LJIJ()
            X.NLv r1 = r1.LJJIJIL()
            androidx.lifecycle.LiveData r2 = r1.LIZIZ()
            X.NdI r1 = new X.NdI
            r1.<init>(r0)
            r2.observe(r0, r1)
            X.BP4 r1 = X.BP4.LIZ
            com.ss.android.ugc.aweme.poi_api.service.IPoiService r1 = r1.LIZ()
            r1.LIZ(r0)
            X.NtY r1 = X.6ma.LIZ
            X.NGr r1 = r1.LJFF()
            boolean r1 = r1.LJII()
            if (r1 == 0) goto L_0x064c
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContextViewModel r1 = r0.LJIJJ()
            com.ss.android.ugc.aweme.shortvideo.ShortVideoContext r2 = r1.LIZ
            android.content.Intent r1 = r0.getIntent()
            r2.LJJJJZ = r1
        L_0x064c:
            X.NDP r2 = X.NDP.LIZ
            android.app.Application r1 = X.74z.LIZ
            r2.LIZ(r1)
            com.ss.android.ugc.aweme.commerce.tools.common.scene.ICommerceToolsSceneService r1 = com.ss.android.ugc.aweme.commerce.tools.common.scene.CommerceToolsSceneServiceImpl.LIZIZ()
            r1.LIZ(r0)
            com.bytedance.apm.agent.v2.instrumentation.ActivityAgent.onTrace(r13, r11, r4)
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r14)
            return
        L_0x0661:
            android.widget.FrameLayout r5 = r0.LJJ
            boolean r2 = r0.LJJIIZ()
            com.ss.android.ugc.aweme.services.IAVServiceProxy r1 = com.ss.android.ugc.aweme.initializer.AVServiceProxyImpl.createIAVServiceProxybyMonsterPlugin(r4)
            X.6jF r1 = r1.getStoryService()
            boolean r1 = r1.LIZLLL()
            r1 = r1 ^ r3
            X.C3204Nd9.LIZ(r0, r5, r2, r1)
            goto L_0x04a7
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity.onCreate(android.os.Bundle):void");
    }

    public static String LIZ(Intent intent, String str) {
        try {
            return intent.getStringExtra(str);
        } catch (Exception unused) {
            return null;
        }
    }

    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        for (6CS onKeyDown : this.LJJIJLIJ) {
            if (onKeyDown.onKeyDown(i, keyEvent)) {
                return true;
            }
        }
        if (i != 4) {
            return VideoRecordNewActivity.super.onKeyDown(i, keyEvent);
        }
        if (this.LJIJJ != null) {
            NQV nqv = this.LJJIJ;
            if (nqv != null && !((Boolean) nqv.LIZJ().LIZ()).booleanValue()) {
                return true;
            }
            C3243Ndm ndm = this.LJJIZ;
            if (ndm != null && ndm.LIZ()) {
                return true;
            }
            C3224NdT ndT = (C3224NdT) this.LJIJJ.LIZ().LIZIZ(C3224NdT.class);
            this.LJJJJJ = ndT;
            if (ndT != null) {
                ndT.LIZ("system_back_button", System.currentTimeMillis());
            }
            return true;
        } else if (getIntent().hasExtra("stitch_params")) {
            return true;
        } else {
            return VideoRecordNewActivity.super.onKeyDown(i, keyEvent);
        }
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [android.content.Context, X.1hK, java.lang.Object, com.ss.android.ugc.aweme.shortvideo.ui.VideoRecordNewActivity] */
    public void onActivityResult(int i, int i2, Intent intent) {
        boolean z;
        for (6CT LIZ : this.LJJIJL) {
            if (LIZ.LIZ(i, i2, intent)) {
                return;
            }
        }
        VideoRecordNewActivity.super.onActivityResult(i, i2, intent);
        if (i == 1002 && i2 == -1) {
            ShortVideoContext shortVideoContext = this.LJI;
            if (shortVideoContext == null || shortVideoContext.LJJLJ == null) {
                z = false;
            } else {
                z = true;
            }
            if (!(intent == null || LIZIZ(intent) == null || z)) {
                Intent intent2 = new Intent();
                intent2.setClass(this, C4220NtX.LIZJ.LJ());
                intent2.addFlags(67108864);
                intent2.putExtras(LIZIZ(intent));
                3i8.LIZ(intent2, this);
                startActivity(intent2);
            }
            finish();
        }
    }
}
