package pub.devrel.easypermissions;

import KNBe_11.KQgRr5e_0.KQgRr5e_0.PGPF6hQ_2;
import X6FRs_4.KQgRr5e_0.Nm6q_10.QxJ9d_1;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import androidx.fragment.app.Fragment;
/* loaded from: classes.dex */
public class AppSettingsDialog implements Parcelable {
    public static final Parcelable.Creator<AppSettingsDialog> CREATOR = new KQgRr5e_0();
    public final int KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Context f3025KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Object f3026KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final String f3027KQgRr5e_0;

    /* renamed from: Mqv2r_3  reason: collision with root package name */
    public final String f3722Mqv2r_3;
    public final int PGPF6hQ_2;

    /* renamed from: PGPF6hQ_2  reason: collision with other field name */
    public final String f3028PGPF6hQ_2;
    public final int QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public final String f3029QxJ9d_1;

    /* loaded from: classes.dex */
    public static class KQgRr5e_0 implements Parcelable.Creator<AppSettingsDialog> {
        @Override // android.os.Parcelable.Creator
        /* renamed from: KQgRr5e_0 */
        public AppSettingsDialog createFromParcel(Parcel parcel) {
            return new AppSettingsDialog(parcel, null);
        }

        @Override // android.os.Parcelable.Creator
        /* renamed from: KQgRr5e_0 */
        public AppSettingsDialog[] newArray(int i) {
            return new AppSettingsDialog[i];
        }
    }

    /* loaded from: classes.dex */
    public static class QxJ9d_1 {

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final Context f3030KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final Object f3031KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public String f3032KQgRr5e_0;

        /* renamed from: Mqv2r_3  reason: collision with root package name */
        public String f3723Mqv2r_3;
        public String PGPF6hQ_2;

        /* renamed from: QxJ9d_1  reason: collision with other field name */
        public String f3034QxJ9d_1;
        public int KQgRr5e_0 = -1;
        public int QxJ9d_1 = -1;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public boolean f3033KQgRr5e_0 = false;

        public QxJ9d_1(Activity activity) {
            this.f3031KQgRr5e_0 = activity;
            this.f3030KQgRr5e_0 = activity;
        }

        public QxJ9d_1 KQgRr5e_0(String str) {
            this.f3723Mqv2r_3 = str;
            return this;
        }

        public QxJ9d_1 Mqv2r_3(String str) {
            this.f3034QxJ9d_1 = str;
            return this;
        }

        public QxJ9d_1 PGPF6hQ_2(String str) {
            this.f3032KQgRr5e_0 = str;
            return this;
        }

        public QxJ9d_1 QxJ9d_1(String str) {
            this.PGPF6hQ_2 = str;
            return this;
        }

        public QxJ9d_1 KQgRr5e_0(int i) {
            this.QxJ9d_1 = i;
            return this;
        }

        public AppSettingsDialog KQgRr5e_0() {
            this.f3032KQgRr5e_0 = TextUtils.isEmpty(this.f3032KQgRr5e_0) ? this.f3030KQgRr5e_0.getString(PGPF6hQ_2.rationale_ask_again) : this.f3032KQgRr5e_0;
            this.f3034QxJ9d_1 = TextUtils.isEmpty(this.f3034QxJ9d_1) ? this.f3030KQgRr5e_0.getString(PGPF6hQ_2.title_settings_dialog) : this.f3034QxJ9d_1;
            this.PGPF6hQ_2 = TextUtils.isEmpty(this.PGPF6hQ_2) ? this.f3030KQgRr5e_0.getString(17039370) : this.PGPF6hQ_2;
            this.f3723Mqv2r_3 = TextUtils.isEmpty(this.f3723Mqv2r_3) ? this.f3030KQgRr5e_0.getString(17039360) : this.f3723Mqv2r_3;
            int i = this.QxJ9d_1;
            if (i <= 0) {
                i = 16061;
            }
            this.QxJ9d_1 = i;
            return new AppSettingsDialog(this.f3031KQgRr5e_0, this.KQgRr5e_0, this.f3032KQgRr5e_0, this.f3034QxJ9d_1, this.PGPF6hQ_2, this.f3723Mqv2r_3, this.QxJ9d_1, this.f3033KQgRr5e_0 ? 268435456 : 0, null);
        }
    }

    public /* synthetic */ AppSettingsDialog(Parcel parcel, KQgRr5e_0 kQgRr5e_0) {
        this(parcel);
    }

