what-the-bank/sources/o/dJC.java

81 lines
2.4 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import com.eracom.OBM2.PINMessageException;
import java.util.Properties;
import java.util.Vector;
/* loaded from: classes.dex */
public final class dJC {
xYb a;
Vector b;
private byte c;
int d;
private byte[] e;
public dJC(xYb xyb, String str, int i, Properties properties) throws PINMessageException {
this.e = new byte[i - ((xyb.b().c + 1) << 1)];
this.a = xyb;
if (properties != null && properties.getProperty("param_ISO_FORMAT_0_PAN") != null) {
d(xyb);
} else {
this.c = (byte) 1;
this.e[0] = 1;
this.d = 1;
d(xyb);
a(str, i);
}
Vector vector = new Vector(this.d);
this.b = vector;
byte[] bArr = this.e;
int i2 = this.d;
for (int i3 = 0; i3 < i2; i3++) {
vector.addElement(new Byte(bArr[i3]));
}
}
public dJC(xYb xyb, xYb xyb2, String str, int i) throws PINMessageException {
byte[] bArr = new byte[i - ((xyb2.b().c + 1) << 1)];
this.e = bArr;
this.c = (byte) 2;
bArr[0] = 2;
this.d = 1;
this.a = xyb2;
d(xyb);
d(xyb2);
a(str, i);
Vector vector = new Vector(this.d);
this.b = vector;
byte[] bArr2 = this.e;
int i2 = this.d;
for (int i3 = 0; i3 < i2; i3++) {
vector.addElement(new Byte(bArr2[i3]));
}
}
private void d(xYb xyb) throws PINMessageException {
if (xyb == null) {
throw new PINMessageException("Error no : 20 - Invalid PIN Block");
}
int a = xyb.a();
System.arraycopy(xyb.d(), 0, this.e, this.d, a);
this.d += a;
}
private void a(String str, int i) throws PINMessageException {
if (str == null) {
throw new PINMessageException("Error no : 22 - Invalid Random Number String");
}
int length = str.length();
int i2 = (length + 1) / 2;
int i3 = (this.a.b().c + 1) << 1;
int i4 = this.d;
if (length < 16 || length > (((i - i3) - i4) << 1) || length != (i2 << 1)) {
throw new PINMessageException("Error no : 21 - Invalid Random Number String length");
}
if (C15605gzv.b(str, this.e, i4) != 0) {
throw new PINMessageException("Error no : 22 - Invalid Random Number String");
}
this.d += i2;
}
}