package com.seewo.ota.update.device.model.vman;

import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.Keep;
import com.cvte.vman.entity.EntityFwInfoU3HUB;
import com.cvte.vman.impl.FwUpgradeManager;
import com.google.gson.reflect.TypeToken;
import com.seewo.ota.R;
import com.seewo.ota.util.v;
import com.seewo.ota.v.s.s.q0;
import f.i;
import f.u.f;
import f.w.d;
import f.z.d.g;
import f.z.d.k;
import java.util.List;

/* JADX INFO: compiled from: U3HUBVmanUpdateTask.kt */
/* JADX INFO: loaded from: classes.dex */
@i
@Keep
public final class U3HUBVmanUpdateTask extends BaseVmanUpdateTask<EntityFwInfoU3HUB> {
    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public U3HUBVmanUpdateTask(Context context, q0 q0Var) {
        super(context, new TypeToken<EntityFwInfoU3HUB>() { // from class: com.seewo.ota.update.device.model.vman.U3HUBVmanUpdateTask.1
        }, q0Var);
        k.e(context, "context");
    }

    @Override // com.seewo.ota.update.device.model.vman.BaseVmanUpdateTask
    public void checkVersion(List<EntityFwInfoU3HUB> list) {
        k.e(list, "waitUpgradeQueue");
        List<EntityFwInfoU3HUB> fwInfoU3HUBList = FwUpgradeManager.getInstance().getFwInfoU3HUBList();
        k.d(fwInfoU3HUBList, "getInstance().fwInfoU3HUBList");
        for (EntityFwInfoU3HUB entityFwInfoU3HUB : fwInfoU3HUBList) {
            String fwVersion = FwUpgradeManager.getInstance().getFwVersion(entityFwInfoU3HUB.fwVerType);
            Log.i(getName(), "checkVersion: " + entityFwInfoU3HUB + " currentVersion: '" + fwVersion + '\'');
            if (entityFwInfoU3HUB.needOtaUp && !f.g(com.seewo.ota.util.k.a(), fwVersion) && !f.g(com.seewo.ota.util.k.a(), entityFwInfoU3HUB.version) && !TextUtils.equals(fwVersion, entityFwInfoU3HUB.version)) {
                String str = entityFwInfoU3HUB.fwOtaLocalPath;
                k.d(str, "entityFwInfoU3HUB.fwOtaLocalPath");
                if (fileExists(str)) {
                    k.d(entityFwInfoU3HUB, "entityFwInfoU3HUB");
                    list.add(entityFwInfoU3HUB);
                }
            }
        }
    }

    @Override // com.seewo.ota.update.device.model.vman.BaseVmanUpdateTask, com.seewo.ota.v.s.s.r0
    public String getBeforeUpdateTip() {
        String string = this.mContext.getResources().getString(R.string.before_update_usb_hub_tips);
        k.d(string, "mContext.resources.getSt…fore_update_usb_hub_tips)");
        return string;
    }

    @Override // com.seewo.ota.update.device.model.vman.BaseVmanUpdateTask, com.seewo.ota.v.s.s.r0
    public String getUpdateTip() {
        String string = this.mContext.getString(R.string.auto_upgrade_usb_hub_point);
        k.d(string, "mContext.getString(R.str…to_upgrade_usb_hub_point)");
        return string;
    }

    @Override // com.seewo.ota.update.device.model.vman.BaseVmanUpdateTask, com.seewo.ota.v.s.s.r0
    public /* bridge */ /* synthetic */ String isInExceptionalState() {
        return super.isInExceptionalState();
    }

    @Override // com.seewo.ota.update.device.model.vman.BaseVmanUpdateTask
    public boolean isSupportOtaUpgrade() {
        return this.mContext.getResources().getBoolean(R.bool.support_usb_hub_update);
    }

    @Override // com.seewo.ota.update.device.model.vman.BaseVmanUpdateTask
    public boolean needReboot(EntityFwInfoU3HUB entityFwInfoU3HUB) {
        k.e(entityFwInfoU3HUB, "entity");
        return true;
    }

    @Override // com.seewo.ota.update.device.model.vman.BaseVmanUpdateTask
    public /* bridge */ /* synthetic */ Object upgrade(EntityFwInfoU3HUB entityFwInfoU3HUB, d dVar) {
        return upgrade2(entityFwInfoU3HUB, (d<? super Boolean>) dVar);
    }

    public /* synthetic */ U3HUBVmanUpdateTask(Context context, q0 q0Var, int i2, g gVar) {
        this(context, (i2 & 2) != 0 ? null : q0Var);
    }

    /* JADX INFO: renamed from: upgrade, reason: avoid collision after fix types in other method */
    public Object upgrade2(EntityFwInfoU3HUB entityFwInfoU3HUB, d<? super Boolean> dVar) {
        int i2 = entityFwInfoU3HUB.upFwType;
        String str = entityFwInfoU3HUB.fwOtaLocalPath;
        k.d(str, "entity.fwOtaLocalPath");
        return v.a(i2, str, dVar);
    }
}
