package ep3; import ai.clova.cic.clientlib.api.ClovaEnvironment; import androidx.preference.h; import gp3.b; import gp3.d; import gp3.e; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.Set; import java.util.concurrent.LinkedBlockingQueue; import org.slf4j.impl.StaticLoggerBinder; import um3.l0; public final class c { /* renamed from: a reason: collision with root package name */ public static volatile int f69021a; /* renamed from: b reason: collision with root package name */ public static final e f69022b = new e(); /* renamed from: c reason: collision with root package name */ public static final l0 f69023c = new l0(); /* renamed from: d reason: collision with root package name */ public static boolean f69024d; /* renamed from: e reason: collision with root package name */ public static final String[] f69025e = {"1.6", "1.7"}; /* renamed from: f reason: collision with root package name */ public static String f69026f = "org/slf4j/impl/StaticLoggerBinder.class"; static { boolean z14; String str = null; try { str = System.getProperty("slf4j.detectLoggerNameMismatch"); } catch (SecurityException unused) { } if (str == null) { z14 = false; } else { z14 = str.equalsIgnoreCase(ClovaEnvironment.TRUE); } f69024d = z14; } /* JADX WARNING: Code restructure failed: missing block: B:27:0x0066, code lost: if (r3.contains("org.slf4j.impl.StaticLoggerBinder") != false) goto L_0x0068; */ public static final void a() { Set<URL> set; try { if (!e()) { set = b(); h(set); } else { set = null; } StaticLoggerBinder.getSingleton(); f69021a = 3; g(set); } catch (NoClassDefFoundError e14) { String message = e14.getMessage(); boolean z14 = false; if (message != null) { if (message.contains("org/slf4j/impl/StaticLoggerBinder")) { } z14 = true; } if (z14) { f69021a = 4; h.a("Failed to load class \"org.slf4j.impl.StaticLoggerBinder\"."); h.a("Defaulting to no-operation (NOP) logger implementation"); h.a("See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details."); } else { f69021a = 2; h.b("Failed to instantiate SLF4J LoggerFactory", e14); throw e14; } } catch (NoSuchMethodError e15) { String message2 = e15.getMessage(); if (message2 != null && message2.contains("org.slf4j.impl.StaticLoggerBinder.getSingleton()")) { f69021a = 2; h.a("slf4j-api 1.6.x (or later) is incompatible with this binding."); h.a("Your binding is version 1.5.5 or earlier."); h.a("Upgrade your binding to version 1.6.x."); } throw e15; } catch (Exception e16) { f69021a = 2; h.b("Failed to instantiate SLF4J LoggerFactory", e16); throw new IllegalStateException("Unexpected initialization failure", e16); } catch (Throwable th4) { f(); throw th4; } f(); } public static Set<URL> b() { Enumeration<URL> enumeration; LinkedHashSet linkedHashSet = new LinkedHashSet(); try { ClassLoader classLoader = c.class.getClassLoader(); if (classLoader == null) { enumeration = ClassLoader.getSystemResources(f69026f); } else { enumeration = classLoader.getResources(f69026f); } while (enumeration.hasMoreElements()) { linkedHashSet.add(enumeration.nextElement()); } } catch (IOException e14) { h.b("Error getting resources from path", e14); } return linkedHashSet; } public static a c() { if (f69021a == 0) { synchronized (c.class) { if (f69021a == 0) { f69021a = 1; a(); if (f69021a == 3) { i(); } } } } int i14 = f69021a; if (i14 == 1) { return f69022b; } if (i14 == 2) { throw new IllegalStateException("org.slf4j.LoggerFactory in failed state. Original exception was thrown EARLIER. See also http://www.slf4j.org/codes.html#unsuccessfulInit"); } else if (i14 == 3) { return StaticLoggerBinder.getSingleton().getLoggerFactory(); } else { if (i14 == 4) { return f69023c; } throw new IllegalStateException("Unreachable code"); } } public static b d(String str) { return c().a(str); } public static boolean e() { String str; try { str = System.getProperty("java.vendor.url"); } catch (SecurityException unused) { str = null; } if (str == null) { return false; } return str.toLowerCase().contains("android"); } public static void f() { e eVar = f69022b; synchronized (eVar) { eVar.f77572b = true; Iterator it3 = new ArrayList(eVar.f77573c.values()).iterator(); while (it3.hasNext()) { d dVar = (d) it3.next(); dVar.f77566c = d(dVar.f77565b); } } LinkedBlockingQueue<fp3.c> linkedBlockingQueue = f69022b.f77574d; int size = linkedBlockingQueue.size(); ArrayList arrayList = new ArrayList(128); int i14 = 0; while (linkedBlockingQueue.drainTo(arrayList, 128) != 0) { Iterator it4 = arrayList.iterator(); while (it4.hasNext()) { fp3.c cVar = (fp3.c) it4.next(); if (cVar != null) { d dVar2 = cVar.f72912a; String str = dVar2.f77565b; if (dVar2.f77566c == null) { throw new IllegalStateException("Delegate logger cannot be null at this state."); } else if (!(dVar2.f77566c instanceof b)) { if (!dVar2.b()) { h.a(str); } else if (dVar2.b()) { try { dVar2.f77568e.invoke(dVar2.f77566c, cVar); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException unused) { } } } } int i15 = i14 + 1; if (i14 == 0) { if (cVar.f72912a.b()) { h.a("A number (" + size + ") of logging calls during the initialization phase have been intercepted and are"); h.a("now being replayed. These are subject to the filtering rules of the underlying logging system."); h.a("See also http://www.slf4j.org/codes.html#replay"); } else if (!(cVar.f72912a.f77566c instanceof b)) { h.a("The following set of substitute loggers may have been accessed"); h.a("during the initialization phase. Logging calls during this"); h.a("phase were not honored. However, subsequent logging calls to these"); h.a("loggers will work as normally expected."); h.a("See also http://www.slf4j.org/codes.html#substituteLogger"); } } i14 = i15; } arrayList.clear(); } e eVar2 = f69022b; eVar2.f77573c.clear(); eVar2.f77574d.clear(); } public static void g(Set<URL> set) { if (set != null) { boolean z14 = true; if (set.size() <= 1) { z14 = false; } if (z14) { StringBuilder a14 = b.d.a("Actual binding is of type ["); a14.append(StaticLoggerBinder.getSingleton().getLoggerFactoryClassStr()); a14.append("]"); h.a(a14.toString()); } } } public static void h(Set<URL> set) { boolean z14 = true; if (set.size() <= 1) { z14 = false; } if (z14) { h.a("Class path contains multiple SLF4J bindings."); Iterator<URL> it3 = set.iterator(); while (it3.hasNext()) { h.a("Found binding in [" + it3.next() + "]"); } h.a("See http://www.slf4j.org/codes.html#multiple_bindings for an explanation."); } } public static final void i() { try { String str = StaticLoggerBinder.REQUESTED_API_VERSION; boolean z14 = false; for (String str2 : f69025e) { if (str.startsWith(str2)) { z14 = true; } } if (!z14) { h.a("The requested version " + str + " by your slf4j binding is not compatible with " + Arrays.asList(f69025e).toString()); h.a("See http://www.slf4j.org/codes.html#version_mismatch for further details."); } } catch (NoSuchFieldError unused) { } catch (Throwable th4) { h.b("Unexpected problem occured during version sanity check", th4); } } }