package com.ss.android.ugc.aweme.deeplink;

import X.8gF;
import X.C32923fI;
import X.C33373g1;
import X.C33433g7;
import X.RyP;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import com.bytedance.apm.agent.v2.instrumentation.ActivityAgent;
import com.bytedance.covode.number.Covode;
import com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer;
import com.ss.android.ugc.aweme.AccountService;

public final class RequireLoginActivity extends Activity {
    public static final C32923fI LIZLLL = new C32923fI((byte) 0);
    public String LIZ;
    public Intent LIZIZ;
    public boolean LIZJ;
    public final RyP LJ = new C33433g7(this);

    static {
        Covode.recordClassIndex(63395);
    }

    public final void onDestroy() {
        8gF.LJ(this);
        super.onDestroy();
    }

    public final void onResume() {
        8gF.LIZIZ(this);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.deeplink.RequireLoginActivity", "onResume", true);
        super.onResume();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.deeplink.RequireLoginActivity", "onResume", false);
    }

    public final void onStart() {
        8gF.LIZ(this);
        super.onStart();
    }

    public final void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.deeplink.RequireLoginActivity", "onWindowFocusChanged", true);
        super.onWindowFocusChanged(z);
    }

    public final void onPause() {
        8gF.LIZJ(this);
        super.onPause();
        overridePendingTransition(0, 0);
    }

    public final void onStop() {
        8gF.LIZLLL(this);
        super.onStop();
        if (EnterTransitionCrashOptimizer.getContext() != null) {
            try {
                getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
            } catch (Throwable unused) {
            }
        }
        try {
            getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
        } catch (Throwable unused2) {
        }
    }

    public final void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        LIZ(intent);
    }

    private final void LIZ(Intent intent) {
        Intent intent2;
        String str = null;
        if (intent != null) {
            str = LIZ(intent, "enter_from");
        }
        this.LIZ = str;
        boolean z = false;
        if (intent != null) {
            z = intent.getBooleanExtra("is_new_procedure", false);
        }
        this.LIZJ = z;
        if (intent != null && (intent2 = (Intent) intent.getParcelableExtra("deep_link_intent")) != null) {
            this.LIZIZ = intent2;
        }
    }

    public final void onCreate(Bundle bundle) {
        8gF.LIZ(this, bundle);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.deeplink.RequireLoginActivity", "onCreate", true);
        super.onCreate(bundle);
        LIZ(getIntent());
        Bundle bundle2 = new Bundle();
        bundle2.putBoolean("is_fullscreen_dialog", true);
        bundle2.putBoolean("is_skippable_dialog", false);
        bundle2.putBoolean("need_callback", true);
        C33373g1 r2 = new C33373g1();
        r2.LIZIZ = "deeplink";
        r2.LIZ = this;
        r2.LJ = this.LJ;
        r2.LIZLLL = bundle2;
        AccountService.LIZ().LJII().showLoginAndRegisterView(r2.LIZ());
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.deeplink.RequireLoginActivity", "onCreate", false);
    }

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