package com.ss.android.ugc.aweme.account.main;

import X.1hK;
import X.BDc;
import X.C15482sG;
import X.C33443g8;
import X.C33463gA;
import X.C33553gJ;
import X.C33563gK;
import X.C49124Cy;
import X.EMX;
import X.EnQ;
import X.Mk2;
import X.Mk3;
import X.PgU;
import X.PhE;
import X.PlI;
import android.content.Intent;
import android.os.Bundle;
import android.os.SystemClock;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.base.MainBusinessAbility;
import com.ss.android.ugc.aweme.services.MandatoryLoginService;
import kotlin.h.b.n;

public final class LoginAndConsentAssem extends EnQ {
    public static final C33563gK LJII = new C33563gK((byte) 0);
    public 1hK LJFF;
    public boolean LJI;
    public boolean LJIIIIZZ;
    public int LJIIIZ = -1;

    static {
        Covode.recordClassIndex(52010);
    }

    public final void LJIJI() {
        LIZ(false);
    }

    public final void cX_() {
        LoginAndConsentAssem.super.cX_();
        1hK LIZIZ = BDc.LIZIZ(this);
        if (LIZIZ != null) {
            this.LJFF = LIZIZ;
            return;
        }
        throw new IllegalArgumentException("LoginAndConsentAssem should be attach to MainActivity.".toString());
    }

    public static final /* synthetic */ 1hK LIZ(LoginAndConsentAssem loginAndConsentAssem) {
        1hK r1 = loginAndConsentAssem.LJFF;
        if (r1 == null) {
            n.LIZ("");
        }
        return r1;
    }

    public final void LIZ(boolean z) {
        C15482sG r2 = new C15482sG();
        r2.element = null;
        r2.element = PgU.LIZIZ(MandatoryLoginService.createIMandatoryLoginServicebyMonsterPlugin(false)).LIZIZ(PhE.LIZIZ(PlI.LIZJ)).LIZ(Mk2.LIZ(Mk3.LIZ)).LIZLLL(new C33443g8(this, z, r2));
    }

    public final void LIZ(Bundle bundle) {
        boolean z;
        long uptimeMillis = SystemClock.uptimeMillis();
        LoginAndConsentAssem.super.LIZ(bundle);
        1hK r0 = this.LJFF;
        if (r0 == null) {
            n.LIZ("");
        }
        this.LJIIIIZZ = r0.getIntent().getBooleanExtra("restart_from_logout", false);
        1hK r02 = this.LJFF;
        if (r02 == null) {
            n.LIZ("");
        }
        Intent intent = r02.getIntent();
        if (intent == null || !intent.getBooleanExtra("from_require_login", false)) {
            z = false;
        } else {
            z = true;
        }
        1hK r03 = this.LJFF;
        if (r03 == null) {
            n.LIZ("");
        }
        this.LJIIIZ = r03.getIntent().getIntExtra("page_type", -1);
        boolean LJ = EMX.LIZJ(EMX.LIZ(this), MainBusinessAbility.class).LJ();
        boolean z2 = this.LJIIIIZZ;
        int i = this.LJIIIZ;
        C15482sG r2 = new C15482sG();
        r2.element = null;
        r2.element = PgU.LIZJ(new C33463gA(this, LJ, z, z2, i)).LIZIZ(PhE.LIZIZ(PlI.LIZJ)).LIZLLL(new C33553gJ(r2));
        MandatoryLoginService.createIMandatoryLoginServicebyMonsterPlugin(false).setupUnregisteredModeListener();
        C49124Cy.LIZ(getClass().getCanonicalName(), SystemClock.uptimeMillis() - uptimeMillis, "ON_CREATE_WITH_BUNDLE", (String) null);
    }
}
