what-the-bank/sources/com/facetec/sdk/av.java

302 lines
11 KiB
Java

package com.facetec.sdk;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.os.Build;
import android.util.TypedValue;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;
import androidx.core.view.ViewCompat;
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat;
import com.google.common.base.Ascii;
import com.huawei.hms.support.api.entity.common.CommonConstant;
import java.security.SecureRandom;
import java.util.List;
import java.util.Locale;
import net.sf.scuba.smartcards.ISO7816;
import o.yZt;
import org.bouncycastle.crypto.tls.CipherSuite;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public class av {
private static final int b = 0;
private static final byte[] c = null;
private static boolean e;
/* JADX WARN: Removed duplicated region for block: B:10:0x0027 */
/* JADX WARN: Removed duplicated region for block: B:7:0x001f */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x0027 -> B:4:0x002b). Please report as a decompilation issue!!! */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private static void f(int r5, byte r6, byte r7, java.lang.Object[] r8) {
/*
int r7 = r7 + 4
int r6 = r6 * 5
byte[] r0 = com.facetec.sdk.av.c
int r5 = r5 * 6
int r5 = r5 + 97
int r1 = 23 - r6
byte[] r1 = new byte[r1]
int r6 = 22 - r6
r2 = 0
if (r0 != 0) goto L17
r4 = r5
r5 = r6
r3 = r2
goto L2b
L17:
r3 = r2
L18:
int r7 = r7 + 1
byte r4 = (byte) r5
r1[r3] = r4
if (r3 != r6) goto L27
java.lang.String r5 = new java.lang.String
r5.<init>(r1, r2)
r8[r2] = r5
return
L27:
r4 = r0[r7]
int r3 = r3 + 1
L2b:
int r5 = r5 + r4
int r5 = r5 + (-8)
goto L18
*/
throw new UnsupportedOperationException("Method not decompiled: com.facetec.sdk.av.f(int, byte, byte, java.lang.Object[]):void");
}
av() {
}
/* JADX INFO: Access modifiers changed from: package-private */
public static float a(int i) {
return i / (Resources.getSystem().getDisplayMetrics().densityDpi / 160.0f);
}
/* JADX INFO: Access modifiers changed from: package-private */
public static float b(int i) {
return TypedValue.applyDimension(1, i, Resources.getSystem().getDisplayMetrics());
}
/* JADX INFO: Access modifiers changed from: package-private */
public static float c(int i) {
return TypedValue.applyDimension(2, i, Resources.getSystem().getDisplayMetrics());
}
/* JADX INFO: Access modifiers changed from: package-private */
public static String d(Context context) {
PackageManager packageManager = context.getPackageManager();
ApplicationInfo applicationInfo = null;
try {
try {
byte[] bArr = c;
byte b2 = bArr[41];
byte b3 = b2;
Object[] objArr = new Object[1];
f(b2, b3, (byte) (b3 - 1), objArr);
Class<?> cls = Class.forName((String) objArr[0]);
byte b4 = (byte) (bArr[8] - 1);
Object[] objArr2 = new Object[1];
f(b4, b4, bArr[4], objArr2);
applicationInfo = packageManager.getApplicationInfo((String) PackageItemInfo.class.getField(CommonConstant.ReqAccessTokenParam.PACKAGE_NAME).get((ApplicationInfo) cls.getMethod((String) objArr2[0], null).invoke(context, null)), 0);
} catch (Throwable th) {
Throwable cause = th.getCause();
if (cause != null) {
throw cause;
}
throw th;
}
} catch (PackageManager.NameNotFoundException unused) {
}
return (String) (applicationInfo != null ? packageManager.getApplicationLabel(applicationInfo) : "Unknown");
}
/* JADX INFO: Access modifiers changed from: package-private */
public static void c(Activity activity) {
View findViewById = activity.findViewById(R.id.backgroundColor);
if (findViewById != null) {
findViewById.setVisibility(4);
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public static void c(View view) {
ViewCompat.e(view, new yZt() { // from class: com.facetec.sdk.av.4
@Override // o.yZt
public final void onInitializeAccessibilityNodeInfo(View view2, AccessibilityNodeInfoCompat accessibilityNodeInfoCompat) {
super.onInitializeAccessibilityNodeInfo(view2, accessibilityNodeInfoCompat);
accessibilityNodeInfoCompat.a(AccessibilityNodeInfoCompat.AccessibilityActionCompat.e);
accessibilityNodeInfoCompat.d(false);
}
});
}
/* JADX INFO: Access modifiers changed from: package-private */
public static String c(int i, int i2) {
return bl.a(d(i, i2));
}
/* JADX INFO: Access modifiers changed from: package-private */
public static byte[] d(int i, int i2) {
SecureRandom secureRandom = new SecureRandom();
if (i2 != 0) {
i += secureRandom.nextInt(i2 + 1);
}
byte[] bArr = new byte[i];
secureRandom.nextBytes(bArr);
return bArr;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static WindowManager e(Context context) {
if (context instanceof Activity) {
return ((Activity) context).getWindowManager();
}
WindowManager windowManager = (WindowManager) context.getSystemService("window");
if (e || windowManager != null) {
return windowManager;
}
throw new AssertionError();
}
/* JADX INFO: Access modifiers changed from: package-private */
public static int c(Context context) {
int rotation = e(context).getDefaultDisplay().getRotation();
if (rotation != 1) {
return rotation != 2 ? rotation != 3 ? 1 : 8 : (Build.MODEL.contains("Mi MIX 2") || Build.MODEL.contains("RCT6773W22BM")) ? 1 : 9;
}
return 0;
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public static final class a {
private int a;
private int e;
/* JADX INFO: Access modifiers changed from: package-private */
public a(int i, int i2) {
this.a = i;
this.e = i2;
}
final int d() {
return this.e;
}
/* JADX INFO: Access modifiers changed from: package-private */
public final int c() {
return this.a;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public static a e(String str, int i, Typeface typeface) {
return e(str, i, typeface, new Paint());
}
private static a e(String str, int i, Typeface typeface, Paint paint) {
paint.setTextSize(i);
paint.setTypeface(typeface);
paint.setFlags(1);
paint.setTextAlign(Paint.Align.LEFT);
paint.setAntiAlias(true);
int round = Math.round(paint.measureText(str));
Paint.FontMetrics fontMetrics = paint.getFontMetrics();
return new a(round, Math.round(fontMetrics.descent - fontMetrics.ascent));
}
/* JADX INFO: Access modifiers changed from: package-private */
public static int c(TextView textView, a aVar, int i, int i2) {
int ceil;
Typeface typeface = textView.getTypeface();
String obj = textView.getText().toString();
if (obj.contains("\n")) {
obj = obj.substring(0, obj.indexOf("\n"));
}
int i3 = i2 - i;
Paint paint = new Paint();
do {
i3--;
ceil = (int) Math.ceil((i2 + i) / 2.0d);
a e2 = e(obj, ceil, typeface, paint);
if (e2.c() > aVar.c() || e2.d() > aVar.d()) {
i2 = ceil - 1;
} else {
i = ceil;
}
if (i == i2) {
break;
}
} while (i3 > 0);
return ceil - 1;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static Fragment a(Activity activity) {
FragmentManager fragmentManager;
List<Fragment> fragments;
if (activity != null && (fragmentManager = activity.getFragmentManager()) != null && (fragments = fragmentManager.getFragments()) != null) {
for (Fragment fragment : fragments) {
if (fragment != null && fragment.isVisible()) {
return fragment;
}
}
}
return null;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static AnimatedVectorDrawableCompat e(Activity activity, int i) {
AnimatedVectorDrawableCompat c2 = AnimatedVectorDrawableCompat.c(activity, i);
if (!e && c2 == null) {
throw new AssertionError();
}
return (AnimatedVectorDrawableCompat) c2.mutate();
}
/* JADX INFO: Access modifiers changed from: package-private */
public static boolean b(Activity activity) {
return (activity == null || activity.isFinishing()) ? false : true;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static boolean c(String[] strArr) {
for (String str : strArr) {
if (Locale.getDefault().getLanguage().contains(str)) {
return true;
}
}
return false;
}
static void e() {
c = new byte[]{Ascii.US, -63, 87, -52, Ascii.NAK, -2, Ascii.SYN, 5, 2, 3, ISO7816.INS_WRITE_RECORD, 61, Ascii.DC4, 7, 14, -7, 17, 14, ISO7816.INS_ENVELOPE, 29, ISO7816.INS_DECREASE_STAMPED, 7, 14, -7, Ascii.ESC, 4, 6, Ascii.ETB, -43, 55, 8, 4, 5, 2, 6, Ascii.ESC, -3, 14, 7, -29, 45, 0, 17};
b = CipherSuite.TLS_DHE_RSA_WITH_SEED_CBC_SHA;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static String e(String str) {
return str == null ? "Unknown Error" : str;
}
static {
e();
e = true;
}
}