package X6FRs_4.Eps4cJe_18;

import android.os.Parcelable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/* compiled from: VersionedParcel.java */
/* loaded from: classes.dex */
public abstract class KQgRr5e_0 {
    public final X6FRs_4.Mqv2r_3.KQgRr5e_0<String, Method> KQgRr5e_0;
    public final X6FRs_4.Mqv2r_3.KQgRr5e_0<String, Class> PGPF6hQ_2;
    public final X6FRs_4.Mqv2r_3.KQgRr5e_0<String, Method> QxJ9d_1;

    public KQgRr5e_0(X6FRs_4.Mqv2r_3.KQgRr5e_0<String, Method> kQgRr5e_0, X6FRs_4.Mqv2r_3.KQgRr5e_0<String, Method> kQgRr5e_02, X6FRs_4.Mqv2r_3.KQgRr5e_0<String, Class> kQgRr5e_03) {
        this.KQgRr5e_0 = kQgRr5e_0;
        this.QxJ9d_1 = kQgRr5e_02;
        this.PGPF6hQ_2 = kQgRr5e_03;
    }

    public abstract int KQgRr5e_0();

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public abstract KQgRr5e_0 m192KQgRr5e_0();

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public abstract <T extends Parcelable> T m194KQgRr5e_0();

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public abstract CharSequence m195KQgRr5e_0();

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public abstract String m196KQgRr5e_0();

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public abstract void m198KQgRr5e_0();

    public abstract void KQgRr5e_0(int i);

    public abstract void KQgRr5e_0(Parcelable parcelable);

    public abstract void KQgRr5e_0(CharSequence charSequence);

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public abstract void m203KQgRr5e_0(String str);

    public abstract void KQgRr5e_0(boolean z);

    public void KQgRr5e_0(boolean z, int i) {
        KQgRr5e_0(i);
        KQgRr5e_0(z);
    }

    public void KQgRr5e_0(boolean z, boolean z2) {
    }

