package com.zhihu.matisse.internal.entity;

import android.content.ContentUris;
import android.database.Cursor;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.MediaStore;
import com.zhihu.matisse.MimeType;

public class Item implements Parcelable {
    public static final Parcelable.Creator<Item> CREATOR = new C0565();

    /* renamed from: ʬ  reason: contains not printable characters */
    public final String f3335;

    /* renamed from: ඓ  reason: contains not printable characters */
    public final long f3336;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final long f3337;

    /* renamed from: 㴹  reason: contains not printable characters */
    public final long f3338;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final Uri f3339;

    /* renamed from: com.zhihu.matisse.internal.entity.Item$K  reason: contains not printable characters */
    public static class C0565 implements Parcelable.Creator<Item> {
        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // android.os.Parcelable.Creator
        public Item createFromParcel(Parcel parcel) {
            return new Item(parcel, null);
        }

        /* Return type fixed from 'java.lang.Object[]' to match base method */
        @Override // android.os.Parcelable.Creator
        public Item[] newArray(int i) {
            return new Item[i];
        }
    }

    public Item(long j, String str, long j2, long j3) {
        Uri uri;
        this.f3337 = j;
        this.f3335 = str;
        if (m1916()) {
            uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
        } else if (m1913()) {
            uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
        } else {
            uri = MediaStore.Files.getContentUri("external");
        }
        this.f3339 = ContentUris.withAppendedId(uri, j);
        this.f3336 = j2;
        this.f3338 = j3;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static Item m1911(Cursor cursor) {
        return new Item(cursor.getLong(cursor.getColumnIndex("_id")), cursor.getString(cursor.getColumnIndex("mime_type")), cursor.getLong(cursor.getColumnIndex("_size")), cursor.getLong(cursor.getColumnIndex("duration")));
    }

    public int describeContents() {
        return 0;
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof Item)) {
            return false;
        }
        Item item = (Item) obj;
        if (this.f3337 != item.f3337) {
            return false;
        }
        String str = this.f3335;
        if ((str == null || !str.equals(item.f3335)) && (this.f3335 != null || item.f3335 != null)) {
            return false;
        }
        Uri uri = this.f3339;
        if (((uri != null && uri.equals(item.f3339)) || (this.f3339 == null && item.f3339 == null)) && this.f3336 == item.f3336 && this.f3338 == item.f3338) {
            return true;
        }
        return false;
    }

    public int hashCode() {
        int hashCode = Long.valueOf(this.f3337).hashCode() + 31;
        String str = this.f3335;
        if (str != null) {
            hashCode = (hashCode * 31) + str.hashCode();
        }
        int hashCode2 = this.f3339.hashCode();
        int hashCode3 = Long.valueOf(this.f3336).hashCode();
        return Long.valueOf(this.f3338).hashCode() + ((hashCode3 + ((hashCode2 + (hashCode * 31)) * 31)) * 31);
    }

    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeLong(this.f3337);
        parcel.writeString(this.f3335);
        parcel.writeParcelable(this.f3339, 0);
        parcel.writeLong(this.f3336);
        parcel.writeLong(this.f3338);
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public boolean m1912() {
        return MimeType.isGif(this.f3335);
    }

    /* renamed from: ඓ  reason: contains not printable characters */
    public boolean m1913() {
        return MimeType.isVideo(this.f3335);
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public boolean m1914() {
        return this.f3337 == -1;
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public boolean m1916() {
        return MimeType.isImage(this.f3335);
    }

    /* renamed from: K  reason: contains not printable characters */
    public Uri m1915() {
        return this.f3339;
    }

    public /* synthetic */ Item(Parcel parcel, C0565 k) {
        this.f3337 = parcel.readLong();
        this.f3335 = parcel.readString();
        this.f3339 = (Uri) parcel.readParcelable(Uri.class.getClassLoader());
        this.f3336 = parcel.readLong();
        this.f3338 = parcel.readLong();
    }
}
