package com.seewo.libshid.devices;

import a.b.c.a.a;
import android.content.Context;
import android.util.Log;

/* JADX INFO: loaded from: classes.dex */
public class DeviceIdent {
    private static final String TAG = "DeviceIdent";
    public String mDeviceName;
    public int mPid;
    public int mVid;

    public DeviceIdent(int i2, int i3) {
        this.mPid = i2;
        this.mVid = i3;
    }

    public DeviceIdent(int i2, int i3, String str) {
        this.mPid = i2;
        this.mVid = i3;
        this.mDeviceName = str;
    }

    public DeviceIdent(Context context, int i2) {
        try {
            int[] intArray = context.getResources().getIntArray(i2);
            if (intArray.length == 2) {
                this.mPid = intArray[0];
                this.mVid = intArray[1];
            }
        } catch (Exception e2) {
            Log.e(TAG, "catch a exception" + e2);
        }
    }

    public DeviceIdent(int[] iArr) {
        if (iArr == null || iArr.length != 2) {
            return;
        }
        this.mPid = iArr[0];
        this.mVid = iArr[1];
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof DeviceIdent)) {
            return false;
        }
        DeviceIdent deviceIdent = (DeviceIdent) obj;
        return this.mPid == deviceIdent.mPid && this.mVid == deviceIdent.mVid;
    }

    public int hashCode() {
        return this.mPid + this.mVid;
    }

    public String toString() {
        StringBuilder sbC = a.C("pid: ");
        sbC.append(this.mPid);
        sbC.append(" vid: ");
        sbC.append(this.mVid);
        return sbC.toString();
    }
}
