package com.bytedance.android.live;

import X.AnonymousClass0AA;
import X.AnonymousClass0AP;
import X.C09630aP;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import java.lang.reflect.Field;

public class BaseDialogFragmentV2 extends DialogFragment {
    static {
        Covode.recordClassIndex(4686);
    }

    public void dismiss() {
        if (getFragmentManager() == null) {
            C09630aP.LIZ(3, "BaseDialogFragmentV2", "dismiss:${this} not associate with a fragment manager");
        } else {
            super.dismiss();
        }
    }

    public void dismissAllowingStateLoss() {
        if (getFragmentManager() == null) {
            C09630aP.LIZ(3, "BaseDialogFragmentV2", "dismissAllowingStateLoss:${this} not associate with a fragment manager");
        } else {
            super.dismissAllowingStateLoss();
        }
    }

    private void LIZ(String str, Object obj) {
        try {
            Field declaredField = BaseDialogFragmentV2.class.getSuperclass().getDeclaredField(str);
            declaredField.setAccessible(true);
            declaredField.set(this, obj);
        } catch (Exception unused) {
        }
    }

    public void show(AnonymousClass0AA r3, String str) {
        LIZ("mDismissed", false);
        LIZ("mShownByMe", true);
        AnonymousClass0AP LIZ = r3.LIZ();
        LIZ.LIZ((Fragment) this, str);
        LIZ.LIZJ();
    }

    public int show(AnonymousClass0AP r4, String str) {
        LIZ("mDismissed", false);
        LIZ("mShownByMe", true);
        r4.LIZ((Fragment) this, str);
        LIZ("mViewDestroyed", false);
        int LIZJ = r4.LIZJ();
        LIZ("mBackStackId", Integer.valueOf(LIZJ));
        return LIZJ;
    }

    public void showNow(AnonymousClass0AA r3, String str) {
        LIZ("mDismissed", false);
        LIZ("mShownByMe", true);
        AnonymousClass0AP LIZ = r3.LIZ();
        LIZ.LIZ((Fragment) this, str);
        try {
            LIZ.LJ();
        } catch (Throwable unused) {
            LIZ.LIZJ();
        }
    }
}
