得物.apk(点击下载) / a.java


package rm1;

import a.f;
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.ILoggerFactory;
import org.slf4j.Logger;
import org.slf4j.helpers.NOPLogger;
import tm1.b;
import tm1.c;
import tm1.d;
import tm1.e;

/* compiled from: LoggerFactory */
public final class a {
    private static final String[] API_COMPATIBILITY_LIST = {"1.6", "1.7"};
    private static String STATIC_LOGGER_BINDER_PATH = "org/slf4j/impl/StaticLoggerBinder.class";

    /* renamed from: a  reason: collision with root package name */
    public static volatile int f37796a;
    public static final d b = new d();

    /* renamed from: c  reason: collision with root package name */
    public static final b f37797c = new b();
    public static boolean d;

    static {
        boolean z;
        String str = null;
        try {
            str = System.getProperty("slf4j.detectLoggerNameMismatch");
        } catch (SecurityException unused) {
        }
        if (str == null) {
            z = false;
        } else {
            z = str.equalsIgnoreCase("true");
        }
        d = z;
    }

    public static Set<URL> a() {
        Enumeration<URL> enumeration;
        LinkedHashSet linkedHashSet = new LinkedHashSet();
        try {
            ClassLoader classLoader = a.class.getClassLoader();
            if (classLoader == null) {
                enumeration = ClassLoader.getSystemResources(STATIC_LOGGER_BINDER_PATH);
            } else {
                enumeration = classLoader.getResources(STATIC_LOGGER_BINDER_PATH);
            }
            while (enumeration.hasMoreElements()) {
                linkedHashSet.add(enumeration.nextElement());
            }
        } catch (IOException e) {
            e.c("Error getting resources from path", e);
        }
        return linkedHashSet;
    }

    public static void b() {
        d dVar = b;
        synchronized (dVar) {
            dVar.f38611a = true;
            Iterator it2 = new ArrayList(dVar.b.values()).iterator();
            while (it2.hasNext()) {
                c cVar = (c) it2.next();
                cVar.f38608c = e(cVar.b);
            }
        }
    }

