小红书.apk(点击下载) / e.java


package vu0;

import android.content.Context;
import android.content.res.Resources;
import android.os.Build;
import android.util.AttributeSet;
import android.view.InflateException;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewStub;
import java.lang.reflect.Constructor;
import java.util.Arrays;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;

@Metadata(bv = {}, d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0004\b\u0000\u0018\u00002\u00020\u0001:\u0001\u000eB\u000f\u0012\u0006\u0010\u000f\u001a\u00020\u0002¢\u0006\u0004\b\u0017\u0010\u0018J\u0010\u0010\u0004\u001a\u00020\u00012\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u001a\u0010\n\u001a\u0004\u0018\u00010\t2\u0006\u0010\u0006\u001a\u00020\u00052\u0006\u0010\b\u001a\u00020\u0007H\u0014J&\u0010\f\u001a\u0004\u0018\u00010\t2\u0006\u0010\u0006\u001a\u00020\u00052\b\u0010\u000b\u001a\u0004\u0018\u00010\u00052\b\u0010\b\u001a\u0004\u0018\u00010\u0007H\u0002J.\u0010\u000e\u001a\u0004\u0018\u00010\t2\u0006\u0010\r\u001a\u00020\u00022\u0006\u0010\u0006\u001a\u00020\u00052\b\u0010\u000b\u001a\u0004\u0018\u00010\u00052\b\u0010\b\u001a\u0004\u0018\u00010\u0007H\u0002J,\u0010\u0011\u001a\u00020\u00102\u0006\u0010\u0006\u001a\u00020\u00052\b\u0010\u000b\u001a\u0004\u0018\u00010\u00052\u0006\u0010\u000f\u001a\u00020\u00022\b\u0010\b\u001a\u0004\u0018\u00010\u0007H\u0002J\u001c\u0010\u0012\u001a\u0004\u0018\u00010\u00052\u0006\u0010\u000f\u001a\u00020\u00022\b\u0010\b\u001a\u0004\u0018\u00010\u0007H\u0002J\u001a\u0010\u0016\u001a\u00020\u00152\u0010\u0010\u0014\u001a\f\u0012\b\b\u0001\u0012\u0004\u0018\u00010\t0\u0013H\u0002¨\u0006\u0019"}, d2 = {"Lvu0/e;", "Landroid/view/LayoutInflater;", "Landroid/content/Context;", "newContext", "cloneInContext", "", "name", "Landroid/util/AttributeSet;", "attrs", "Landroid/view/View;", "onCreateView", "prefix", "b", "viewContext", "a", "context", "", "c", "d", "Ljava/lang/reflect/Constructor;", "constructor", "", "e", "<init>", "(Landroid/content/Context;)V", "library-ext-async_release"}, k = 1, mv = {1, 4, 0})
/* compiled from: BasicInflater.kt */
public final class e extends LayoutInflater {

    /* renamed from: c  reason: collision with root package name */
    public static final ClassLoader f141643c = LayoutInflater.class.getClassLoader();

    /* renamed from: d  reason: collision with root package name */
    public static final StackTraceElement[] f141644d = new StackTraceElement[0];

    /* renamed from: e  reason: collision with root package name */
    public static final String[] f141645e = {"android.widget.", "android.webkit.", "android.app."};

    /* renamed from: f  reason: collision with root package name */
    public static final Class<? extends Object>[] f141646f = {Context.class, AttributeSet.class};

    /* renamed from: g  reason: collision with root package name */
    public static final ConcurrentHashMap<String, Constructor<? extends View>> f141647g = new ConcurrentHashMap<>();

    /* renamed from: h  reason: collision with root package name */
    public static final a f141648h = new a(null);

    /* renamed from: a  reason: collision with root package name */
    public final ConcurrentHashMap<Integer, Object> f141649a = new ConcurrentHashMap<>();

    /* renamed from: b  reason: collision with root package name */
    public final ConcurrentHashMap<String, Boolean> f141650b = new ConcurrentHashMap<>();

    @Metadata(bv = {}, d1 = {"\u0000<\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0011\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\b†\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0015\u0010\u0016R\u001c\u0010\u0004\u001a\n \u0003*\u0004\u0018\u00010\u00020\u00028\u0002X‚\u0004¢\u0006\u0006\n\u0004\b\u0004\u0010\u0005R\u001a\u0010\b\u001a\b\u0012\u0004\u0012\u00020\u00070\u00068\u0002X‚\u0004¢\u0006\u0006\n\u0004\b\b\u0010\tR\"\u0010\u000b\u001a\u0010\u0012\f\u0012\n\u0012\u0006\b\u0001\u0012\u00020\u00010\n0\u00068\u0002X‚\u0004¢\u0006\u0006\n\u0004\b\u000b\u0010\fR*\u0010\u0010\u001a\u0018\u0012\u0004\u0012\u00020\u0007\u0012\u000e\u0012\f\u0012\b\b\u0001\u0012\u0004\u0018\u00010\u000f0\u000e0\r8\u0002X‚\u0004¢\u0006\u0006\n\u0004\b\u0010\u0010\u0011R\u001c\u0010\u0013\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00120\u00068\u0002X‚\u0004¢\u0006\u0006\n\u0004\b\u0013\u0010\u0014¨\u0006\u0017"}, d2 = {"Lvu0/e$a;", "", "Ljava/lang/ClassLoader;", "kotlin.jvm.PlatformType", "BOOT_CLASS_LOADER", "Ljava/lang/ClassLoader;", "", "", "CLASS_PREFIX_LIST", "[Ljava/lang/String;", "Ljava/lang/Class;", "CONSTRUCTOR_SIGNATURE", "[Ljava/lang/Class;", "Ljava/util/concurrent/ConcurrentHashMap;", "Ljava/lang/reflect/Constructor;", "Landroid/view/View;", "ConstructorMap", "Ljava/util/concurrent/ConcurrentHashMap;", "Ljava/lang/StackTraceElement;", "EMPTY_STACK_TRACE", "[Ljava/lang/StackTraceElement;", "<init>", "()V", "library-ext-async_release"}, k = 1, mv = {1, 4, 0})
    /* compiled from: BasicInflater.kt */
    public static final class a {
        public a() {
        }

        public /* synthetic */ a(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public e(Context context) {
        super(context);
        Intrinsics.checkParameterIsNotNull(context, "context");
    }

    public final View a(Context context, String str, String str2, AttributeSet attributeSet) {
        String str3;
        String str4;
        Objects.requireNonNull(context);
        Objects.requireNonNull(str);
        ConcurrentHashMap<String, Constructor<? extends View>> concurrentHashMap = f141647g;
        Constructor<? extends View> constructor = concurrentHashMap.get(str);
        Class cls = null;
        if (constructor != null && !e(constructor)) {
            concurrentHashMap.remove(str);
            constructor = null;
        }
        if (constructor == null) {
            if (str2 != null) {
                try {
                    str3 = str2 + str;
                } catch (NoSuchMethodException e14) {
                    StringBuilder sb3 = new StringBuilder();
                    sb3.append(d(context, attributeSet));
                    sb3.append(": Error inflating class ");
                    if (str2 != null) {
                        str = str2 + str;
                    }
                    sb3.append(str);
                    InflateException inflateException = new InflateException(sb3.toString(), e14);
                    inflateException.setStackTrace(f141644d);
                    throw inflateException;
                } catch (ClassCastException e15) {
                    StringBuilder sb4 = new StringBuilder();
                    sb4.append(d(context, attributeSet));
                    sb4.append(": Class is not a View ");
                    if (str2 != null) {
                        str = str2 + str;
                    }
                    sb4.append(str);
                    InflateException inflateException2 = new InflateException(sb4.toString(), e15);
                    inflateException2.setStackTrace(f141644d);
                    throw inflateException2;
                } catch (ClassNotFoundException e16) {
                    throw e16;
                } catch (Exception e17) {
                    StringBuilder sb5 = new StringBuilder();
                    sb5.append(d(context, attributeSet));
                    sb5.append(": Error inflating class ");
                    if (0 == 0) {
                        str4 = "<unknown>";
                    } else {
                        str4 = cls.getName();
                    }
                    sb5.append(str4);
                    InflateException inflateException3 = new InflateException(sb5.toString(), e17);
                    inflateException3.setStackTrace(f141644d);
                    throw inflateException3;
                }
            } else {
                str3 = str;
            }
            Context context2 = getContext();
            Intrinsics.checkExpressionValueIsNotNull(context2, "context");
            Class<? extends U> asSubclass = Class.forName(str3, false, context2.getClassLoader()).asSubclass(View.class);
            if (!(getFilter() == null || asSubclass == null || getFilter().onLoadClass(asSubclass))) {
                c(str, str2, context, attributeSet);
            }
            Class<? extends Object>[] clsArr = f141646f;
            constructor = asSubclass.getConstructor((Class[]) Arrays.copyOf(clsArr, clsArr.length));
            Intrinsics.checkExpressionValueIsNotNull(constructor, "constructor");
            constructor.setAccessible(true);
            concurrentHashMap.put(str, constructor);
        } else if (getFilter() != null && Intrinsics.areEqual(Boolean.valueOf(Intrinsics.areEqual(this.f141650b.get(str), Boolean.TRUE)), Boolean.FALSE)) {
            c(str, str2, context, attributeSet);
        }
        Object obj = this.f141649a.get(0);
        this.f141649a.put(0, context);
        Object[] objArr = {context, attributeSet};
        try {
            View view = (View) constructor.newInstance(Arrays.copyOf(objArr, 2));
            if (view instanceof ViewStub) {
                ViewStub viewStub = (ViewStub) view;
                Context context3 = (Context) objArr[0];
                if (context3 == null) {
                    Intrinsics.throwNpe();
                }
                viewStub.setLayoutInflater(cloneInContext(context3));
            }
            return view;
        } finally {
            if (obj != null) {
                this.f141649a.put(0, obj);
            }
        }
    }

    public final View b(String str, String str2, AttributeSet attributeSet) {
        Context context = (Context) this.f141649a.get(0);
        if (context == null) {
            context = getContext();
        }
        Intrinsics.checkExpressionValueIsNotNull(context, "context");
        return a(context, str, str2, attributeSet);
    }

    public final void c(String str, String str2, Context context, AttributeSet attributeSet) {
        StringBuilder sb3 = new StringBuilder();
        sb3.append(d(context, attributeSet));
        sb3.append(": Class not allowed to be inflated ");
        if (str2 != null) {
            str = str2 + str;
        }
        sb3.append(str);
        throw new InflateException(sb3.toString());
    }

    public LayoutInflater cloneInContext(Context context) {
        Intrinsics.checkParameterIsNotNull(context, "newContext");
        return new e(context);
    }

    public final String d(Context context, AttributeSet attributeSet) {
        int attributeSetSourceResId = Build.VERSION.SDK_INT >= 29 ? Resources.getAttributeSetSourceResId(attributeSet) : 0;
        String str = null;
        if (attributeSetSourceResId != 0) {
            StringBuilder sb3 = new StringBuilder();
            if (attributeSet != null) {
                str = attributeSet.getPositionDescription();
            }
            sb3.append(str);
            sb3.append(" in ");
            sb3.append(context.getResources().getResourceName(attributeSetSourceResId));
            return sb3.toString();
        } else if (attributeSet != null) {
            return attributeSet.getPositionDescription();
        } else {
            return null;
        }
    }

    public final boolean e(Constructor<? extends View> constructor) {
        Class<? extends View> declaringClass = constructor.getDeclaringClass();
        Intrinsics.checkExpressionValueIsNotNull(declaringClass, "constructor.declaringClass");
        ClassLoader classLoader = declaringClass.getClassLoader();
        if (classLoader == f141643c) {
            return true;
        }
        Context context = getContext();
        Intrinsics.checkExpressionValueIsNotNull(context, "context");
        ClassLoader classLoader2 = context.getClassLoader();
        while (classLoader != classLoader2) {
            if (classLoader2 == null) {
                Intrinsics.throwNpe();
            }
            classLoader2 = classLoader2.getParent();
            if (classLoader2 == null) {
                return false;
            }
        }
        return true;
    }

    @Override // android.view.LayoutInflater
    public View onCreateView(String str, AttributeSet attributeSet) {
        Intrinsics.checkParameterIsNotNull(str, "name");
        Intrinsics.checkParameterIsNotNull(attributeSet, "attrs");
        for (String str2 : f141645e) {
            try {
                View b14 = b(str, str2, attributeSet);
                if (b14 != null) {
                    return b14;
                }
            } catch (ClassNotFoundException unused) {
            }
        }
        return b(str, "android.view.", attributeSet);
    }
}