what-the-bank/sources/com/scb/phone/view/custom/MonthYearPickerDialog.java

313 lines
11 KiB
Java

package com.scb.phone.view.custom;
import android.content.Context;
import android.util.Base64;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.NumberPicker;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.scb.phone.R;
import com.scb.phone.view.custom.MonthYearPickerDialog;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import o.C14957gcv;
import o.DialogInterfaceC17187ufv;
import o.pyT;
/* loaded from: classes5.dex */
public final class MonthYearPickerDialog {
private static int g = 0;
private static byte h = 0;
private static int l = 1;
public String[] a;
public IeS b;
public int c;
public final DialogInterfaceC17187ufv d;
public MonthYearDialogViewHolder e;
public String[] f;
public int i;
private final Context j;
/* loaded from: classes5.dex */
public interface IeS {
void b(String str, String str2, int i, int i2);
}
public MonthYearPickerDialog(Context context) {
C14957gcv.e(context, "");
this.j = context;
String[] stringArray = context.getResources().getStringArray(R.array.f1352130903063);
C14957gcv.c(stringArray, "");
this.a = stringArray;
int i = GregorianCalendar.getInstance().get(1);
ArrayList arrayList = new ArrayList();
int i2 = i + 14;
if (i <= i2) {
while (true) {
String substring = String.valueOf(i).substring(r5.length() - 2);
C14957gcv.c((Object) substring, "");
arrayList.add(substring);
if (i == i2) {
break;
} else {
i++;
}
}
}
this.f = (String[]) arrayList.toArray(new String[0]);
Button button = null;
View inflate = LayoutInflater.from(context).inflate(R.layout.2131559022, (ViewGroup) null, false);
C14957gcv.c(inflate, "");
this.e = new MonthYearDialogViewHolder(inflate);
DialogInterfaceC17187ufv.HBt hBt = new DialogInterfaceC17187ufv.HBt(context, android.R.style.Theme.Material.Dialog.Alert);
hBt.b.B = inflate;
hBt.b.A = 0;
hBt.b.G = false;
String[] strArr = this.a;
C14957gcv.e(strArr, "");
this.a = strArr;
ColorChangeableNumberPicker colorChangeableNumberPicker = this.e.monthPicker;
if (colorChangeableNumberPicker == null) {
C14957gcv.a("");
colorChangeableNumberPicker = null;
}
colorChangeableNumberPicker.setMinValue(0);
ColorChangeableNumberPicker colorChangeableNumberPicker2 = this.e.monthPicker;
if (colorChangeableNumberPicker2 == null) {
C14957gcv.a("");
colorChangeableNumberPicker2 = null;
}
colorChangeableNumberPicker2.setMaxValue(this.a.length - 1);
ColorChangeableNumberPicker colorChangeableNumberPicker3 = this.e.monthPicker;
if (colorChangeableNumberPicker3 == null) {
C14957gcv.a("");
colorChangeableNumberPicker3 = null;
}
colorChangeableNumberPicker3.setDisplayedValues(this.a);
ColorChangeableNumberPicker colorChangeableNumberPicker4 = this.e.monthPicker;
if (colorChangeableNumberPicker4 == null) {
C14957gcv.a("");
colorChangeableNumberPicker4 = null;
}
colorChangeableNumberPicker4.setValue(this.c);
String[] strArr2 = this.f;
C14957gcv.e(strArr2, "");
this.f = strArr2;
ColorChangeableNumberPicker colorChangeableNumberPicker5 = this.e.yearPicker;
if (colorChangeableNumberPicker5 == null) {
C14957gcv.a("");
colorChangeableNumberPicker5 = null;
}
colorChangeableNumberPicker5.setMinValue(0);
ColorChangeableNumberPicker colorChangeableNumberPicker6 = this.e.yearPicker;
if (colorChangeableNumberPicker6 == null) {
C14957gcv.a("");
colorChangeableNumberPicker6 = null;
}
colorChangeableNumberPicker6.setMaxValue(this.f.length - 1);
ColorChangeableNumberPicker colorChangeableNumberPicker7 = this.e.yearPicker;
if (colorChangeableNumberPicker7 == null) {
C14957gcv.a("");
colorChangeableNumberPicker7 = null;
}
colorChangeableNumberPicker7.setDisplayedValues(this.f);
ColorChangeableNumberPicker colorChangeableNumberPicker8 = this.e.yearPicker;
if (colorChangeableNumberPicker8 == null) {
C14957gcv.a("");
colorChangeableNumberPicker8 = null;
}
colorChangeableNumberPicker8.setValue(this.i);
DialogInterfaceC17187ufv b = hBt.b();
C14957gcv.c(b, "");
this.d = b;
b.setCancelable(false);
b.requestWindowFeature(1);
ColorChangeableNumberPicker colorChangeableNumberPicker9 = this.e.monthPicker;
if (colorChangeableNumberPicker9 == null) {
C14957gcv.a("");
colorChangeableNumberPicker9 = null;
}
colorChangeableNumberPicker9.setOnValueChangedListener(new NumberPicker.OnValueChangeListener(this) { // from class: o.eAw
private MonthYearPickerDialog c;
@Override // android.widget.NumberPicker.OnValueChangeListener
public final void onValueChange(NumberPicker numberPicker, int i3, int i4) {
MonthYearPickerDialog.b(this.c, i4);
}
{
this.c = this;
}
});
ColorChangeableNumberPicker colorChangeableNumberPicker10 = this.e.yearPicker;
if (colorChangeableNumberPicker10 == null) {
C14957gcv.a("");
colorChangeableNumberPicker10 = null;
}
colorChangeableNumberPicker10.setOnValueChangedListener(new NumberPicker.OnValueChangeListener(this) { // from class: o.eAx
private MonthYearPickerDialog d;
@Override // android.widget.NumberPicker.OnValueChangeListener
public final void onValueChange(NumberPicker numberPicker, int i3, int i4) {
MonthYearPickerDialog.d(this.d, i4);
}
{
this.d = this;
}
});
Button button2 = this.e.btDone;
if (button2 != null) {
button = button2;
} else {
C14957gcv.a("");
}
button.setOnClickListener(new View.OnClickListener(this) { // from class: o.eAs
private MonthYearPickerDialog a;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
MonthYearPickerDialog.a(this.a);
}
{
this.a = this;
}
});
}
/* loaded from: classes5.dex */
public static final class HBt {
private HBt() {
}
public /* synthetic */ HBt(byte b) {
this();
}
}
/* loaded from: classes5.dex */
public final class MonthYearDialogViewHolder_ViewBinding implements Unbinder {
private MonthYearDialogViewHolder c;
public MonthYearDialogViewHolder_ViewBinding(MonthYearDialogViewHolder monthYearDialogViewHolder, View view) {
this.c = monthYearDialogViewHolder;
monthYearDialogViewHolder.tvTitle = (TextView) pyT.e(view, R.id.tv_dialog_title, "field 'tvTitle'", TextView.class);
monthYearDialogViewHolder.monthPicker = (ColorChangeableNumberPicker) pyT.e(view, R.id.month_picker, "field 'monthPicker'", ColorChangeableNumberPicker.class);
monthYearDialogViewHolder.yearPicker = (ColorChangeableNumberPicker) pyT.e(view, R.id.year_picker, "field 'yearPicker'", ColorChangeableNumberPicker.class);
monthYearDialogViewHolder.btDone = (Button) pyT.e(view, R.id.bt_done, "field 'btDone'", Button.class);
}
@Override // butterknife.Unbinder
public final void a() {
MonthYearDialogViewHolder monthYearDialogViewHolder = this.c;
if (monthYearDialogViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.c = null;
monthYearDialogViewHolder.tvTitle = null;
monthYearDialogViewHolder.monthPicker = null;
monthYearDialogViewHolder.yearPicker = null;
monthYearDialogViewHolder.btDone = null;
}
}
private void k(String str, Object[] objArr) {
byte[] decode = Base64.decode(str, 0);
byte[] bArr = new byte[decode.length];
for (int i = 0; i < decode.length; i++) {
bArr[i] = (byte) (decode[(decode.length - i) - 1] ^ h);
}
objArr[0] = new String(bArr, StandardCharsets.UTF_8);
}
public final void a() {
int i = 2 % 2;
TextView textView = this.e.tvTitle;
Object obj = null;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
String string = this.j.getResources().getString(R.string.registration_select_expiry_date);
if (string.startsWith(",*,)")) {
int i2 = l + 15;
g = i2 % 128;
int i3 = i2 % 2;
Object[] objArr = new Object[1];
k(string.substring(4), objArr);
string = ((String) objArr[0]).intern();
int i4 = g + 91;
l = i4 % 128;
int i5 = i4 % 2;
}
textView.setText(string);
int i6 = l + 33;
g = i6 % 128;
if (i6 % 2 == 0) {
return;
}
obj.hashCode();
throw null;
}
/* loaded from: classes5.dex */
public static final class MonthYearDialogViewHolder {
@BindView
public Button btDone;
@BindView
public ColorChangeableNumberPicker monthPicker;
@BindView
public TextView tvTitle;
@BindView
public ColorChangeableNumberPicker yearPicker;
public MonthYearDialogViewHolder(View view) {
C14957gcv.e(view, "");
ButterKnife.c(this, view);
}
}
public static /* synthetic */ void a(MonthYearPickerDialog monthYearPickerDialog) {
C14957gcv.e(monthYearPickerDialog, "");
IeS ieS = monthYearPickerDialog.b;
if (ieS != null) {
String str = monthYearPickerDialog.a[monthYearPickerDialog.c];
C14957gcv.c((Object) str, "");
String[] strArr = monthYearPickerDialog.f;
int i = monthYearPickerDialog.i;
ieS.b(str, strArr[i], monthYearPickerDialog.c, i);
}
monthYearPickerDialog.d.dismiss();
}
public static /* synthetic */ void b(MonthYearPickerDialog monthYearPickerDialog, int i) {
C14957gcv.e(monthYearPickerDialog, "");
monthYearPickerDialog.c = i;
}
public static /* synthetic */ void d(MonthYearPickerDialog monthYearPickerDialog, int i) {
C14957gcv.e(monthYearPickerDialog, "");
monthYearPickerDialog.i = i;
}
static void c() {
h = (byte) 6;
}
static {
c();
new HBt((byte) 0);
}
}