package com.google.zxing.oned.rss.expanded.decoders;

import com.cvte.vman.instance.InvokeCmd;
import com.google.zxing.FormatException;
import com.google.zxing.NotFoundException;
import com.google.zxing.common.BitArray;

/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractExpandedDecoder {
    private final GeneralAppIdDecoder generalDecoder;
    private final BitArray information;

    AbstractExpandedDecoder(BitArray bitArray) {
        this.information = bitArray;
        this.generalDecoder = new GeneralAppIdDecoder(bitArray);
    }

    public static AbstractExpandedDecoder createDecoder(BitArray bitArray) {
        if (bitArray.get(1)) {
            return new AI01AndOtherAIs(bitArray);
        }
        if (!bitArray.get(2)) {
            return new AnyAIDecoder(bitArray);
        }
        int iExtractNumericValueFromBitArray = GeneralAppIdDecoder.extractNumericValueFromBitArray(bitArray, 1, 4);
        if (iExtractNumericValueFromBitArray == 4) {
            return new AI013103decoder(bitArray);
        }
        if (iExtractNumericValueFromBitArray == 5) {
            return new AI01320xDecoder(bitArray);
        }
        int iExtractNumericValueFromBitArray2 = GeneralAppIdDecoder.extractNumericValueFromBitArray(bitArray, 1, 5);
        if (iExtractNumericValueFromBitArray2 == 12) {
            return new AI01392xDecoder(bitArray);
        }
        if (iExtractNumericValueFromBitArray2 == 13) {
            return new AI01393xDecoder(bitArray);
        }
        switch (GeneralAppIdDecoder.extractNumericValueFromBitArray(bitArray, 1, 7)) {
            case InvokeCmd.CMD_SYSTEMCTRL_SET_CEC_WAKEUP /* 56 */:
                return new AI013x0x1xDecoder(bitArray, "310", "11");
            case InvokeCmd.CMD_SYSTEMCTRL_GET_DEVICE_AVB_STATE /* 57 */:
                return new AI013x0x1xDecoder(bitArray, "320", "11");
            case InvokeCmd.CMD_SYSTEMCTRL_SET_DEVICE_AVB_STATE /* 58 */:
                return new AI013x0x1xDecoder(bitArray, "310", "13");
            case InvokeCmd.CMD_SYSTEMCTRL_GET_USB_ADB_STATE /* 59 */:
                return new AI013x0x1xDecoder(bitArray, "320", "13");
            case InvokeCmd.CMD_SYSTEMCTRL_SET_USB_ADB_STATE /* 60 */:
                return new AI013x0x1xDecoder(bitArray, "310", "15");
            case InvokeCmd.CMD_SYSTEMCTRL_GET_USB_POWER /* 61 */:
                return new AI013x0x1xDecoder(bitArray, "320", "15");
            case InvokeCmd.CMD_SYSTEMCTRL_SET_USB_POWER /* 62 */:
                return new AI013x0x1xDecoder(bitArray, "310", "17");
            case 63:
                return new AI013x0x1xDecoder(bitArray, "320", "17");
            default:
                throw new IllegalStateException("unknown decoder: " + bitArray);
        }
    }

    protected final GeneralAppIdDecoder getGeneralDecoder() {
        return this.generalDecoder;
    }

    protected final BitArray getInformation() {
        return this.information;
    }

    public abstract String parseInformation() throws NotFoundException, FormatException;
}
