package com.facebook;

import X.0AA;
import X.0AP;
import X.1hK;
import X.7lW;
import X.8gF;
import X.9EH;
import X.C5549M4m;
import X.M12;
import X.M1W;
import X.M1X;
import X.M1Y;
import X.M5M;
import X.M92;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer;
import com.facebook.internal.FacebookDialogFragment;
import com.facebook.login.LoginFragment;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import kotlin.h.b.n;

public class FacebookActivity extends 1hK {
    public static final M1W LIZ = new M1W((byte) 0);
    public static final String LIZJ;
    public Fragment LIZIZ;

    /* JADX WARNING: type inference failed for: r0v0, types: [X.1hK, com.facebook.FacebookActivity, android.app.Activity] */
    public void onDestroy() {
        8gF.LJ(this);
        FacebookActivity.super.onDestroy();
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [X.1hK, com.facebook.FacebookActivity, android.app.Activity] */
    public void onPause() {
        8gF.LIZJ(this);
        FacebookActivity.super.onPause();
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [X.1hK, com.facebook.FacebookActivity, android.app.Activity] */
    public void onResume() {
        8gF.LIZIZ(this);
        FacebookActivity.super.onResume();
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [X.1hK, com.facebook.FacebookActivity, android.app.Activity] */
    public void onStart() {
        8gF.LIZ(this);
        FacebookActivity.super.onStart();
    }

    static {
        Covode.recordClassIndex(40799);
        String name = FacebookActivity.class.getName();
        M12.LIZ((Object) name);
        LIZJ = name;
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [X.1hK, com.facebook.FacebookActivity, android.app.Activity] */
    public void onStop() {
        8gF.LIZLLL(this);
        FacebookActivity.super.onStop();
        if (EnterTransitionCrashOptimizer.getContext() != null) {
            try {
                getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
            } catch (Throwable unused) {
            }
        }
        try {
            getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
        } catch (Throwable unused2) {
        }
    }

    public void onConfigurationChanged(Configuration configuration) {
        M12.LIZ((Object) configuration);
        FacebookActivity.super.onConfigurationChanged(configuration);
        Fragment fragment = this.LIZIZ;
        if (fragment != null) {
            fragment.onConfigurationChanged(configuration);
        }
    }

    /* JADX WARNING: type inference failed for: r5v0, types: [X.1hK, com.facebook.FacebookActivity, android.app.Activity] */
    public void onCreate(Bundle bundle) {
        8gF.LIZ(this, bundle);
        if (!s.LJIIIZ.get()) {
            s.LIZ(9EH.LJJIFFI.LIZ());
        }
        FacebookActivity.super.onCreate(bundle);
        Intent intent = getIntent();
        if (!s.LJIIIZ.get()) {
            Context applicationContext = getApplicationContext();
            if (7lW.LIZJ && applicationContext == null) {
                applicationContext = 7lW.LIZ;
            }
            n.LIZIZ(applicationContext, "");
            s.LIZ(applicationContext);
        }
        setContentView(2131558976);
        if (n.LIZ("PassThrough", intent.getAction())) {
            Intent intent2 = getIntent();
            n.LIZIZ(intent2, "");
            M5M LIZ2 = C5549M4m.LIZ(C5549M4m.LIZIZ(intent2));
            Intent intent3 = getIntent();
            M12.LIZ((Object) intent3);
            setResult(0, C5549M4m.LIZ(intent3, (Bundle) null, LIZ2));
            finish();
            return;
        }
        Intent intent4 = getIntent();
        0AA supportFragmentManager = getSupportFragmentManager();
        M12.LIZ((Object) supportFragmentManager);
        Fragment LIZ3 = supportFragmentManager.LIZ("SingleFragment");
        if (LIZ3 == null) {
            if (n.LIZ("FacebookDialogFragment", intent4.getAction())) {
                LIZ3 = new FacebookDialogFragment();
                LIZ3.setRetainInstance(true);
                LIZ3.show(supportFragmentManager, "SingleFragment");
            } else {
                LIZ3 = new LoginFragment();
                LIZ3.setRetainInstance(true);
                0AP LIZ4 = supportFragmentManager.LIZ();
                LIZ4.LIZ(2131363449, LIZ3, "SingleFragment");
                LIZ4.LIZIZ();
            }
        }
        this.LIZIZ = LIZ3;
    }

    public void dump(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
        Boolean bool;
        if (!M92.LIZ(this)) {
            try {
                M12.LIZ((Object) str, (Object) printWriter);
                M1X m1x = M1Y.LIZIZ;
                if (m1x == null) {
                    bool = null;
                } else {
                    bool = Boolean.valueOf(m1x.LIZ());
                }
                if (!n.LIZ(bool, true)) {
                    FacebookActivity.super.dump(str, fileDescriptor, printWriter, strArr);
                }
            } catch (Throwable th) {
                M92.LIZ(th, this);
            }
        }
    }
}
