package androidx.datastore.preferences.protobuf;

import java.lang.reflect.Field;
import sun.misc.Unsafe;

/* JADX INFO: loaded from: classes.dex */
public final class f0 extends g0 {
    @Override // androidx.datastore.preferences.protobuf.g0
    public final boolean c(long j8, Object obj) {
        return this.f8073a.getBoolean(obj, j8);
    }

    @Override // androidx.datastore.preferences.protobuf.g0
    public final double d(long j8, Object obj) {
        return this.f8073a.getDouble(obj, j8);
    }

    @Override // androidx.datastore.preferences.protobuf.g0
    public final float e(long j8, Object obj) {
        return this.f8073a.getFloat(obj, j8);
    }

    @Override // androidx.datastore.preferences.protobuf.g0
    public final void j(Object obj, long j8, boolean z8) {
        this.f8073a.putBoolean(obj, j8, z8);
    }

    @Override // androidx.datastore.preferences.protobuf.g0
    public final void k(Object obj, long j8, byte b8) {
        this.f8073a.putByte(obj, j8, b8);
    }

    @Override // androidx.datastore.preferences.protobuf.g0
    public final void l(Object obj, long j8, double d8) {
        this.f8073a.putDouble(obj, j8, d8);
    }

    @Override // androidx.datastore.preferences.protobuf.g0
    public final void m(Object obj, long j8, float f3) {
        this.f8073a.putFloat(obj, j8, f3);
    }

    @Override // androidx.datastore.preferences.protobuf.g0
    public final boolean q() {
        if (!super.q()) {
            return false;
        }
        try {
            Class<?> cls = this.f8073a.getClass();
            Class<?> cls2 = Long.TYPE;
            cls.getMethod("getByte", Object.class, cls2);
            cls.getMethod("putByte", Object.class, cls2, Byte.TYPE);
            cls.getMethod("getBoolean", Object.class, cls2);
            cls.getMethod("putBoolean", Object.class, cls2, Boolean.TYPE);
            cls.getMethod("getFloat", Object.class, cls2);
            cls.getMethod("putFloat", Object.class, cls2, Float.TYPE);
            cls.getMethod("getDouble", Object.class, cls2);
            cls.getMethod("putDouble", Object.class, cls2, Double.TYPE);
            return true;
        } catch (Throwable th) {
            h0.a(th);
            return false;
        }
    }

    @Override // androidx.datastore.preferences.protobuf.g0
    public final boolean r() {
        Unsafe unsafe = this.f8073a;
        if (unsafe != null) {
            try {
                Class<?> cls = unsafe.getClass();
                cls.getMethod("objectFieldOffset", Field.class);
                Class<?> cls2 = Long.TYPE;
                cls.getMethod("getLong", Object.class, cls2);
                if (h0.g() != null) {
                    try {
                        Class<?> cls3 = this.f8073a.getClass();
                        cls3.getMethod("getByte", cls2);
                        cls3.getMethod("putByte", cls2, Byte.TYPE);
                        cls3.getMethod("getInt", cls2);
                        cls3.getMethod("putInt", cls2, Integer.TYPE);
                        cls3.getMethod("getLong", cls2);
                        cls3.getMethod("putLong", cls2, cls2);
                        cls3.getMethod("copyMemory", cls2, cls2, cls2);
                        cls3.getMethod("copyMemory", Object.class, cls2, Object.class, cls2, cls2);
                        return true;
                    } catch (Throwable th) {
                        h0.a(th);
                        return false;
                    }
                }
            } catch (Throwable th2) {
                h0.a(th2);
            }
        }
        return false;
    }
}