    public static ILoggerFactory c() {
        if (f37796a == 0) {
            synchronized (a.class) {
                if (f37796a == 0) {
                    f37796a = 1;
                    g();
                }
            }
        }
        int i = f37796a;
        if (i == 1) {
            return b;
        }
        if (i == 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 (i == 3) {
            return um1.b.a().f39032a;
        } else {
            if (i == 4) {
                return f37797c;
            }
            throw new IllegalStateException("Unreachable code");
        }
    }

    public static Logger d(Class<?> cls) {
        Class<?> a5;
        Logger e = e(cls.getName());
        if (d && (a5 = e.a()) != null && (!a5.isAssignableFrom(cls))) {
            e.b(String.format("Detected logger name mismatch. Given name: \"%s\"; computed name: \"%s\".", e.getName(), a5.getName()));
            e.b("See http://www.slf4j.org/codes.html#loggerNameMismatch for an explanation");
        }
        return e;
    }

    public static Logger e(String str) {
        return c().getLogger(str);
    }

    public static boolean f() {
        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 final void g() {
        Set<URL> set = null;
        try {
            if (!f()) {
                set = a();
                j(set);
            }
            String str = um1.b.b;
            f37796a = 3;
            i(set);
            b();
            h();
            d dVar = b;
            dVar.b.clear();
            dVar.f38612c.clear();
        } catch (NoClassDefFoundError e) {
            String message = e.getMessage();
            if (message != null && (message.contains("org/slf4j/impl/StaticLoggerBinder") || message.contains("org.slf4j.impl.StaticLoggerBinder"))) {
                f37796a = 4;
                e.b("Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".");
                e.b("Defaulting to no-operation (NOP) logger implementation");
                e.b("See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.");
            } else {
                f37796a = 2;
                e.c("Failed to instantiate SLF4J LoggerFactory", e);
                throw e;
            }
        } catch (NoSuchMethodError e6) {
            String message2 = e6.getMessage();
            if (message2 != null && message2.contains("org.slf4j.impl.StaticLoggerBinder.getSingleton()")) {
                f37796a = 2;
                e.b("slf4j-api 1.6.x (or later) is incompatible with this binding.");
                e.b("Your binding is version 1.5.5 or earlier.");
                e.b("Upgrade your binding to version 1.6.x.");
            }
            throw e6;
        } catch (Exception e12) {
            f37796a = 2;
            e.c("Failed to instantiate SLF4J LoggerFactory", e12);
            throw new IllegalStateException("Unexpected initialization failure", e12);
        }
        if (f37796a == 3) {
            try {
                String str2 = um1.b.b;
                boolean z = false;
                for (String str3 : API_COMPATIBILITY_LIST) {
                    if (str2.startsWith(str3)) {
                        z = true;
                    }
                }
                if (!z) {
                    e.b("The requested version " + str2 + " by your slf4j binding is not compatible with " + Arrays.asList(API_COMPATIBILITY_LIST).toString());
                    e.b("See http://www.slf4j.org/codes.html#version_mismatch for further details.");
                }
            } catch (NoSuchFieldError unused) {
            } catch (Throwable th2) {
                e.c("Unexpected problem occured during version sanity check", th2);
            }
        }
    }

    public static void h() {
        LinkedBlockingQueue<sm1.b> linkedBlockingQueue = b.f38612c;
        int size = linkedBlockingQueue.size();
        ArrayList arrayList = new ArrayList(128);
        int i = 0;
        while (linkedBlockingQueue.drainTo(arrayList, 128) != 0) {
            Iterator it2 = arrayList.iterator();
            while (it2.hasNext()) {
                sm1.b bVar = (sm1.b) it2.next();
                if (bVar != null) {
                    c cVar = bVar.d;
                    String str = cVar.b;
                    if (cVar.f38608c == null) {
                        throw new IllegalStateException("Delegate logger cannot be null at this state.");
                    } else if (!(cVar.f38608c instanceof NOPLogger)) {
                        if (!cVar.b()) {
                            e.b(str);
                        } else if (cVar.b()) {
                            try {
                                cVar.e.invoke(cVar.f38608c, bVar);
                            } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException unused) {
                            }
                        }
                    }
                }
                int i3 = i + 1;
                if (i == 0) {
                    if (bVar.d.b()) {
                        e.b("A number (" + size + ") of logging calls during the initialization phase have been intercepted and are");
                        e.b("now being replayed. These are subject to the filtering rules of the underlying logging system.");
                        e.b("See also http://www.slf4j.org/codes.html#replay");
                    } else if (!(bVar.d.f38608c instanceof NOPLogger)) {
                        e.b("The following set of substitute loggers may have been accessed");
                        e.b("during the initialization phase. Logging calls during this");
                        e.b("phase were not honored. However, subsequent logging calls to these");
                        e.b("loggers will work as normally expected.");
                        e.b("See also http://www.slf4j.org/codes.html#substituteLogger");
                    }
                }
                i = i3;
            }
            arrayList.clear();
        }
    }

    public static void i(Set<URL> set) {
        if (set != null) {
            boolean z = true;
            if (set.size() <= 1) {
                z = false;
            }
            if (z) {
                StringBuilder h12 = f.h("Actual binding is of type [");
                h12.append(um1.b.a().getLoggerFactoryClassStr());
                h12.append("]");
                e.b(h12.toString());
            }
        }
    }

    public static void j(Set<URL> set) {
        boolean z = true;
        if (set.size() <= 1) {
            z = false;
        }
        if (z) {
            e.b("Class path contains multiple SLF4J bindings.");
            Iterator<URL> it2 = set.iterator();
            while (it2.hasNext()) {
                e.b("Found binding in [" + it2.next() + "]");
            }
            e.b("See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.");
        }
    }
}