When interacting with a DESfire EV1 tag, AES-CBC is used for securing communication. After encrypting and sending a message, the response needs to be decrypted using the IV that resulted from the encryption:
Cipher c = Cipher.getInstance("AES/CBC/NoPadding");
c.init(Cipher.ENCRYPT_MODE, secretKey, new IvParameterSpec(zeroBytes));
byte[] encrypted_response = transceive(c.doFinal(message));
// TODO: cipher needs to be re-set to DECRYPT_MODE while retaining the IV
c.init(Cipher.DECRYPT_MODE, ...?);
byte[] response = c.doFinal(encrypted_response);
Unfortunately, Cipher.getIV() returns the initial IV (all zeroes), and there seems to be no way to get the IV short of implementing the whole CBC part manually. In Get updated IV from Cipher after encrypting bytes a similar question is asked, however only CTR-specific solutions are presented, which do not apply in CBC mode.