what-the-bank/sources/com/kofax/mobile/sdk/ag/a.java

531 lines
16 KiB
Java

package com.kofax.mobile.sdk.ag;
import android.os.Environment;
import android.text.TextUtils;
import android.text.format.DateFormat;
import com.kofax.mobile.sdk._internal.k;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import o.InterfaceC13391fZD;
/* loaded from: classes3.dex */
public class a implements com.kofax.mobile.sdk.ak.b {
private static final int UX = 4000;
public File Vd;
public final String UT = "kofax_mobile_sdk";
public final EnumC0061a UU = EnumC0061a.VERBOSE;
private final boolean UV = false;
private final Map<String, Boolean> UW = new HashMap();
private final String UY = ")";
private final String UZ = "> (";
private final String Va = " > ";
public final String Vb = "/.kofax_mobile_sdk.txt";
public final String DATE_FORMAT = "dd.MM.yyyy_kk.mm.ss";
private final Object[] Vc = new Object[0];
private void J(String str, String str2) {
}
private void K(String str, String str2) {
}
private void L(String str, String str2) {
}
private void M(String str, String str2) {
}
private void N(String str, String str2) {
}
@InterfaceC13391fZD
public a() {
StringBuilder sb = new StringBuilder();
sb.append(Environment.getExternalStorageDirectory().getAbsolutePath());
sb.append("/.kofax_mobile_sdk.txt");
this.Vd = new File(sb.toString());
}
@Override // com.kofax.mobile.sdk.ak.b
public void c(String str, boolean z) {
this.UW.put(str, Boolean.valueOf(z));
}
@Override // com.kofax.mobile.sdk.ak.b
public void B(String str) {
StringBuilder sb = new StringBuilder();
sb.append(getLocation());
sb.append(" ");
sb.append(str);
a("kofax_mobile_sdk", sb.toString());
}
@Override // com.kofax.mobile.sdk.ak.b
public void C(String str) {
StringBuilder sb = new StringBuilder();
sb.append(getLocation());
sb.append(" ");
sb.append(str);
b("kofax_mobile_sdk", sb.toString());
}
@Override // com.kofax.mobile.sdk.ak.b
public void D(String str) {
StringBuilder sb = new StringBuilder();
sb.append(getLocation());
sb.append(" ");
sb.append(str);
c("kofax_mobile_sdk", sb.toString());
}
@Override // com.kofax.mobile.sdk.ak.b
public void E(String str) {
StringBuilder sb = new StringBuilder();
sb.append(getLocation());
sb.append(" ");
sb.append(str);
d("kofax_mobile_sdk", sb.toString());
}
@Override // com.kofax.mobile.sdk.ak.b
public void F(String str) {
StringBuilder sb = new StringBuilder();
sb.append(getLocation());
sb.append(" ");
sb.append(str);
e("kofax_mobile_sdk", sb.toString());
}
@Override // com.kofax.mobile.sdk.ak.b
public void a(String str, Throwable th) {
StringBuilder sb = new StringBuilder();
sb.append(getLocation());
sb.append(" ");
sb.append(str);
a("kofax_mobile_sdk", sb.toString(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void b(String str, Throwable th) {
StringBuilder sb = new StringBuilder();
sb.append(getLocation());
sb.append(" ");
sb.append(str);
b("kofax_mobile_sdk", sb.toString(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void c(String str, Throwable th) {
StringBuilder sb = new StringBuilder();
sb.append(getLocation());
sb.append(" ");
sb.append(str);
c("kofax_mobile_sdk", sb.toString(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void d(String str, Throwable th) {
StringBuilder sb = new StringBuilder();
sb.append(getLocation());
sb.append(" ");
sb.append(str);
d("kofax_mobile_sdk", sb.toString(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void e(String str, Throwable th) {
StringBuilder sb = new StringBuilder();
sb.append(getLocation());
sb.append(" ");
sb.append(str);
e("kofax_mobile_sdk", sb.toString(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void a(Throwable th) {
a("kofax_mobile_sdk", getLocation(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void b(Throwable th) {
b("kofax_mobile_sdk", getLocation(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void c(Throwable th) {
c("kofax_mobile_sdk", getLocation(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void d(Throwable th) {
d("kofax_mobile_sdk", getLocation(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void e(Throwable th) {
e("kofax_mobile_sdk", getLocation(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void c(Object obj, String str) {
StringBuilder sb = new StringBuilder("> (");
sb.append(obj.getClass().getSimpleName());
sb.append(")");
sb.append(getLocation());
sb.append(" ");
sb.append(str);
a("kofax_mobile_sdk", sb.toString());
}
@Override // com.kofax.mobile.sdk.ak.b
public void d(Object obj, String str) {
StringBuilder sb = new StringBuilder("> (");
sb.append(obj.getClass().getSimpleName());
sb.append(")");
sb.append(getLocation());
sb.append(" ");
sb.append(str);
b("kofax_mobile_sdk", sb.toString());
}
@Override // com.kofax.mobile.sdk.ak.b
public void e(Object obj, String str) {
StringBuilder sb = new StringBuilder("> (");
sb.append(obj.getClass().getSimpleName());
sb.append(")");
sb.append(getLocation());
sb.append(" ");
sb.append(str);
c("kofax_mobile_sdk", sb.toString());
}
@Override // com.kofax.mobile.sdk.ak.b
public void f(Object obj, String str) {
StringBuilder sb = new StringBuilder("> (");
sb.append(obj.getClass().getSimpleName());
sb.append(")");
sb.append(getLocation());
sb.append(" ");
sb.append(str);
d("kofax_mobile_sdk", sb.toString());
}
@Override // com.kofax.mobile.sdk.ak.b
public void g(Object obj, String str) {
StringBuilder sb = new StringBuilder("> (");
sb.append(obj.getClass().getSimpleName());
sb.append(")");
sb.append(getLocation());
sb.append(" ");
sb.append(str);
e("kofax_mobile_sdk", sb.toString());
}
@Override // com.kofax.mobile.sdk.ak.b
public void a(Object obj, String str, Throwable th) {
StringBuilder sb = new StringBuilder("> (");
sb.append(obj.getClass().getSimpleName());
sb.append(")");
sb.append(getLocation());
sb.append(" ");
sb.append(str);
a("kofax_mobile_sdk", sb.toString(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void b(Object obj, String str, Throwable th) {
StringBuilder sb = new StringBuilder("> (");
sb.append(obj.getClass().getSimpleName());
sb.append(")");
sb.append(getLocation());
sb.append(" ");
sb.append(str);
b("kofax_mobile_sdk", sb.toString(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void c(Object obj, String str, Throwable th) {
StringBuilder sb = new StringBuilder("> (");
sb.append(obj.getClass().getSimpleName());
sb.append(")");
sb.append(getLocation());
sb.append(" ");
sb.append(str);
c("kofax_mobile_sdk", sb.toString(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void d(Object obj, String str, Throwable th) {
StringBuilder sb = new StringBuilder("> (");
sb.append(obj.getClass().getSimpleName());
sb.append(")");
sb.append(getLocation());
sb.append(" ");
sb.append(str);
d("kofax_mobile_sdk", sb.toString(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void e(Object obj, String str, Throwable th) {
StringBuilder sb = new StringBuilder("> (");
sb.append(obj.getClass().getSimpleName());
sb.append(")");
sb.append(getLocation());
sb.append(" ");
sb.append(str);
e("kofax_mobile_sdk", sb.toString(), th);
}
@Override // com.kofax.mobile.sdk.ak.b
public void a(String str, String str2) {
if (this.UU.rx() && ru()) {
J(str, str2);
}
}
@Override // com.kofax.mobile.sdk.ak.b
public void b(String str, String str2) {
if (this.UU.ry() && ru()) {
K(str, str2);
}
}
@Override // com.kofax.mobile.sdk.ak.b
public void c(String str, String str2) {
if (this.UU.rz() && ru()) {
L(str, str2);
}
}
@Override // com.kofax.mobile.sdk.ak.b
public void d(String str, String str2) {
if (this.UU.rA() && ru()) {
M(str, str2);
}
}
@Override // com.kofax.mobile.sdk.ak.b
public void e(String str, String str2) {
if (this.UU.rB() && ru()) {
N(str, str2);
}
}
@Override // com.kofax.mobile.sdk.ak.b
public void a(String str, String str2, Throwable th) {
if (this.UU.rx() && ru()) {
f(str, str2, th);
}
}
@Override // com.kofax.mobile.sdk.ak.b
public void b(String str, String str2, Throwable th) {
if (this.UU.ry() && ru()) {
g(str, str2, th);
}
}
@Override // com.kofax.mobile.sdk.ak.b
public void c(String str, String str2, Throwable th) {
if (this.UU.rz() && ru()) {
h(str, str2, th);
}
}
@Override // com.kofax.mobile.sdk.ak.b
public void d(String str, String str2, Throwable th) {
if (this.UU.rA() && ru()) {
i(str, str2, th);
}
}
@Override // com.kofax.mobile.sdk.ak.b
public void e(String str, String str2, Throwable th) {
if (this.UU.rB() && ru()) {
j(str, str2, th);
}
}
private void f(String str, String str2, Throwable th) {
if (str2.length() > UX) {
J(str, str2.substring(UX));
}
}
private void g(String str, String str2, Throwable th) {
if (str2.length() > UX) {
K(str, str2.substring(UX));
}
}
private void h(String str, String str2, Throwable th) {
if (str2.length() > UX) {
L(str, str2.substring(UX));
}
}
private void i(String str, String str2, Throwable th) {
if (str2.length() > UX) {
M(str, str2.substring(UX));
}
}
private void j(String str, String str2, Throwable th) {
if (str2.length() > UX) {
N(str, str2.substring(UX));
}
}
/* renamed from: com.kofax.mobile.sdk.ag.a$a, reason: collision with other inner class name */
/* loaded from: classes3.dex */
public enum EnumC0061a {
VERBOSE(5),
DEBUG(4),
INFO(3),
WARNING(2),
ERROR(1),
NONE(0);
private final int level;
EnumC0061a(int i) {
this.level = i;
}
public final boolean rx() {
return this.level == VERBOSE.level;
}
public final boolean ry() {
return this.level >= DEBUG.level;
}
public final boolean rz() {
return this.level >= INFO.level;
}
public final boolean rA() {
return this.level >= WARNING.level;
}
public final boolean rB() {
return this.level >= ERROR.level;
}
}
private String getLocation() {
String str = ":";
String name = a.class.getName();
boolean z = false;
for (StackTraceElement stackTraceElement : Thread.currentThread().getStackTrace()) {
if (z) {
try {
if (!stackTraceElement.getClassName().startsWith(name) && !stackTraceElement.getClassName().equals(k.class.getName())) {
Class<?> cls = Class.forName(stackTraceElement.getClassName());
StringBuilder sb = new StringBuilder();
sb.append(" > ");
sb.append(a(cls));
sb.append(str);
sb.append(stackTraceElement.getMethodName());
sb.append(str);
sb.append(stackTraceElement.getLineNumber());
str = sb.toString();
return str;
}
} catch (ClassNotFoundException unused) {
continue;
}
} else if (stackTraceElement.getClassName().startsWith(name)) {
z = true;
}
}
return "[]: ";
}
private boolean ru() {
String rv = rv();
for (String str : this.UW.keySet()) {
if (rv.startsWith(str)) {
return this.UW.get(str).booleanValue();
}
}
return false;
}
private static String rv() {
String name = a.class.getName();
boolean z = false;
for (StackTraceElement stackTraceElement : Thread.currentThread().getStackTrace()) {
if (z) {
try {
if (!stackTraceElement.getClassName().startsWith(name) && !stackTraceElement.getClassName().equals(k.class.getName())) {
name = getPackageName(Class.forName(stackTraceElement.getClassName()));
return name;
}
} catch (ClassNotFoundException unused) {
continue;
}
} else if (stackTraceElement.getClassName().startsWith(name)) {
z = true;
}
}
return "[]: ";
}
private static String a(Class<?> cls) {
while (cls != null) {
if (!TextUtils.isEmpty(cls.getSimpleName())) {
return cls.getSimpleName();
}
cls = cls.getEnclosingClass();
}
return "";
}
private static String getPackageName(Class<?> cls) {
while (cls != null) {
if (!TextUtils.isEmpty(cls.getPackage().getName())) {
return cls.getPackage().getName();
}
cls = cls.getEnclosingClass();
}
return "";
}
private boolean b(String... strArr) {
boolean z = false;
try {
synchronized (this.Vc) {
File file = this.Vd;
if (file != null) {
file.createNewFile();
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(this.Vd, true), 1024);
for (String str : strArr) {
StringBuilder sb = new StringBuilder();
sb.append(str);
sb.append(";");
bufferedWriter.write(sb.toString());
}
bufferedWriter.write("\n");
bufferedWriter.close();
z = true;
}
}
} catch (IOException unused) {
}
return z;
}
public String rw() {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date(System.currentTimeMillis()));
return DateFormat.format("dd.MM.yyyy_kk.mm.ss", calendar).toString();
}
}