package infosecadventures.fridademo.fragments;
import
android.app.AlertDialog;
import
android.content.DialogInterface;
import
android.os.Bundle;
import
android.view.LayoutInflater;
import
android.view.View;
import
android.view.ViewGroup;
import
android.widget.EditText;
import
android.widget.Toast;
import
androidx.fragment.app.Fragment;
import
infosecadventures.fridademo.R;
import
infosecadventures.fridademo.utils.PinUtil;
/
*
loaded
from
: classes.dex
*
/
public
class
PinBypass extends Fragment {
@Override
/
/
androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view
=
inflater.inflate(R.layout.fragment_pin_bypass, container, false);
final EditText pin
=
(EditText) view.findViewById(R.
id
.pin);
view.findViewById(R.
id
.pin_check).setOnClickListener(new View.OnClickListener() {
/
/
from
class
: infosecadventures.fridademo.fragments.PinBypass.
1
@Override
/
/
android.view.View.OnClickListener
public void onClick(View v) {
if
(pin.getText().toString().isEmpty()) {
Toast.makeText(PinBypass.this.getContext(),
"PIN is not provided!"
,
0
).show();
}
else
if
(PinUtil.checkPin(pin.getText().toString())) {
new AlertDialog.Builder(PinBypass.this.getActivity()).setTitle(PinBypass.this.getString(R.string.granted)).setMessage(PinBypass.this.getString(R.string.success_pin)).setPositiveButton(
"Dismiss"
, new DialogInterface.OnClickListener() {
/
/
from
class
: infosecadventures.fridademo.fragments.PinBypass.
1.1
@Override
/
/
android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialog,
int
which) {
dialog.dismiss();
}
}).show();
}
else
{
new AlertDialog.Builder(PinBypass.this.getActivity()).setTitle(PinBypass.this.getString(R.string.denied)).setMessage(PinBypass.this.getString(R.string.fail_pin)).setPositiveButton(
"Dismiss"
, new DialogInterface.OnClickListener() {
/
/
from
class
: infosecadventures.fridademo.fragments.PinBypass.
1.2
@Override
/
/
android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialog,
int
which) {
dialog.dismiss();
}
}).show();
}
}
});
return
view;
}
}