    public abstract void KQgRr5e_0(byte[] bArr);

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public boolean m205KQgRr5e_0() {
        return false;
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public abstract boolean m206KQgRr5e_0(int i);

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public abstract byte[] m208KQgRr5e_0();

    public abstract void QxJ9d_1(int i);

    /* JADX WARN: Multi-variable type inference failed */
    public final void QxJ9d_1(PGPF6hQ_2 pGPF6hQ_2) {
        try {
            m203KQgRr5e_0(KQgRr5e_0((Class<? extends PGPF6hQ_2>) pGPF6hQ_2.getClass()).getName());
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(pGPF6hQ_2.getClass().getSimpleName() + " does not have a Parcelizer", e);
        }
    }

    public abstract boolean QxJ9d_1();

    public void KQgRr5e_0(byte[] bArr, int i) {
        KQgRr5e_0(i);
        KQgRr5e_0(bArr);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public void m202KQgRr5e_0(CharSequence charSequence, int i) {
        KQgRr5e_0(i);
        KQgRr5e_0(charSequence);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public void m199KQgRr5e_0(int i, int i2) {
        KQgRr5e_0(i2);
        QxJ9d_1(i);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public void m204KQgRr5e_0(String str, int i) {
        KQgRr5e_0(i);
        m203KQgRr5e_0(str);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public void m201KQgRr5e_0(Parcelable parcelable, int i) {
        KQgRr5e_0(i);
        KQgRr5e_0(parcelable);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public boolean m207KQgRr5e_0(boolean z, int i) {
        return !m206KQgRr5e_0(i) ? z : QxJ9d_1();
    }

    public int KQgRr5e_0(int i, int i2) {
        return !m206KQgRr5e_0(i2) ? i : KQgRr5e_0();
    }

    public String KQgRr5e_0(String str, int i) {
        return !m206KQgRr5e_0(i) ? str : m196KQgRr5e_0();
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public byte[] m209KQgRr5e_0(byte[] bArr, int i) {
        return !m206KQgRr5e_0(i) ? bArr : m208KQgRr5e_0();
    }

    public <T extends Parcelable> T KQgRr5e_0(T t, int i) {
        return !m206KQgRr5e_0(i) ? t : (T) m194KQgRr5e_0();
    }

    public CharSequence KQgRr5e_0(CharSequence charSequence, int i) {
        return !m206KQgRr5e_0(i) ? charSequence : m195KQgRr5e_0();
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public void m200KQgRr5e_0(PGPF6hQ_2 pGPF6hQ_2, int i) {
        KQgRr5e_0(i);
        KQgRr5e_0(pGPF6hQ_2);
    }

    public void KQgRr5e_0(PGPF6hQ_2 pGPF6hQ_2) {
        if (pGPF6hQ_2 == null) {
            m203KQgRr5e_0((String) null);
            return;
        }
        QxJ9d_1(pGPF6hQ_2);
        KQgRr5e_0 m192KQgRr5e_0 = m192KQgRr5e_0();
        KQgRr5e_0((KQgRr5e_0) pGPF6hQ_2, m192KQgRr5e_0);
        m192KQgRr5e_0.m198KQgRr5e_0();
    }

    public <T extends PGPF6hQ_2> T KQgRr5e_0(T t, int i) {
        return !m206KQgRr5e_0(i) ? t : (T) m193KQgRr5e_0();
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public <T extends PGPF6hQ_2> T m193KQgRr5e_0() {
        String m196KQgRr5e_0 = m196KQgRr5e_0();
        if (m196KQgRr5e_0 == null) {
            return null;
        }
        return (T) KQgRr5e_0(m196KQgRr5e_0, m192KQgRr5e_0());
    }

    public <T extends PGPF6hQ_2> T KQgRr5e_0(String str, KQgRr5e_0 kQgRr5e_0) {
        try {
            return (T) KQgRr5e_0(str).invoke(null, kQgRr5e_0);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException("VersionedParcel encountered ClassNotFoundException", e);
        } catch (IllegalAccessException e2) {
            throw new RuntimeException("VersionedParcel encountered IllegalAccessException", e2);
        } catch (NoSuchMethodException e3) {
            throw new RuntimeException("VersionedParcel encountered NoSuchMethodException", e3);
        } catch (InvocationTargetException e4) {
            if (e4.getCause() instanceof RuntimeException) {
                throw ((RuntimeException) e4.getCause());
            }
            throw new RuntimeException("VersionedParcel encountered InvocationTargetException", e4);
        }
    }

    public <T extends PGPF6hQ_2> void KQgRr5e_0(T t, KQgRr5e_0 kQgRr5e_0) {
        try {
            m197KQgRr5e_0(t.getClass()).invoke(null, t, kQgRr5e_0);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException("VersionedParcel encountered ClassNotFoundException", e);
        } catch (IllegalAccessException e2) {
            throw new RuntimeException("VersionedParcel encountered IllegalAccessException", e2);
        } catch (NoSuchMethodException e3) {
            throw new RuntimeException("VersionedParcel encountered NoSuchMethodException", e3);
        } catch (InvocationTargetException e4) {
            if (e4.getCause() instanceof RuntimeException) {
                throw ((RuntimeException) e4.getCause());
            }
            throw new RuntimeException("VersionedParcel encountered InvocationTargetException", e4);
        }
    }

    public final Method KQgRr5e_0(String str) throws IllegalAccessException, NoSuchMethodException, ClassNotFoundException {
        Method method = this.KQgRr5e_0.get(str);
        if (method == null) {
            System.currentTimeMillis();
            Method declaredMethod = Class.forName(str, true, KQgRr5e_0.class.getClassLoader()).getDeclaredMethod("read", KQgRr5e_0.class);
            this.KQgRr5e_0.put(str, declaredMethod);
            return declaredMethod;
        }
        return method;
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public final Method m197KQgRr5e_0(Class cls) throws IllegalAccessException, NoSuchMethodException, ClassNotFoundException {
        Method method = this.QxJ9d_1.get(cls.getName());
        if (method == null) {
            Class KQgRr5e_0 = KQgRr5e_0((Class<? extends PGPF6hQ_2>) cls);
            System.currentTimeMillis();
            Method declaredMethod = KQgRr5e_0.getDeclaredMethod("write", cls, KQgRr5e_0.class);
            this.QxJ9d_1.put(cls.getName(), declaredMethod);
            return declaredMethod;
        }
        return method;
    }

    public final Class KQgRr5e_0(Class<? extends PGPF6hQ_2> cls) throws ClassNotFoundException {
        Class cls2 = this.PGPF6hQ_2.get(cls.getName());
        if (cls2 == null) {
            Class<?> cls3 = Class.forName(String.format("%s.%sParcelizer", cls.getPackage().getName(), cls.getSimpleName()), false, cls.getClassLoader());
            this.PGPF6hQ_2.put(cls.getName(), cls3);
            return cls3;
        }
        return cls2;
    }
}
