393 lines
14 KiB
Java
393 lines
14 KiB
Java
|
package o;
|
||
|
|
||
|
import com.airbnb.deeplinkdispatch.UrlTreeKt;
|
||
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||
|
import com.google.zxing.NotFoundException;
|
||
|
import com.google.zxing.common.reedsolomon.ReedSolomonException;
|
||
|
|
||
|
/* renamed from: o.bhW, reason: case insensitive filesystem */
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class C4826bhW {
|
||
|
private static final int[] c = {3808, 476, 2107, 1799};
|
||
|
private final C8902dZc a;
|
||
|
private int b;
|
||
|
private int d;
|
||
|
private boolean e;
|
||
|
private int g;
|
||
|
private int j;
|
||
|
|
||
|
public C4826bhW(C8902dZc c8902dZc) {
|
||
|
this.a = c8902dZc;
|
||
|
}
|
||
|
|
||
|
public final aJX d(boolean z) throws NotFoundException {
|
||
|
qCz[] e = e(c());
|
||
|
if (z) {
|
||
|
qCz qcz = e[0];
|
||
|
e[0] = e[2];
|
||
|
e[2] = qcz;
|
||
|
}
|
||
|
b(e);
|
||
|
C8902dZc c8902dZc = this.a;
|
||
|
int i = this.j;
|
||
|
return new aJX(a(c8902dZc, e[i % 4], e[(i + 1) % 4], e[(i + 2) % 4], e[(i + 3) % 4]), d(e, this.b << 1, b()), this.e, this.d, this.g);
|
||
|
}
|
||
|
|
||
|
private void b(qCz[] qczArr) throws NotFoundException {
|
||
|
int i;
|
||
|
long j;
|
||
|
long j2;
|
||
|
qCz qcz = qczArr[0];
|
||
|
float f = qcz.a;
|
||
|
int i2 = (int) (f + (f < BitmapDescriptorFactory.HUE_RED ? -0.5f : 0.5f));
|
||
|
float f2 = qcz.e;
|
||
|
if (b(i2, (int) (f2 + (f2 < BitmapDescriptorFactory.HUE_RED ? -0.5f : 0.5f)))) {
|
||
|
qCz qcz2 = qczArr[1];
|
||
|
float f3 = qcz2.a;
|
||
|
int i3 = (int) (f3 + (f3 < BitmapDescriptorFactory.HUE_RED ? -0.5f : 0.5f));
|
||
|
float f4 = qcz2.e;
|
||
|
if (b(i3, (int) (f4 + (f4 < BitmapDescriptorFactory.HUE_RED ? -0.5f : 0.5f)))) {
|
||
|
qCz qcz3 = qczArr[2];
|
||
|
float f5 = qcz3.a;
|
||
|
int i4 = (int) (f5 + (f5 < BitmapDescriptorFactory.HUE_RED ? -0.5f : 0.5f));
|
||
|
float f6 = qcz3.e;
|
||
|
if (b(i4, (int) (f6 + (f6 < BitmapDescriptorFactory.HUE_RED ? -0.5f : 0.5f)))) {
|
||
|
qCz qcz4 = qczArr[3];
|
||
|
float f7 = qcz4.a;
|
||
|
int i5 = (int) (f7 + (f7 < BitmapDescriptorFactory.HUE_RED ? -0.5f : 0.5f));
|
||
|
float f8 = qcz4.e;
|
||
|
if (b(i5, (int) (f8 + (f8 >= BitmapDescriptorFactory.HUE_RED ? 0.5f : -0.5f)))) {
|
||
|
int i6 = this.b << 1;
|
||
|
int[] iArr = {b(qczArr[0], qczArr[1], i6), b(qczArr[1], qczArr[2], i6), b(qczArr[2], qczArr[3], i6), b(qczArr[3], qczArr[0], i6)};
|
||
|
int i7 = 0;
|
||
|
for (int i8 = 0; i8 < 4; i8++) {
|
||
|
int i9 = iArr[i8];
|
||
|
i7 = (i7 << 3) + ((i9 >> (i6 - 2)) << 1) + (i9 & 1);
|
||
|
}
|
||
|
for (int i10 = 0; i10 < 4; i10++) {
|
||
|
if (Integer.bitCount(c[i10] ^ (((i7 & 1) << 11) + (i7 >> 1))) <= 2) {
|
||
|
this.j = i10;
|
||
|
long j3 = 0;
|
||
|
for (int i11 = 0; i11 < 4; i11++) {
|
||
|
int i12 = iArr[(this.j + i11) % 4];
|
||
|
if (this.e) {
|
||
|
j = j3 << 7;
|
||
|
j2 = (i12 >> 1) & 127;
|
||
|
} else {
|
||
|
j = j3 << 10;
|
||
|
j2 = ((i12 >> 2) & 992) + ((i12 >> 1) & 31);
|
||
|
}
|
||
|
j3 = j + j2;
|
||
|
}
|
||
|
int b = b(j3, this.e);
|
||
|
if (this.e) {
|
||
|
this.g = (b >> 6) + 1;
|
||
|
i = b & 63;
|
||
|
} else {
|
||
|
this.g = (b >> 11) + 1;
|
||
|
i = b & 2047;
|
||
|
}
|
||
|
this.d = i + 1;
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
throw NotFoundException.b();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
throw NotFoundException.b();
|
||
|
}
|
||
|
|
||
|
private static int b(long j, boolean z) throws NotFoundException {
|
||
|
int i;
|
||
|
int i2;
|
||
|
if (z) {
|
||
|
i = 7;
|
||
|
i2 = 2;
|
||
|
} else {
|
||
|
i = 10;
|
||
|
i2 = 4;
|
||
|
}
|
||
|
int[] iArr = new int[i];
|
||
|
for (int i3 = i - 1; i3 >= 0; i3--) {
|
||
|
iArr[i3] = ((int) j) & 15;
|
||
|
j >>= 4;
|
||
|
}
|
||
|
try {
|
||
|
new lxg(Ayo.a).b(iArr, i - i2);
|
||
|
int i4 = 0;
|
||
|
for (int i5 = 0; i5 < i2; i5++) {
|
||
|
i4 = (i4 << 4) + iArr[i5];
|
||
|
}
|
||
|
return i4;
|
||
|
} catch (ReedSolomonException unused) {
|
||
|
throw NotFoundException.b();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private qCz[] e(LWm lWm) throws NotFoundException {
|
||
|
LWm lWm2;
|
||
|
int i = 1;
|
||
|
this.b = 1;
|
||
|
LWm lWm3 = lWm;
|
||
|
LWm lWm4 = lWm3;
|
||
|
LWm lWm5 = lWm4;
|
||
|
LWm lWm6 = lWm5;
|
||
|
boolean z = true;
|
||
|
while (this.b < 9) {
|
||
|
LWm d = d(lWm3, z, i, -1);
|
||
|
LWm d2 = d(lWm4, z, i, i);
|
||
|
LWm d3 = d(lWm5, z, -1, i);
|
||
|
LWm d4 = d(lWm6, z, -1, -1);
|
||
|
if (this.b > 2) {
|
||
|
double b = (b(d4, d) * this.b) / (b(lWm6, lWm3) * (this.b + 2));
|
||
|
if (b < 0.75d || b > 1.25d) {
|
||
|
break;
|
||
|
}
|
||
|
LWm lWm7 = new LWm(Math.max(0, d.d - 3), Math.min(this.a.c - i, d.b + 3));
|
||
|
LWm lWm8 = new LWm(Math.max(0, d2.d - 3), Math.max(0, d2.b - 3));
|
||
|
LWm lWm9 = new LWm(Math.min(this.a.e - i, d3.d + 3), Math.max(0, Math.min(this.a.c - i, d3.b - 3)));
|
||
|
lWm2 = d;
|
||
|
LWm lWm10 = new LWm(Math.min(this.a.e - 1, d4.d + 3), Math.min(this.a.c - 1, d4.b + 3));
|
||
|
int a = a(lWm10, lWm7);
|
||
|
if (a == 0 || a(lWm7, lWm8) != a || a(lWm8, lWm9) != a || a(lWm9, lWm10) != a) {
|
||
|
break;
|
||
|
}
|
||
|
} else {
|
||
|
lWm2 = d;
|
||
|
}
|
||
|
z = !z;
|
||
|
this.b++;
|
||
|
lWm6 = d4;
|
||
|
lWm4 = d2;
|
||
|
lWm5 = d3;
|
||
|
lWm3 = lWm2;
|
||
|
i = 1;
|
||
|
}
|
||
|
int i2 = this.b;
|
||
|
if (i2 != 5 && i2 != 7) {
|
||
|
throw NotFoundException.b();
|
||
|
}
|
||
|
this.e = i2 == 5;
|
||
|
qCz[] qczArr = {new qCz(lWm3.d + 0.5f, lWm3.b - 0.5f), new qCz(lWm4.d + 0.5f, lWm4.b + 0.5f), new qCz(lWm5.d - 0.5f, lWm5.b + 0.5f), new qCz(lWm6.d - 0.5f, lWm6.b - 0.5f)};
|
||
|
int i3 = this.b << 1;
|
||
|
return d(qczArr, i3 - 3, i3);
|
||
|
}
|
||
|
|
||
|
private LWm c() {
|
||
|
qCz qcz;
|
||
|
qCz qcz2;
|
||
|
qCz qcz3;
|
||
|
qCz qcz4;
|
||
|
qCz qcz5;
|
||
|
qCz qcz6;
|
||
|
qCz qcz7;
|
||
|
qCz qcz8;
|
||
|
try {
|
||
|
qCz[] a = new RHW(this.a).a();
|
||
|
qcz4 = a[0];
|
||
|
qcz3 = a[1];
|
||
|
qcz2 = a[2];
|
||
|
qcz = a[3];
|
||
|
} catch (NotFoundException unused) {
|
||
|
int i = this.a.e / 2;
|
||
|
int i2 = this.a.c / 2;
|
||
|
int i3 = i + 7;
|
||
|
int i4 = i2 - 7;
|
||
|
LWm d = d(new LWm(i3, i4), false, 1, -1);
|
||
|
qCz qcz9 = new qCz(d.d, d.b);
|
||
|
int i5 = i2 + 7;
|
||
|
LWm d2 = d(new LWm(i3, i5), false, 1, 1);
|
||
|
qCz qcz10 = new qCz(d2.d, d2.b);
|
||
|
int i6 = i - 7;
|
||
|
LWm d3 = d(new LWm(i6, i5), false, -1, 1);
|
||
|
qCz qcz11 = new qCz(d3.d, d3.b);
|
||
|
LWm d4 = d(new LWm(i6, i4), false, -1, -1);
|
||
|
qcz = new qCz(d4.d, d4.b);
|
||
|
qcz2 = qcz11;
|
||
|
qcz3 = qcz10;
|
||
|
qcz4 = qcz9;
|
||
|
}
|
||
|
float f = (((qcz4.a + qcz.a) + qcz3.a) + qcz2.a) / 4.0f;
|
||
|
int i7 = (int) (f + (f < BitmapDescriptorFactory.HUE_RED ? -0.5f : 0.5f));
|
||
|
float f2 = (((qcz4.e + qcz.e) + qcz3.e) + qcz2.e) / 4.0f;
|
||
|
int i8 = (int) (f2 + (f2 < BitmapDescriptorFactory.HUE_RED ? -0.5f : 0.5f));
|
||
|
try {
|
||
|
qCz[] a2 = new RHW(this.a, 15, i7, i8).a();
|
||
|
qcz5 = a2[0];
|
||
|
qcz6 = a2[1];
|
||
|
qcz8 = a2[2];
|
||
|
qcz7 = a2[3];
|
||
|
} catch (NotFoundException unused2) {
|
||
|
int i9 = i7 + 7;
|
||
|
int i10 = i8 - 7;
|
||
|
LWm d5 = d(new LWm(i9, i10), false, 1, -1);
|
||
|
qcz5 = new qCz(d5.d, d5.b);
|
||
|
int i11 = i8 + 7;
|
||
|
LWm d6 = d(new LWm(i9, i11), false, 1, 1);
|
||
|
qcz6 = new qCz(d6.d, d6.b);
|
||
|
int i12 = i7 - 7;
|
||
|
LWm d7 = d(new LWm(i12, i11), false, -1, 1);
|
||
|
qCz qcz12 = new qCz(d7.d, d7.b);
|
||
|
LWm d8 = d(new LWm(i12, i10), false, -1, -1);
|
||
|
qcz7 = new qCz(d8.d, d8.b);
|
||
|
qcz8 = qcz12;
|
||
|
}
|
||
|
float f3 = (((qcz5.a + qcz7.a) + qcz6.a) + qcz8.a) / 4.0f;
|
||
|
int i13 = (int) (f3 + (f3 < BitmapDescriptorFactory.HUE_RED ? -0.5f : 0.5f));
|
||
|
float f4 = (((qcz5.e + qcz7.e) + qcz6.e) + qcz8.e) / 4.0f;
|
||
|
return new LWm(i13, (int) (f4 + (f4 >= BitmapDescriptorFactory.HUE_RED ? 0.5f : -0.5f)));
|
||
|
}
|
||
|
|
||
|
private C8902dZc a(C8902dZc c8902dZc, qCz qcz, qCz qcz2, qCz qcz3, qCz qcz4) throws NotFoundException {
|
||
|
AbstractC17663yjl a = AbstractC17663yjl.a();
|
||
|
int b = b();
|
||
|
float f = b / 2.0f;
|
||
|
float f2 = this.b;
|
||
|
float f3 = f - f2;
|
||
|
float f4 = f + f2;
|
||
|
return a.e(c8902dZc, b, b, f3, f3, f4, f3, f4, f4, f3, f4, qcz.a, qcz.e, qcz2.a, qcz2.e, qcz3.a, qcz3.e, qcz4.a, qcz4.e);
|
||
|
}
|
||
|
|
||
|
private int b(qCz qcz, qCz qcz2, int i) {
|
||
|
float b = b(qcz, qcz2);
|
||
|
float f = b / i;
|
||
|
float f2 = qcz.a;
|
||
|
float f3 = qcz.e;
|
||
|
float f4 = ((qcz2.a - qcz.a) * f) / b;
|
||
|
float f5 = (f * (qcz2.e - qcz.e)) / b;
|
||
|
int i2 = 0;
|
||
|
for (int i3 = 0; i3 < i; i3++) {
|
||
|
float f6 = i3;
|
||
|
float f7 = (f6 * f4) + f2;
|
||
|
float f8 = (f6 * f5) + f3;
|
||
|
if (this.a.b((int) (f7 + (f7 < BitmapDescriptorFactory.HUE_RED ? -0.5f : 0.5f)), (int) (f8 + (f8 >= BitmapDescriptorFactory.HUE_RED ? 0.5f : -0.5f)))) {
|
||
|
i2 |= 1 << ((i - i3) - 1);
|
||
|
}
|
||
|
}
|
||
|
return i2;
|
||
|
}
|
||
|
|
||
|
private int a(LWm lWm, LWm lWm2) {
|
||
|
float b = b(lWm, lWm2);
|
||
|
if (b == BitmapDescriptorFactory.HUE_RED) {
|
||
|
return 0;
|
||
|
}
|
||
|
float f = (lWm2.d - lWm.d) / b;
|
||
|
float f2 = (lWm2.b - lWm.b) / b;
|
||
|
float f3 = lWm.d;
|
||
|
float f4 = lWm.b;
|
||
|
boolean b2 = this.a.b(lWm.d, lWm.b);
|
||
|
int floor = (int) Math.floor(b);
|
||
|
int i = 0;
|
||
|
for (int i2 = 0; i2 < floor; i2++) {
|
||
|
if (this.a.b((int) ((f3 < BitmapDescriptorFactory.HUE_RED ? -0.5f : 0.5f) + f3), (int) ((f4 >= BitmapDescriptorFactory.HUE_RED ? 0.5f : -0.5f) + f4)) != b2) {
|
||
|
i++;
|
||
|
}
|
||
|
f3 += f;
|
||
|
f4 += f2;
|
||
|
}
|
||
|
float f5 = i / b;
|
||
|
if (f5 <= 0.1f || f5 >= 0.9f) {
|
||
|
return (f5 <= 0.1f) != b2 ? -1 : 1;
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
private static qCz[] d(qCz[] qczArr, int i, int i2) {
|
||
|
float f = i2 / (i * 2.0f);
|
||
|
float f2 = qczArr[0].a;
|
||
|
float f3 = qczArr[2].a;
|
||
|
float f4 = qczArr[0].e;
|
||
|
float f5 = qczArr[2].e;
|
||
|
float f6 = (qczArr[0].a + qczArr[2].a) / 2.0f;
|
||
|
float f7 = (qczArr[0].e + qczArr[2].e) / 2.0f;
|
||
|
float f8 = (f2 - f3) * f;
|
||
|
float f9 = (f4 - f5) * f;
|
||
|
qCz qcz = new qCz(f6 + f8, f7 + f9);
|
||
|
qCz qcz2 = new qCz(f6 - f8, f7 - f9);
|
||
|
float f10 = qczArr[1].a;
|
||
|
float f11 = qczArr[3].a;
|
||
|
float f12 = qczArr[1].e;
|
||
|
float f13 = qczArr[3].e;
|
||
|
float f14 = (qczArr[1].a + qczArr[3].a) / 2.0f;
|
||
|
float f15 = (qczArr[1].e + qczArr[3].e) / 2.0f;
|
||
|
float f16 = (f10 - f11) * f;
|
||
|
float f17 = f * (f12 - f13);
|
||
|
return new qCz[]{qcz, new qCz(f14 + f16, f15 + f17), qcz2, new qCz(f14 - f16, f15 - f17)};
|
||
|
}
|
||
|
|
||
|
private int b() {
|
||
|
if (this.e) {
|
||
|
return (this.g << 2) + 11;
|
||
|
}
|
||
|
int i = this.g;
|
||
|
return (i << 2) + ((((i << 1) + 6) / 15) << 1) + 15;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
/* renamed from: o.bhW$LWm */
|
||
|
/* loaded from: classes2.dex */
|
||
|
public static final class LWm {
|
||
|
final int b;
|
||
|
final int d;
|
||
|
|
||
|
LWm(int i, int i2) {
|
||
|
this.d = i;
|
||
|
this.b = i2;
|
||
|
}
|
||
|
|
||
|
public final String toString() {
|
||
|
StringBuilder sb = new StringBuilder(UrlTreeKt.configurablePathSegmentPrefix);
|
||
|
sb.append(this.d);
|
||
|
sb.append(' ');
|
||
|
sb.append(this.b);
|
||
|
sb.append(UrlTreeKt.configurablePathSegmentSuffixChar);
|
||
|
return sb.toString();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private static float b(qCz qcz, qCz qcz2) {
|
||
|
float f = qcz.a;
|
||
|
float f2 = qcz.e;
|
||
|
double d = f - qcz2.a;
|
||
|
double d2 = f2 - qcz2.e;
|
||
|
return (float) Math.sqrt((d * d) + (d2 * d2));
|
||
|
}
|
||
|
|
||
|
private static float b(LWm lWm, LWm lWm2) {
|
||
|
int i = lWm.d;
|
||
|
int i2 = lWm.b;
|
||
|
double d = i - lWm2.d;
|
||
|
double d2 = i2 - lWm2.b;
|
||
|
return (float) Math.sqrt((d * d) + (d2 * d2));
|
||
|
}
|
||
|
|
||
|
private LWm d(LWm lWm, boolean z, int i, int i2) {
|
||
|
int i3 = lWm.d + i;
|
||
|
int i4 = lWm.b;
|
||
|
while (true) {
|
||
|
i4 += i2;
|
||
|
if (!b(i3, i4) || this.a.b(i3, i4) != z) {
|
||
|
break;
|
||
|
}
|
||
|
i3 += i;
|
||
|
}
|
||
|
int i5 = i3 - i;
|
||
|
int i6 = i4 - i2;
|
||
|
while (b(i5, i6) && this.a.b(i5, i6) == z) {
|
||
|
i5 += i;
|
||
|
}
|
||
|
int i7 = i5 - i;
|
||
|
while (b(i7, i6) && this.a.b(i7, i6) == z) {
|
||
|
i6 += i2;
|
||
|
}
|
||
|
return new LWm(i7, i6 - i2);
|
||
|
}
|
||
|
|
||
|
private boolean b(int i, int i2) {
|
||
|
return i >= 0 && i < this.a.e && i2 >= 0 && i2 < this.a.c;
|
||
|
}
|
||
|
}
|