package com.codezjx.andlinker;

import android.os.Parcel;
import android.os.Parcelable;
import d.c.a.e;
import d.c.a.n;
import d.c.a.s;
import d.c.a.t;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.HashMap;

/* JADX INFO: loaded from: classes.dex */
public final class OutTypeWrapper implements BaseTypeWrapper {
    public static final Parcelable.Creator<OutTypeWrapper> CREATOR = new a();

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f1944b;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public Object f1945e;

    public static class a implements Parcelable.Creator<OutTypeWrapper> {
        @Override // android.os.Parcelable.Creator
        public OutTypeWrapper createFromParcel(Parcel parcel) {
            return new OutTypeWrapper(parcel, (a) null);
        }

        @Override // android.os.Parcelable.Creator
        public OutTypeWrapper[] newArray(int i2) {
            return new OutTypeWrapper[i2];
        }
    }

    public OutTypeWrapper(Object obj, Class<?> cls) {
        this.f1944b = c.n.a.C(cls);
        this.f1945e = obj;
    }

    @Override // com.codezjx.andlinker.BaseTypeWrapper
    public Object a() {
        return this.f1945e;
    }

    @Override // android.os.Parcelable
    public int describeContents() {
        return 0;
    }

    @Override // com.codezjx.andlinker.BaseTypeWrapper
    public int getType() {
        return this.f1944b;
    }

    @Override // com.codezjx.andlinker.BaseTypeWrapper, com.codezjx.andlinker.SuperParcelable
    public void readFromParcel(Parcel parcel) {
        int i2 = parcel.readInt();
        this.f1944b = i2;
        ((n) t.a[i2]).b(parcel, this.f1945e);
    }

    @Override // android.os.Parcelable
    public void writeToParcel(Parcel parcel, int i2) {
        parcel.writeInt(this.f1944b);
        int i3 = this.f1944b;
        s sVar = t.a[i3];
        if (i2 == 1) {
            sVar.c(parcel, i2, this.f1945e);
            return;
        }
        if (i3 == 21) {
            parcel.writeString(this.f1945e.getClass().getName());
            return;
        }
        if (i3 == 22) {
            parcel.writeInt(Array.getLength(this.f1945e));
            parcel.writeString(this.f1945e.getClass().getComponentType().getName());
        } else if (c.n.a.I(i3)) {
            parcel.writeInt(Array.getLength(this.f1945e));
        }
    }

    public OutTypeWrapper(Parcel parcel, a aVar) {
        int i2 = parcel.readInt();
        this.f1944b = i2;
        Object objNewInstance = null;
        if (i2 == 21) {
            try {
                objNewInstance = Class.forName(parcel.readString()).newInstance();
            } catch (ClassNotFoundException e2) {
                e2.printStackTrace();
            } catch (IllegalAccessException e3) {
                e3.printStackTrace();
            } catch (InstantiationException e4) {
                e4.printStackTrace();
            }
            this.f1945e = objNewInstance;
            return;
        }
        if (i2 == 22) {
            try {
                objNewInstance = Array.newInstance(Class.forName(parcel.readString()), parcel.readInt());
            } catch (ClassNotFoundException e5) {
                e5.printStackTrace();
            }
            this.f1945e = objNewInstance;
            return;
        }
        if (i2 == 23) {
            this.f1945e = new ArrayList();
            return;
        }
        if (i2 == 24) {
            this.f1945e = new HashMap();
        } else if (c.n.a.I(i2)) {
            this.f1945e = ((e) t.a[this.f1944b]).a(parcel.readInt());
        }
    }
}
