package com.ifpdos.debugmenu.action;

import android.content.Context;
import android.content.DialogInterface;
import android.text.TextUtils;
import c.n.a;
import com.ifpdos.debugmenu.R;
import com.ifpdos.debugmenu.event.ActivityEvent;
import d.f.a.r2.a3;
import d.f.a.s1.e;
import d.f.a.s1.f;
import d.i.f.c.c;

/* JADX INFO: loaded from: classes.dex */
public class ShowPagePasswordAction {
    private static final String TAG = "InputPagePasswordAction";
    private Context mContext;
    private String mPagePassword;
    private volatile boolean mIsDialogShowing = false;
    private String mSuperPagePassword = c.f("persist.sys.debugmenu.password", "1706");

    public ShowPagePasswordAction(Context context, String str) {
        this.mContext = context;
        this.mPagePassword = (String) a3.b(this.mContext).a("KEY_PAGE_PASSWORD", str);
    }

    public /* synthetic */ void a(String str) {
        if (TextUtils.isEmpty(str) || !(str.equals(this.mPagePassword) || str.equals(this.mSuperPagePassword))) {
            a.d0(R.string.str_wrong_password);
        } else {
            this.mIsDialogShowing = false;
            a.o();
        }
    }

    public /* synthetic */ void b() {
        this.mIsDialogShowing = false;
        a.o();
        k.c.a.c.c().g(new ActivityEvent.Finish());
    }

    public void showInputDialog() {
        if (this.mIsDialogShowing) {
            return;
        }
        this.mIsDialogShowing = true;
        final f fVar = new f() { // from class: d.f.a.p1.c6
            @Override // d.f.a.s1.f
            public final void a(String str) {
                this.a.a(str);
            }
        };
        final e eVar = new e() { // from class: d.f.a.p1.b6
            @Override // d.f.a.s1.e
            public final void call() {
                this.a.b();
            }
        };
        k.c.a.c.c().g(new ActivityEvent.ShowDebugMenuDialog(R.string.str_debug_password_input, R.string.str_debug_password_input, new f() { // from class: d.f.a.r2.j
            @Override // d.f.a.s1.f
            public final void a(String str) {
                d.f.a.s1.f fVar2 = fVar;
                if (fVar2 != null) {
                    fVar2.a(str);
                }
            }
        }, new DialogInterface.OnCancelListener() { // from class: d.f.a.r2.i
            @Override // android.content.DialogInterface.OnCancelListener
            public final void onCancel(DialogInterface dialogInterface) {
                d.f.a.s1.e eVar2 = eVar;
                if (eVar2 != null) {
                    eVar2.call();
                }
            }
        }));
    }
}
