| File was renamed from app/src/main/java/com/dayu/recharge/card/ManageCard.java |
| | |
| | | package com.dayu.recharge.card; |
| | | package com.dayu.rechargeqh.card; |
| | | |
| | | import com.dayu.recharge.tools.HexUtil; |
| | | import com.dayu.recharge.utils.MyCommon; |
| | | import com.dayu.rechargeqh.dao.AppDatabase; |
| | | import com.dayu.rechargeqh.tools.HexUtil; |
| | | import com.dayu.rechargeqh.utils.MyCommon; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | * Date: 2023-11-08 10:19 |
| | | * Description: 管理卡 第1扇区 0块 |
| | | */ |
| | | public class ManageCard implements Serializable { |
| | | public class ManageCard extends BaseCard implements Serializable { |
| | | public String cardType = MyCommon.MANAGE_CRAD;//卡类型 |
| | | public String cardData = "A0B1C289";//标识码 |
| | | // public String cardData = "A0B1C289";//标识码 |
| | | |
| | | |
| | | /** |
| | |
| | | return cardData; |
| | | } |
| | | |
| | | public byte[] toZeroByte() { |
| | | public byte[] toZeroByte(AppDatabase appDatabase) { |
| | | setCardData(appDatabase, cardType); |
| | | Zero zero = new Zero(); |
| | | return zero.toByte(); |
| | | } |
| | | |
| | | public class Zero extends BaseCard { |
| | | public class Zero { |
| | | public byte[] toByte() { |
| | | byte[] data = new byte[16]; |
| | | data[0] = HexUtil.hexToByte(cardType); |
| | | |
| | | byte[] cardDataByte = HexUtil.hexToByteArray(cardData); |
| | | if (cardDataByte != null) { |
| | | System.arraycopy(cardDataByte, 0, data, 1, cardDataByte.length); |
| | | } |
| | | System.arraycopy(cardDataByte, 0, data, 1, cardDataByte.length); |
| | | |
| | | if (userCard!=null){ |
| | | if (userCard != null) { |
| | | System.arraycopy(userCard, 0, data, 5, userCard.length); |
| | | } |
| | | |