28 lines
992 B
Java
28 lines
992 B
Java
package sega.a7;
|
|
|
|
import javacard.security.MessageDigest;
|
|
|
|
public class PlayCountIncrement extends AuthCommand {
|
|
private static final short RECV_PACKET_SIZE = 47;
|
|
private static final byte AUTH_LEVEL = 2;
|
|
private static final short PARAM_SIZE = 46;
|
|
|
|
public PlayCountIncrement(short cmd, AppData data, MakePacket packet, MessageDigest sha1, HmacSha1 hmacSha1,
|
|
Crypt crypt) {
|
|
super(cmd, RECV_PACKET_SIZE, PARAM_SIZE, AUTH_LEVEL, data, packet, sha1, hmacSha1, crypt);
|
|
}
|
|
|
|
public short core(byte[] data, short dataOffset, short dataLength) {
|
|
byte[] arrayOfByte = this.m_ee_data.getGeneralBuffer_ramD();
|
|
if (arrayOfByte.length < 1)
|
|
return AppConfig.A7_FAIL;
|
|
|
|
if (dataLength < (short) (6 + dataOffset + 1))
|
|
return AppConfig.A7_BAD_DATASIZE;
|
|
|
|
arrayOfByte[0] = data[(short) (6 + dataOffset)];
|
|
this.m_ee_data.addValuePlayCounter_ee(arrayOfByte[0]);
|
|
return AppConfig.A7_SUCCESS;
|
|
}
|
|
}
|