    public static AppSettingsDialog KQgRr5e_0(Intent intent, Activity activity) {
        AppSettingsDialog appSettingsDialog = (AppSettingsDialog) intent.getParcelableExtra("extra_app_settings");
        appSettingsDialog.KQgRr5e_0(activity);
        return appSettingsDialog;
    }

    @Override // android.os.Parcelable
    public int describeContents() {
        return 0;
    }

    @Override // android.os.Parcelable
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(this.KQgRr5e_0);
        parcel.writeString(this.f3027KQgRr5e_0);
        parcel.writeString(this.f3029QxJ9d_1);
        parcel.writeString(this.f3028PGPF6hQ_2);
        parcel.writeString(this.f3722Mqv2r_3);
        parcel.writeInt(this.QxJ9d_1);
        parcel.writeInt(this.PGPF6hQ_2);
    }

    public /* synthetic */ AppSettingsDialog(Object obj, int i, String str, String str2, String str3, String str4, int i2, int i3, KQgRr5e_0 kQgRr5e_0) {
        this(obj, i, str, str2, str3, str4, i2, i3);
    }

    public AppSettingsDialog(Parcel parcel) {
        this.KQgRr5e_0 = parcel.readInt();
        this.f3027KQgRr5e_0 = parcel.readString();
        this.f3029QxJ9d_1 = parcel.readString();
        this.f3028PGPF6hQ_2 = parcel.readString();
        this.f3722Mqv2r_3 = parcel.readString();
        this.QxJ9d_1 = parcel.readInt();
        this.PGPF6hQ_2 = parcel.readInt();
    }

    public final void KQgRr5e_0(Object obj) {
        this.f3026KQgRr5e_0 = obj;
        if (obj instanceof Activity) {
            this.f3025KQgRr5e_0 = (Activity) obj;
        } else if (obj instanceof Fragment) {
            this.f3025KQgRr5e_0 = ((Fragment) obj).getContext();
        } else {
            throw new IllegalStateException("Unknown object: " + obj);
        }
    }

    public final void KQgRr5e_0(Intent intent) {
        Object obj = this.f3026KQgRr5e_0;
        if (obj instanceof Activity) {
            ((Activity) obj).startActivityForResult(intent, this.QxJ9d_1);
        } else if (obj instanceof Fragment) {
            ((Fragment) obj).startActivityForResult(intent, this.QxJ9d_1);
        }
    }

    public AppSettingsDialog(Object obj, int i, String str, String str2, String str3, String str4, int i2, int i3) {
        KQgRr5e_0(obj);
        this.KQgRr5e_0 = i;
        this.f3027KQgRr5e_0 = str;
        this.f3029QxJ9d_1 = str2;
        this.f3028PGPF6hQ_2 = str3;
        this.f3722Mqv2r_3 = str4;
        this.QxJ9d_1 = i2;
        this.PGPF6hQ_2 = i3;
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public void m1016KQgRr5e_0() {
        KQgRr5e_0(AppSettingsDialogHolderActivity.createShowDialogIntent(this.f3025KQgRr5e_0, this));
    }

    public X6FRs_4.KQgRr5e_0.Nm6q_10.QxJ9d_1 KQgRr5e_0(DialogInterface.OnClickListener onClickListener, DialogInterface.OnClickListener onClickListener2) {
        QxJ9d_1.KQgRr5e_0 kQgRr5e_0;
        int i = this.KQgRr5e_0;
        if (i > 0) {
            kQgRr5e_0 = new QxJ9d_1.KQgRr5e_0(this.f3025KQgRr5e_0, i);
        } else {
            kQgRr5e_0 = new QxJ9d_1.KQgRr5e_0(this.f3025KQgRr5e_0);
        }
        kQgRr5e_0.KQgRr5e_0(false);
        kQgRr5e_0.QxJ9d_1(this.f3029QxJ9d_1);
        kQgRr5e_0.KQgRr5e_0(this.f3027KQgRr5e_0);
        kQgRr5e_0.QxJ9d_1(this.f3028PGPF6hQ_2, onClickListener);
        kQgRr5e_0.KQgRr5e_0(this.f3722Mqv2r_3, onClickListener2);
        return kQgRr5e_0.QxJ9d_1();
    }

    public int KQgRr5e_0() {
        return this.PGPF6hQ_2;
    }
}
