package com.ifpdos.debugmenu.action;

import android.content.Context;
import android.util.Log;
import c.n.a;
import com.cvte.vman.VmanMiddleWare;
import com.ifpdos.debugmenu.action.base.ItemInfoAction;
import java.util.Arrays;

/* JADX INFO: loaded from: classes.dex */
public class ShowNabtoKeyAction extends ItemInfoAction {
    private static final String SPLIT = ";";
    private static final String TAG = "ShowNabtoKeyAction";

    public ShowNabtoKeyAction(Context context) {
        super(context);
    }

    private boolean isByteArrayEmpty(byte[] bArr) {
        for (byte b2 : bArr) {
            if (b2 != 0 && b2 != -1) {
                return false;
            }
        }
        return true;
    }

    @Override // com.ifpdos.debugmenu.action.base.ItemInfoAction
    public String getValue(Context context) {
        byte[] dataBuff = VmanMiddleWare.getInstance().getAtCfgControl().getDataBuff("IDX_NABTO_KEY");
        if (dataBuff == null || dataBuff.length == 0) {
            return "FAIL";
        }
        byte[] bArrCopyOfRange = Arrays.copyOfRange(dataBuff, 16, 32);
        byte[] bArrCopyOfRange2 = Arrays.copyOfRange(dataBuff, 32, 48);
        StringBuilder sb = new StringBuilder();
        sb.append(isByteArrayEmpty(bArrCopyOfRange) ? "" : a.r(bArrCopyOfRange));
        sb.append(SPLIT);
        sb.append(isByteArrayEmpty(bArrCopyOfRange2) ? "" : a.r(bArrCopyOfRange2));
        String string = sb.toString();
        Log.i(TAG, "value: " + string);
        return SPLIT.equals(string) ? "FAIL" : "PASS";
    }
}
